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

Unified Diff: Source/bindings/v8/WorkerScriptController.cpp

Issue 219003002: [ABANDONED] Call Microtask::performCheckpoint for each worker task. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: PS2 (with additional comments) Created 6 years, 8 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 | « no previous file | Source/core/workers/WorkerRunLoop.cpp » ('j') | Source/core/workers/WorkerRunLoop.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/WorkerScriptController.cpp
diff --git a/Source/bindings/v8/WorkerScriptController.cpp b/Source/bindings/v8/WorkerScriptController.cpp
index 947aa27d062537722080e3ab0931619a00f899db..8b5c32ec7b1949f1fe3eaaa1e4ba2c17d7568190 100644
--- a/Source/bindings/v8/WorkerScriptController.cpp
+++ b/Source/bindings/v8/WorkerScriptController.cpp
@@ -70,6 +70,16 @@ WorkerScriptController::WorkerScriptController(WorkerGlobalScope& workerGlobalSc
V8PerIsolateData::ensureInitialized(m_isolate);
m_world = DOMWrapperWorld::create(WorkerWorldId);
m_interruptor = adoptPtr(new V8IsolateInterruptor(m_isolate));
+
+ // FIXME: Calling v8::Context::New in ensureDomInJsContext() later may
+ // fail in certain cases and lead to a crash.
+ // Since the main thread may call scheduleExecutionTermination at arbitrary
+ // timing, calling v8::Context::New in the worker thread may fail and
+ // result in a crash.
+ // We need these statements here to prevent that.
+ v8::HandleScope handleScope(m_isolate);
+ V8PerIsolateData::from(m_isolate)->ensureDomInJSContext();
+
ThreadState::current()->addInterruptor(m_interruptor.get());
}
« no previous file with comments | « no previous file | Source/core/workers/WorkerRunLoop.cpp » ('j') | Source/core/workers/WorkerRunLoop.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698