Chromium Code Reviews| 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 f48e04e15a46b505d498fdcdf93b76e698860b29..f65e2123b5f47c3e55e25f07d00cb6ca63d3e606 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp |
| @@ -41,6 +41,7 @@ |
| #include "bindings/core/v8/V8GCController.h" |
| #include "bindings/core/v8/V8IdleTaskRunner.h" |
| #include "bindings/core/v8/V8Location.h" |
| +#include "bindings/core/v8/V8SnapshotCreator.h" |
| #include "bindings/core/v8/V8Window.h" |
| #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| #include "core/dom/Document.h" |
| @@ -446,7 +447,7 @@ static void AdjustAmountOfExternalAllocatedMemory(int64_t diff) { |
| v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(diff); |
| } |
| -void V8Initializer::InitializeMainThread() { |
| +void V8Initializer::InitializeMainThread(intptr_t* table) { |
|
Yuki
2017/05/12 15:20:10
|table| doesn't make much sense.
v8_snapshot_exter
peria
2017/05/30 08:25:42
Acknowledged.
|
| DCHECK(IsMainThread()); |
| WTF::ArrayBufferContents::Initialize(AdjustAmountOfExternalAllocatedMemory); |
| @@ -459,14 +460,17 @@ void V8Initializer::InitializeMainThread() { |
| v8_extras_mode, &array_buffer_allocator); |
| // NOTE: Some threads (namely utility threads) don't have a scheduler. |
| - WebScheduler* scheduler = Platform::Current()->CurrentThread()->Scheduler(); |
| + WebThread* thread = Platform::Current()->CurrentThread(); |
| + WebScheduler* scheduler = thread ? thread->Scheduler() : nullptr; |
| + |
| // When timer task runner is used for PerIsolateData, GC tasks are getting |
| // 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( |
| scheduler ? scheduler->LoadingTaskRunner() |
| - : Platform::Current()->CurrentThread()->GetWebTaskRunner()); |
| + : thread ? thread->GetWebTaskRunner() : nullptr, |
| + table, V8SnapshotCreator::TakingSnapshot()); |
| InitializeV8Common(isolate); |