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

Side by Side 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: Bring ToT Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 34
35 namespace blink { 35 namespace blink {
36 36
37 void DeferredTaskHandler::lock() 37 void DeferredTaskHandler::lock()
38 { 38 {
39 // Don't allow regular lock in real-time audio thread. 39 // Don't allow regular lock in real-time audio thread.
40 ASSERT(isMainThread()); 40 ASSERT(isMainThread());
41 m_contextGraphMutex.lock(); 41 m_contextGraphMutex.lock();
42 } 42 }
43 43
44 void DeferredTaskHandler::offlineContextLock()
45 {
46 ASSERT(!isMainThread());
47 m_contextGraphMutex.lock();
48 }
49
44 bool DeferredTaskHandler::tryLock() 50 bool DeferredTaskHandler::tryLock()
45 { 51 {
46 // Try to catch cases of using try lock on main thread 52 // Try to catch cases of using try lock on main thread
47 // - it should use regular lock. 53 // - it should use regular lock.
48 ASSERT(isAudioThread()); 54 ASSERT(isAudioThread());
49 if (!isAudioThread()) { 55 if (!isAudioThread()) {
50 // In release build treat tryLock() as lock() (since above 56 // In release build treat tryLock() as lock() (since above
51 // ASSERT(isAudioThread) never fires) - this is the best we can do. 57 // ASSERT(isAudioThread) never fires) - this is the best we can do.
52 lock(); 58 lock();
53 return true; 59 return true;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 { 267 {
262 ASSERT(isMainThread()); 268 ASSERT(isMainThread());
263 AutoLocker locker(*this); 269 AutoLocker locker(*this);
264 m_renderingOrphanHandlers.clear(); 270 m_renderingOrphanHandlers.clear();
265 m_deletableOrphanHandlers.clear(); 271 m_deletableOrphanHandlers.clear();
266 } 272 }
267 273
268 } // namespace blink 274 } // namespace blink
269 275
270 #endif // ENABLE(WEB_AUDIO) 276 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/DeferredTaskHandler.h ('k') | Source/modules/webaudio/OfflineAudioContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698