Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: Source/modules/webaudio/AudioContext.cpp

Issue 940963005: Revert of WebAudio: Fix AudioNode leak in a case that AudioNode is not disconnected from the ... (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.cpp
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp
index c83cd758fc603b2600c1117d77e63367f65402c7..54f7637fbe38c9998269b4929c17998691a8f5a8 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -111,8 +111,6 @@
, m_connectionCount(0)
, m_didInitializeContextGraphMutex(false)
, m_audioThread(0)
- , m_lastZombie(nullptr)
- , m_lastRemovableZombie(nullptr)
, m_isOfflineContext(false)
, m_contextState(Suspended)
, m_cachedSampleFrame(0)
@@ -135,8 +133,6 @@
, m_connectionCount(0)
, m_didInitializeContextGraphMutex(false)
, m_audioThread(0)
- , m_lastZombie(nullptr)
- , m_lastRemovableZombie(nullptr)
, m_isOfflineContext(true)
, m_contextState(Suspended)
, m_cachedSampleFrame(0)
@@ -173,7 +169,6 @@
if (isInitialized())
return;
- ThreadState::current()->addMarkingTask(this);
FFTFrame::initialize();
m_listener = AudioListener::create();
@@ -244,12 +239,6 @@
m_listener->waitForHRTFDatabaseLoaderThreadCompletion();
clear();
-
- ThreadState::current()->removeMarkingTask(this);
- if (m_lastZombie)
- ThreadState::current()->purifyZombies();
- m_lastZombie = nullptr;
- m_lastRemovableZombie = nullptr;
}
void AudioContext::stop()
@@ -996,8 +985,6 @@
// Dynamically clean up nodes which are no longer needed.
derefFinishedSourceNodes();
- m_lastRemovableZombie = m_lastZombie;
-
// Fixup the state of any dirty AudioSummingJunctions and AudioNodeOutputs.
handleDirtyAudioSummingJunctions();
handleDirtyAudioNodeOutputs();
@@ -1294,7 +1281,14 @@
visitor->trace(m_renderTarget);
visitor->trace(m_destinationNode);
visitor->trace(m_listener);
- visitor->trace(m_referencedNodes);
+ // trace() can be called in AudioContext constructor, and
+ // m_contextGraphMutex might be unavailable.
+ if (m_didInitializeContextGraphMutex) {
+ AutoLocker lock(this);
+ visitor->trace(m_referencedNodes);
+ } else {
+ visitor->trace(m_referencedNodes);
+ }
visitor->trace(m_resumeResolvers);
visitor->trace(m_suspendResolvers);
visitor->trace(m_liveNodes);
@@ -1371,29 +1365,6 @@
return promise;
}
-void AudioContext::setLastZombie(void* object)
-{
- ASSERT(isGraphOwner());
- m_lastZombie = object;
-}
-
-void AudioContext::willStartMarking(ThreadState& threadState)
-{
- lock();
- if (!m_lastRemovableZombie)
- return;
- if (m_lastZombie != m_lastRemovableZombie)
- return;
- threadState.purifyZombies();
- m_lastZombie = nullptr;
- m_lastRemovableZombie = nullptr;
-}
-
-void AudioContext::didFinishMarking(ThreadState&)
-{
- unlock();
-}
-
} // namespace blink
#endif // ENABLE(WEB_AUDIO)
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698