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

Side by Side Diff: Source/modules/webaudio/ScriptProcessorNode.cpp

Issue 941403002: Revert of Add task location information to ExecutionContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // This could be a problem if the main thread is very busy doing other t hings and is being held up handling previous requests. 222 // This could be a problem if the main thread is very busy doing other t hings and is being held up handling previous requests.
223 // The audio thread can't block on this lock, so we call tryLock() inste ad. 223 // The audio thread can't block on this lock, so we call tryLock() inste ad.
224 MutexTryLocker tryLocker(m_processEventLock); 224 MutexTryLocker tryLocker(m_processEventLock);
225 if (!tryLocker.locked()) { 225 if (!tryLocker.locked()) {
226 // We're late in handling the previous request. The main thread must be very busy. 226 // We're late in handling the previous request. The main thread must be very busy.
227 // The best we can do is clear out the buffer ourself here. 227 // The best we can do is clear out the buffer ourself here.
228 outputBuffer->zero(); 228 outputBuffer->zero();
229 } else if (context()->executionContext()) { 229 } else if (context()->executionContext()) {
230 // Fire the event on the main thread, not this one (which is the rea ltime audio thread). 230 // Fire the event on the main thread, not this one (which is the rea ltime audio thread).
231 m_doubleBufferIndexForEvent = m_doubleBufferIndex; 231 m_doubleBufferIndexForEvent = m_doubleBufferIndex;
232 context()->executionContext()->postTask(FROM_HERE, createCrossThread Task(&ScriptProcessorNode::fireProcessEvent, this)); 232 context()->executionContext()->postTask(createCrossThreadTask(&Scrip tProcessorNode::fireProcessEvent, this));
233 } 233 }
234 234
235 swapBuffers(); 235 swapBuffers();
236 } 236 }
237 } 237 }
238 238
239 void ScriptProcessorNode::fireProcessEvent() 239 void ScriptProcessorNode::fireProcessEvent()
240 { 240 {
241 ASSERT(isMainThread()); 241 ASSERT(isMainThread());
242 242
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 DEFINE_TRACE(ScriptProcessorNode) 302 DEFINE_TRACE(ScriptProcessorNode)
303 { 303 {
304 visitor->trace(m_inputBuffers); 304 visitor->trace(m_inputBuffers);
305 visitor->trace(m_outputBuffers); 305 visitor->trace(m_outputBuffers);
306 AudioNode::trace(visitor); 306 AudioNode::trace(visitor);
307 } 307 }
308 308
309 } // namespace blink 309 } // namespace blink
310 310
311 #endif // ENABLE(WEB_AUDIO) 311 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/OfflineAudioDestinationNode.cpp ('k') | Source/modules/webdatabase/Database.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698