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

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

Issue 2703183002: Factor out gin::IsolateHolder's constructor
Patch Set: fix WorkerBackingThread Created 3 years, 10 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 | third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
index a0c4d830b0038274700ce939d2a12684a327e4e6..13363387953dd7545130493ec32294f3936291ad 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -397,9 +397,17 @@ void V8Initializer::initializeMainThread() {
// throttled and memory usage goes up. For now we're using loading task queue
// to prevent this.
// TODO(altimin): Consider switching to timerTaskRunner here.
- v8::Isolate* isolate = V8PerIsolateData::initialize(
+
+ WebTaskRunner* taskRunner =
scheduler ? scheduler->loadingTaskRunner()
- : Platform::current()->currentThread()->getWebTaskRunner());
+ : Platform::current()->currentThread()->getWebTaskRunner();
+ std::unique_ptr<gin::IsolateHolder> isolateHolder(
+ WTF::makeUnique<gin::IsolateHolder>(
+ taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr,
+ gin::IsolateHolder::kSingleThread,
+ isMainThread() ? gin::IsolateHolder::kDisallowAtomicsWait
+ : gin::IsolateHolder::kAllowAtomicsWait));
+ v8::Isolate* isolate = V8PerIsolateData::initialize(std::move(isolateHolder));
initializeV8Common(isolate);
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698