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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h

Issue 2021203002: Rename ScriptWrappable::newLocalWrapper to ScriptWrappable::mainWorldWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/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..2b7f52e5acfa692deb12ccf1c17233ade1547c61 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,18 @@ public:
// already broken), we must not hit the RELEASE_ASSERT.
private:
- v8::Persistent<v8::Object> m_wrapper;
+ // These classes are exceptionally allowed to use mainWorldWrapper().
+ friend class DOMDataStore;
+ 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

Powered by Google App Engine
This is Rietveld 408576698