Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h |
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h |
index db38c708512fb37bf12e5b7afb2235f2fdc77502..56de4b291547fd74c8ca7e05e96f3aa88be6b20a 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h |
@@ -100,24 +100,19 @@ public: |
{ |
ASSERT(!wrapper.IsEmpty()); |
if (UNLIKELY(containsWrapper())) { |
- wrapper = newLocalWrapper(isolate); |
+ wrapper = mainWorldWrapper(isolate); |
return false; |
} |
- m_wrapper.Reset(isolate, wrapper); |
- wrapperTypeInfo->configureWrapper(&m_wrapper); |
- m_wrapper.SetWeak(); |
+ m_mainWorldWrapper.Reset(isolate, wrapper); |
+ wrapperTypeInfo->configureWrapper(&m_mainWorldWrapper); |
+ m_mainWorldWrapper.SetWeak(); |
ASSERT(containsWrapper()); |
return true; |
} |
- v8::Local<v8::Object> newLocalWrapper(v8::Isolate* isolate) const |
- { |
- return v8::Local<v8::Object>::New(isolate, m_wrapper); |
- } |
- |
bool isEqualTo(const v8::Local<v8::Object>& other) const |
{ |
- return m_wrapper == other; |
+ return m_mainWorldWrapper == other; |
} |
// Provides a way to convert Node* to ScriptWrappable* without including |
@@ -139,16 +134,16 @@ public: |
bool setReturnValue(v8::ReturnValue<v8::Value> returnValue) |
{ |
- returnValue.Set(m_wrapper); |
+ returnValue.Set(m_mainWorldWrapper); |
return containsWrapper(); |
} |
void setReference(const v8::Persistent<v8::Object>& parent, v8::Isolate* isolate) |
{ |
- isolate->SetReference(parent, m_wrapper); |
+ isolate->SetReference(parent, m_mainWorldWrapper); |
} |
- bool containsWrapper() const { return !m_wrapper.IsEmpty(); } |
+ bool containsWrapper() const { return !m_mainWorldWrapper.IsEmpty(); } |
/** |
* Mark wrapper of this ScriptWrappable as alive in V8. Only marks |
@@ -169,7 +164,17 @@ public: |
// already broken), we must not hit the RELEASE_ASSERT. |
private: |
- v8::Persistent<v8::Object> m_wrapper; |
+ friend class DOMDataStore; |
Yuki
2016/05/31 04:43:11
Maybe, better to comment why these classes are fri
haraken
2016/05/31 04:44:33
Done.
|
+ friend class V8HiddenValue; |
+ friend class V8PrivateProperty; |
+ friend class WebGLRenderingContextBase; |
+ |
+ v8::Local<v8::Object> mainWorldWrapper(v8::Isolate* isolate) const |
+ { |
+ return v8::Local<v8::Object>::New(isolate, m_mainWorldWrapper); |
+ } |
+ |
+ v8::Persistent<v8::Object> m_mainWorldWrapper; |
}; |
// Defines 'wrapperTypeInfo' virtual method which returns the WrapperTypeInfo of |