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

Unified Diff: third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp

Issue 2738823004: Replace createCrossThreadTask with crossThreadBind in webaudio (Closed)
Patch Set: RefPtr -> wrapPassRefPtr Created 3 years, 9 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 | « third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
index 19dc6b0ed0913cd2413807f3661c13597cc43128..d84fd23d118794f82bbbb8eda325e73811c3928a 100644
--- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
@@ -27,13 +27,13 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
-#include "core/dom/ExecutionContextTask.h"
#include "core/dom/TaskRunnerHelper.h"
#include "modules/webaudio/AudioBuffer.h"
#include "modules/webaudio/AudioNodeInput.h"
#include "modules/webaudio/AudioNodeOutput.h"
#include "modules/webaudio/AudioProcessingEvent.h"
#include "modules/webaudio/BaseAudioContext.h"
+#include "platform/CrossThreadFunctional.h"
#include "platform/WaitableEvent.h"
#include "public/platform/Platform.h"
@@ -206,23 +206,26 @@ void ScriptProcessorHandler::process(size_t framesToProcess) {
if (context()->hasRealtimeConstraint()) {
// Fire the event on the main thread with the appropriate buffer
// index.
- context()->getExecutionContext()->postTask(
- TaskType::MediaElementEvent, BLINK_FROM_HERE,
- createCrossThreadTask(&ScriptProcessorHandler::fireProcessEvent,
- crossThreadUnretained(this),
- m_doubleBufferIndex));
+ TaskRunnerHelper::get(TaskType::MediaElementEvent,
+ context()->getExecutionContext())
+ ->postTask(BLINK_FROM_HERE,
+ crossThreadBind(
+ &ScriptProcessorHandler::fireProcessEvent,
+ crossThreadUnretained(this), m_doubleBufferIndex));
} else {
// If this node is in the offline audio context, use the
// waitable event to synchronize to the offline rendering thread.
std::unique_ptr<WaitableEvent> waitableEvent =
WTF::makeUnique<WaitableEvent>();
- context()->getExecutionContext()->postTask(
- TaskType::MediaElementEvent, BLINK_FROM_HERE,
- createCrossThreadTask(
- &ScriptProcessorHandler::fireProcessEventForOfflineAudioContext,
- crossThreadUnretained(this), m_doubleBufferIndex,
- crossThreadUnretained(waitableEvent.get())));
+ TaskRunnerHelper::get(TaskType::MediaElementEvent,
+ context()->getExecutionContext())
+ ->postTask(BLINK_FROM_HERE,
+ crossThreadBind(
+ &ScriptProcessorHandler::
+ fireProcessEventForOfflineAudioContext,
+ crossThreadUnretained(this), m_doubleBufferIndex,
+ crossThreadUnretained(waitableEvent.get())));
// Okay to block the offline audio rendering thread since it is
// not the actual audio device thread.
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698