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

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

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for most comments Created 3 years, 7 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/V8DOMConfiguration.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
index cff7f2b161fc40ff6fd05cc7d66ba6c4efc02cee..7d3dd31a9a2186e21bd7385fe089b537589ae82a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
@@ -28,6 +28,7 @@
#include "bindings/core/v8/V8DOMConfiguration.h"
+#include "bindings/core/v8/V8SnapshotCreator.h"
#include "platform/bindings/V8ObjectConstructor.h"
#include "platform/bindings/V8PerContextData.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
@@ -702,16 +703,21 @@ v8::Local<v8::FunctionTemplate> V8DOMConfiguration::DomClassTemplate(
WrapperTypeInfo* wrapper_type_info,
InstallTemplateFunction configure_dom_class_template) {
V8PerIsolateData* data = V8PerIsolateData::From(isolate);
- v8::Local<v8::FunctionTemplate> result =
+ v8::Local<v8::FunctionTemplate> interface_template =
data->FindInterfaceTemplate(world, wrapper_type_info);
- if (!result.IsEmpty())
- return result;
-
- result = v8::FunctionTemplate::New(
- isolate, V8ObjectConstructor::IsValidConstructorMode);
- configure_dom_class_template(isolate, world, result);
- data->SetInterfaceTemplate(world, wrapper_type_info, result);
- return result;
+ if (!interface_template.IsEmpty())
+ return interface_template;
+
+ interface_template = V8SnapshotCreator::CreateInterfaceTemplate(
Yuki 2017/05/30 14:35:56 nit: This seems not creating an interface template
peria 2017/06/01 08:33:33 Done.
+ isolate, world, wrapper_type_info);
+
+ if (interface_template.IsEmpty()) {
+ interface_template = v8::FunctionTemplate::New(
+ isolate, V8ObjectConstructor::IsValidConstructorMode);
+ configure_dom_class_template(isolate, world, interface_template);
+ }
+ data->SetInterfaceTemplate(world, wrapper_type_info, interface_template);
+ return interface_template;
}
void V8DOMConfiguration::SetClassString(

Powered by Google App Engine
This is Rietveld 408576698