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 b49db8f4544d9fcc501eebe93b9c73c89e957656..347c27bc822eeade5ec98a269aec2b81f2afe953 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
@@ -392,9 +392,11 @@ void V8Initializer::initializeMainThread() { |
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, |
v8ExtrasMode, &arrayBufferAllocator); |
+ // NOTE: Some threads (namely utility threads) don't have a scheduler. |
WebScheduler* scheduler = Platform::current()->currentThread()->scheduler(); |
- v8::Isolate* isolate = |
- V8PerIsolateData::initialize(scheduler->timerTaskRunner()); |
+ v8::Isolate* isolate = V8PerIsolateData::initialize( |
+ scheduler ? scheduler->timerTaskRunner() |
+ : Platform::current()->currentThread()->getWebTaskRunner()); |
initializeV8Common(isolate); |