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

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

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 | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.h
diff --git a/Source/modules/webaudio/AudioContext.h b/Source/modules/webaudio/AudioContext.h
index fcea7b3547222dc415ee93417dba318d2bf65e6d..b3e4b4ef9840727ad39fea894333bcc0394c6a18 100644
--- a/Source/modules/webaudio/AudioContext.h
+++ b/Source/modules/webaudio/AudioContext.h
@@ -140,6 +140,9 @@ public:
// Called periodically at the end of each render quantum to dereference finished source nodes.
void derefFinishedSourceNodes();
+#if ENABLE(OILPAN)
+ void registerLiveAudioSummingJunction(AudioSummingJunction&);
+#endif
// We schedule deletion of all marked nodes at the end of each realtime render quantum.
void markForDeletion(AudioNode*);
void deleteMarkedNodes();
@@ -276,6 +279,21 @@ private:
// before deref().
Vector<RefPtr<AudioNode> > m_referencedNodes;
+#if ENABLE(OILPAN)
+ class AudioSummingJunctionDisposer {
+ public:
+ explicit AudioSummingJunctionDisposer(AudioSummingJunction& junction) : m_junction(junction) { }
+ ~AudioSummingJunctionDisposer();
+
+ private:
+ AudioSummingJunction& m_junction;
+ };
+ // The purpose of m_liveAudioSummingJunctions is to remove a dying
+ // AudioSummingJunction from m_dirtySummingJunctions. However we put all of
+ // AudioSummingJunction objects to m_liveAudioSummingJunctions to avoid
+ // concurrent access to m_liveAudioSummingJunctions.
+ HeapHashMap<WeakMember<AudioSummingJunction>, OwnPtr<AudioSummingJunctionDisposer> > m_liveAudioSummingJunctions;
+#endif
// Accumulate nodes which need to be deleted here.
// This is copied to m_nodesToDelete at the end of a render cycle in handlePostRenderTasks(), where we're assured of a stable graph
// state which will have no references to any of the nodes in m_nodesToDelete once the context lock is released
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698