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

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

Issue 393133003: Oilpan: WebAudio: Apply the weak HashMap pattern to remove an entry from AudioContext::m_dirtyAudio… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a comment, etc. Created 6 years, 5 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/AudioSummingJunction.h » ('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 051f27e64a535f85c27f2e32832ddac62fd0863e..82af11acf1b771bae88162aa485405aea041f822 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -191,6 +191,11 @@ void AudioContext::initialize()
void AudioContext::clear()
{
+#if ENABLE(OILPAN)
+ // We need to run disposers before destructing m_contextGraphMutex.
+ m_liveAudioSummingJunctions.clear();
+#endif
+
// We have to release our reference to the destination node before the context will ever be deleted since the destination node holds a reference to the context.
if (m_destinationNode)
m_destinationNode.clear();
@@ -756,6 +761,20 @@ void AudioContext::handleDeferredAudioNodeTasks()
m_deferredFinishDerefList.clear();
}
+#if ENABLE(OILPAN)
+void AudioContext::registerLiveAudioSummingJunction(AudioSummingJunction& junction)
+{
+ ASSERT(isMainThread());
+ m_liveAudioSummingJunctions.add(&junction, adoptPtr(new AudioSummingJunctionDisposer(junction)));
+}
+
+AudioContext::AudioSummingJunctionDisposer::~AudioSummingJunctionDisposer()
+{
+ ASSERT(isMainThread());
+ m_junction.context()->removeMarkedSummingJunction(&m_junction);
+}
+#endif
+
void AudioContext::markForDeletion(AudioNode* node)
{
ASSERT(isGraphOwner());
@@ -965,6 +984,9 @@ void AudioContext::trace(Visitor* visitor)
visitor->trace(m_renderTarget);
visitor->trace(m_destinationNode);
visitor->trace(m_listener);
+#if ENABLE(OILPAN)
+ visitor->trace(m_liveAudioSummingJunctions);
+#endif
EventTargetWithInlineData::trace(visitor);
}
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioSummingJunction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698