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

Unified Diff: Source/core/dom/Microtask.cpp

Issue 319753004: Enqueue Blink microtasks using V8's C++ API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 6 years, 6 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 | « Source/bindings/v8/V8PerIsolateData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Microtask.cpp
diff --git a/Source/core/dom/Microtask.cpp b/Source/core/dom/Microtask.cpp
index 7eed205751602759eab6e1b581ffb4f48504511e..c732cdcaaafcafeb8b522267f703c113b41a3db5 100644
--- a/Source/core/dom/Microtask.cpp
+++ b/Source/core/dom/Microtask.cpp
@@ -51,22 +51,16 @@ void Microtask::performCheckpoint()
isolateData->setPerformingMicrotaskCheckpoint(false);
}
-static void microtaskFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+static void microtaskFunctionCallback(void* data)
{
- OwnPtr<blink::WebThread::Task> task = adoptPtr(static_cast<blink::WebThread::Task*>(info.Data().As<v8::External>()->Value()));
+ OwnPtr<blink::WebThread::Task> task = adoptPtr(static_cast<blink::WebThread::Task*>(data));
task->run();
}
void Microtask::enqueueMicrotask(PassOwnPtr<blink::WebThread::Task> callback)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
- V8PerIsolateData* isolateData = V8PerIsolateData::from(isolate);
- v8::HandleScope handleScope(isolate);
- v8::Local<v8::Context> context = isolateData->ensureDomInJSContext();
- ASSERT(!context.IsEmpty());
- v8::Context::Scope scope(context);
- v8::Local<v8::External> handler = v8::External::New(isolate, callback.leakPtr());
- isolate->EnqueueMicrotask(v8::Function::New(isolate, &microtaskFunctionCallback, handler));
+ isolate->EnqueueMicrotask(&microtaskFunctionCallback, callback.leakPtr());
}
void Microtask::enqueueMicrotask(const Closure& callback)
« no previous file with comments | « Source/bindings/v8/V8PerIsolateData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698