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

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

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Move snapshot maker to tools/ and work for comments Created 3 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
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 e73d307014aae0c4384580b9ff7a099ef35e8710..3542d99d88cc2b1dc6429642ae651ad66fb53caf 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -40,6 +40,7 @@
#include "bindings/core/v8/V8ErrorHandler.h"
#include "bindings/core/v8/V8GCController.h"
#include "bindings/core/v8/V8IdleTaskRunner.h"
+#include "bindings/core/v8/V8SnapshotUtil.h"
#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
@@ -388,6 +389,9 @@ static void InitializeV8Common(v8::Isolate* isolate) {
isolate->SetUseCounterCallback(&UseCounterCallback);
isolate->SetWasmModuleCallback(WasmModuleOverride);
isolate->SetWasmInstanceCallback(WasmInstanceOverride);
+
+ v8::HandleScope handle_scope(isolate);
+ V8SnapshotUtil::EnsureInterfaceTemplates(isolate);
}
namespace {
@@ -449,7 +453,11 @@ void V8Initializer::InitializeMainThread() {
// TODO(altimin): Consider switching to timerTaskRunner here.
v8::Isolate* isolate = V8PerIsolateData::Initialize(
scheduler ? scheduler->LoadingTaskRunner()
- : Platform::Current()->CurrentThread()->GetWebTaskRunner());
+ : Platform::Current()->CurrentThread()->GetWebTaskRunner(),
+ V8SnapshotUtil::GetReferenceTable(),
+ Platform::Current()->IsToTakeV8Snapshot()
+ ? V8PerIsolateData::V8ContextMode::kTakeSnapshot
+ : V8PerIsolateData::V8ContextMode::kUseSnapshot);
InitializeV8Common(isolate);

Powered by Google App Engine
This is Rietveld 408576698