Title: [240142] trunk/Source/WebCore
Revision
240142
Author
[email protected]
Date
2019-01-18 05:46:29 -0800 (Fri, 18 Jan 2019)

Log Message

[WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
https://bugs.webkit.org/show_bug.cgi?id=192586

Patch by Yacine Bandou <[email protected]> on 2019-01-18
Reviewed by Philippe Normand.

When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
the AudioDestinationNode is not destroyed.

In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
the resources leak.

AudioContext::uninitialize() is not called immediately since r94608.
This modification can now be reverted without regression in WebAudio tests.

Test: webaudio/mediaelementaudiosourcenode-gc.html

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::stop):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240141 => 240142)


--- trunk/Source/WebCore/ChangeLog	2019-01-18 13:07:38 UTC (rev 240141)
+++ trunk/Source/WebCore/ChangeLog	2019-01-18 13:46:29 UTC (rev 240142)
@@ -1,3 +1,25 @@
+2019-01-18  Yacine Bandou  <[email protected]>
+
+        [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
+        https://bugs.webkit.org/show_bug.cgi?id=192586
+
+        Reviewed by Philippe Normand.
+
+        When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
+        the AudioDestinationNode is not destroyed.
+
+        In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
+        is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
+        the resources leak.
+
+        AudioContext::uninitialize() is not called immediately since r94608.
+        This modification can now be reverted without regression in WebAudio tests.
+
+        Test: webaudio/mediaelementaudiosourcenode-gc.html
+
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::stop):
+
 2019-01-18  Simon Fraser  <[email protected]>
 
         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed

Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (240141 => 240142)


--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp	2019-01-18 13:07:38 UTC (rev 240141)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp	2019-01-18 13:46:29 UTC (rev 240142)
@@ -314,16 +314,8 @@
 
     m_eventQueue->close();
 
-    // Don't call uninitialize() immediately here because the ScriptExecutionContext is in the middle
-    // of dealing with all of its ActiveDOMObjects at this point. uninitialize() can de-reference other
-    // ActiveDOMObjects so let's schedule uninitialize() to be called later.
-    // FIXME: see if there's a more direct way to handle this issue.
-    // FIXME: This sounds very wrong. The whole idea of stop() is that it stops everything, and if we
-    // schedule some observable work for later, the work likely happens at an inappropriate time.
-    callOnMainThread([this] {
-        uninitialize();
-        clear();
-    });
+    uninitialize();
+    clear();
 }
 
 bool AudioContext::canSuspendForDocumentSuspension() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to