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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp

Issue 2642113002: Worker: Reduce use of ExecutionContextTask in core/workers (Closed)
Patch Set: fix build failures Created 3 years, 11 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: third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
index 1a79822579153f1b162750fe0a14b5f0bbc49494..174594f1e79008f7ce783353485156de791f973a 100644
--- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
@@ -4,11 +4,14 @@
#include "core/workers/WorkerOrWorkletGlobalScope.h"
+#include "core/dom/ExecutionContextTask.h"
#include "core/frame/Deprecation.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThread.h"
+#include "platform/CrossThreadFunctional.h"
+#include "wtf/Functional.h"
namespace blink {
@@ -47,16 +50,15 @@ void WorkerOrWorkletGlobalScope::postTask(
task.get());
}
- std::unique_ptr<ExecutionContextTask> wrappedTask = createCrossThreadTask(
- &WorkerOrWorkletGlobalScope::runTask, wrapCrossThreadWeakPersistent(this),
- WTF::passed(std::move(task)), isInstrumented);
- thread()->postTask(location, std::move(wrappedTask));
+ thread()->postTask(
+ location, crossThreadBind(&WorkerOrWorkletGlobalScope::runTask,
+ wrapCrossThreadWeakPersistent(this),
+ WTF::passed(std::move(task)), isInstrumented));
}
void WorkerOrWorkletGlobalScope::runTask(
std::unique_ptr<ExecutionContextTask> task,
- bool isInstrumented,
- ExecutionContext*) {
+ bool isInstrumented) {
DCHECK(thread()->isCurrentThread());
InspectorInstrumentation::AsyncTask asyncTask(this, task.get(),
isInstrumented);

Powered by Google App Engine
This is Rietveld 408576698