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

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

Issue 1140723003: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adapting CL to AbstractAudioContext Created 5 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
Index: Source/modules/webaudio/DeferredTaskHandler.cpp
diff --git a/Source/modules/webaudio/DeferredTaskHandler.cpp b/Source/modules/webaudio/DeferredTaskHandler.cpp
index e5ded30448748d06e92bb85998c3243ef5dc2d82..339e3fd9b32f5cfdaa28c5529ac7bb2733935b78 100644
--- a/Source/modules/webaudio/DeferredTaskHandler.cpp
+++ b/Source/modules/webaudio/DeferredTaskHandler.cpp
@@ -41,6 +41,14 @@ void DeferredTaskHandler::lock()
m_contextGraphMutex.lock();
}
+void DeferredTaskHandler::forceLock()
+{
+ // This allows the regular lock in offline audio rendering. It is okay to
Raymond Toy 2015/07/15 20:59:14 What do you mean by "allows the regular lock"?
hongchan 2015/07/15 23:24:22 What I meant was this lock is not a 'tryLock()'.
Raymond Toy 2015/07/16 16:52:04 Maybe it would be clearer if forceLock were named
hongchan 2015/07/16 17:24:37 Done.
+ // lock the offline audio render thread because it is not real-time thread.
+ ASSERT(!isMainThread());
Raymond Toy 2015/07/16 16:52:04 Can we also assert that this is not the audio thre
hongchan 2015/07/16 17:24:37 This is not possible. The offline render thread is
+ m_contextGraphMutex.lock();
+}
+
bool DeferredTaskHandler::tryLock()
{
// Try to catch cases of using try lock on main thread

Powered by Google App Engine
This is Rietveld 408576698