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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp

Issue 1405413004: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarifying error messages in layout tests Created 5 years, 2 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return true; 53 return true;
54 } 54 }
55 return m_contextGraphMutex.tryLock(); 55 return m_contextGraphMutex.tryLock();
56 } 56 }
57 57
58 void DeferredTaskHandler::unlock() 58 void DeferredTaskHandler::unlock()
59 { 59 {
60 m_contextGraphMutex.unlock(); 60 m_contextGraphMutex.unlock();
61 } 61 }
62 62
63 void DeferredTaskHandler::offlineLock()
64 {
65 // It is safe to lock the audio thread for offline rendering, but
66 // let us have RELEASE_ASSERT here to make sure to explicitly crash rather
67 // than accidentally blocking the audio thread.
68 RELEASE_ASSERT(isAudioThread());
Raymond Toy 2015/10/21 18:22:45 Maybe use RELEASE_ASSERT_WITH_MESSAGE so a simple
hongchan 2015/10/22 18:23:48 Done.
69
70 m_contextGraphMutex.lock();
71 }
72
63 #if ENABLE(ASSERT) 73 #if ENABLE(ASSERT)
64 bool DeferredTaskHandler::isGraphOwner() 74 bool DeferredTaskHandler::isGraphOwner()
65 { 75 {
66 return m_contextGraphMutex.locked(); 76 return m_contextGraphMutex.locked();
67 } 77 }
68 #endif 78 #endif
69 79
70 void DeferredTaskHandler::addDeferredBreakConnection(AudioHandler& node) 80 void DeferredTaskHandler::addDeferredBreakConnection(AudioHandler& node)
71 { 81 {
72 ASSERT(isAudioThread()); 82 ASSERT(isAudioThread());
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 { 271 {
262 ASSERT(isMainThread()); 272 ASSERT(isMainThread());
263 AutoLocker locker(*this); 273 AutoLocker locker(*this);
264 m_renderingOrphanHandlers.clear(); 274 m_renderingOrphanHandlers.clear();
265 m_deletableOrphanHandlers.clear(); 275 m_deletableOrphanHandlers.clear();
266 } 276 }
267 277
268 } // namespace blink 278 } // namespace blink
269 279
270 #endif // ENABLE(WEB_AUDIO) 280 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698