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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/Microtask.cpp

Issue 1978583003: Remove use of WebTaskRunner::Task and SameThreadTask from Microtask (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Shironeko_2
Patch Set: Created 4 years, 7 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/bindings/core/v8/Microtask.h ('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/bindings/core/v8/Microtask.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp b/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp
index e4bebee364b87660e3c6c2166d5386316c96bf2d..48376d05c55d1561f82197766c88dedea75c1fd1 100644
--- a/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp
@@ -45,19 +45,14 @@ void Microtask::performCheckpoint(v8::Isolate* isolate)
static void microtaskFunctionCallback(void* data)
{
- OwnPtr<WebTaskRunner::Task> task = adoptPtr(static_cast<WebTaskRunner::Task*>(data));
- task->run();
-}
-
-void Microtask::enqueueMicrotask(std::unique_ptr<WebTaskRunner::Task> callback)
-{
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- isolate->EnqueueMicrotask(&microtaskFunctionCallback, callback.release());
+ std::unique_ptr<SameThreadClosure> task = wrapUnique(static_cast<SameThreadClosure*>(data));
+ (*task)();
}
void Microtask::enqueueMicrotask(std::unique_ptr<SameThreadClosure> callback)
{
- enqueueMicrotask(wrapUnique(new SameThreadTask(std::move(callback))));
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ isolate->EnqueueMicrotask(&microtaskFunctionCallback, static_cast<void*>(callback.release()));
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/Microtask.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698