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

Unified Diff: third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for all 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/platform/bindings/V8PerContextData.cpp
diff --git a/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp b/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
index 3a955b8e31d63f363a653ea904ff0d18adf9b5d8..2ef21508503cd85ffaefe95182e310b5840eced9 100644
--- a/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
+++ b/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
@@ -89,8 +89,10 @@ v8::Local<v8::Object> V8PerContextData::CreateWrapperFromCacheSlowCase(
const WrapperTypeInfo* type) {
DCHECK(!error_prototype_.IsEmpty());
- v8::Context::Scope scope(GetContext());
+ v8::Local<v8::Context> context = GetContext();
Yuki 2017/06/20 14:20:11 |context| seems never used again?
peria 2017/06/21 07:19:16 Done.
+ v8::Context::Scope scope(context);
v8::Local<v8::Function> interface_object = ConstructorForType(type);
+
CHECK(!interface_object.IsEmpty());
v8::Local<v8::Object> instance_template =
V8ObjectConstructor::NewInstance(isolate_, interface_object)
@@ -159,7 +161,6 @@ v8::Local<v8::Function> V8PerContextData::ConstructorForTypeSlowCase(
// Origin Trials
InstallConditionalFeatures(type, ScriptState::From(current_context),
prototype_object, interface_object);
-
constructor_map_.Set(type, interface_object);
return interface_object;

Powered by Google App Engine
This is Rietveld 408576698