Index: third_party/WebKit/Source/platform/bindings/V8PerIsolateData.h |
diff --git a/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.h b/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.h |
index f5c9f0b1a3cd0db6c850a30789689b5a13c51b0d..a4541966bb33d6ff2ea07b3cbbda15d8d37ff507 100644 |
--- a/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.h |
+++ b/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.h |
@@ -98,7 +98,7 @@ class PLATFORM_EXPORT V8PerIsolateData { |
virtual ~Data() = default; |
}; |
- static v8::Isolate* Initialize(WebTaskRunner*); |
+ static v8::Isolate* Initialize(WebTaskRunner*, intptr_t*, bool); |
static V8PerIsolateData* From(v8::Isolate* isolate) { |
DCHECK(isolate); |
@@ -115,6 +115,9 @@ class PLATFORM_EXPORT V8PerIsolateData { |
std::unique_ptr<gin::V8IdleTaskRunner>); |
v8::Isolate* GetIsolate() { return isolate_holder_.isolate(); } |
+ v8::SnapshotCreator* GetSnapshotCreator() { |
+ return isolate_holder_.snapshot_creator(); |
+ } |
StringCache* GetStringCache() { return string_cache_.get(); } |
@@ -137,9 +140,16 @@ class PLATFORM_EXPORT V8PerIsolateData { |
// Accessors to the cache of interface templates. |
v8::Local<v8::FunctionTemplate> FindInterfaceTemplate(const DOMWrapperWorld&, |
const void* key); |
+ v8::Local<v8::FunctionTemplate> FindInterfaceTemplateTemp( |
+ const DOMWrapperWorld&, |
+ const void* key); |
void SetInterfaceTemplate(const DOMWrapperWorld&, |
const void* key, |
v8::Local<v8::FunctionTemplate>); |
+ void SetInterfaceTemplateTemp(const DOMWrapperWorld&, |
+ const void* key, |
+ v8::Local<v8::FunctionTemplate>); |
+ void ClearAll(); |
// Accessor to the cache of cross-origin accessible operation's templates. |
// Created templates get automatically cached. |
@@ -220,10 +230,21 @@ class PLATFORM_EXPORT V8PerIsolateData { |
return script_wrappable_visitor_.get(); |
} |
+ bool UseSnapshot() const { |
+ return isolate_holder_.v8_context_mode() == |
+ gin::IsolateHolder::kUseSnapshot; |
+ } |
+ |
private: |
- explicit V8PerIsolateData(WebTaskRunner*); |
+ explicit V8PerIsolateData(WebTaskRunner*, intptr_t*, bool); |
~V8PerIsolateData(); |
+ using CopyableTraits = v8::CopyablePersistentTraits<v8::FunctionTemplate>; |
+ using CopyablePersistent = |
+ v8::Persistent<v8::FunctionTemplate, CopyableTraits>; |
+ using V8TemporaryFunctionTemplateMap = |
+ HashMap<const void*, CopyablePersistent>; |
+ |
typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> |
V8FunctionTemplateMap; |
V8FunctionTemplateMap& SelectInterfaceTemplateMap(const DOMWrapperWorld&); |
@@ -237,10 +258,13 @@ class PLATFORM_EXPORT V8PerIsolateData { |
gin::IsolateHolder isolate_holder_; |
- // m_interfaceTemplateMapFor{,Non}MainWorld holds function templates for |
+ // interface_template_map_for_{,non_}main_world holds function templates for |
// the inerface objects. |
V8FunctionTemplateMap interface_template_map_for_main_world_; |
V8FunctionTemplateMap interface_template_map_for_non_main_world_; |
+ |
+ V8TemporaryFunctionTemplateMap interface_template_temp_map_; |
+ |
// m_operationTemplateMapFor{,Non}MainWorld holds function templates for |
// the cross-origin accessible DOM operations. |
V8FunctionTemplateMap operation_template_map_for_main_world_; |