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

Unified Diff: Source/bindings/v8/DOMDataStore.h

Issue 163913005: Remove WrapperWorldType from DOMDataStore (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | Source/bindings/v8/DOMDataStore.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/DOMDataStore.h
diff --git a/Source/bindings/v8/DOMDataStore.h b/Source/bindings/v8/DOMDataStore.h
index 8e2f60becdde8411194a7d88166ee83da30e0f02..c45034c633bd67250b3f1403fd139043df15d68c 100644
--- a/Source/bindings/v8/DOMDataStore.h
+++ b/Source/bindings/v8/DOMDataStore.h
@@ -46,7 +46,7 @@ class Node;
class DOMDataStore {
WTF_MAKE_NONCOPYABLE(DOMDataStore);
public:
- explicit DOMDataStore(WrapperWorldType);
+ explicit DOMDataStore(bool isMainWorld);
~DOMDataStore();
static DOMDataStore& current(v8::Isolate*);
@@ -139,7 +139,7 @@ public:
template<typename V8T, typename T>
inline v8::Handle<v8::Object> get(T* object, v8::Isolate* isolate)
{
- if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == MainWorld)
+ if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_isMainWorld)
return ScriptWrappable::getUnsafeWrapperFromObject(object).newLocal(isolate);
return m_wrapperMap.newLocal(V8T::toInternalPointer(object), isolate);
}
@@ -147,7 +147,7 @@ public:
template<typename V8T, typename T>
inline void setReference(const v8::Persistent<v8::Object>& parent, T* child, v8::Isolate* isolate)
{
- if (ScriptWrappable::wrapperCanBeStoredInObject(child) && m_type == MainWorld) {
+ if (ScriptWrappable::wrapperCanBeStoredInObject(child) && m_isMainWorld) {
ScriptWrappable::getUnsafeWrapperFromObject(child).setReferenceFrom(parent, isolate);
return;
}
@@ -157,7 +157,7 @@ public:
template<typename V8T, typename T>
inline bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, T* object)
{
- if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == MainWorld)
+ if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_isMainWorld)
return ScriptWrappable::setReturnValue(returnValue, object);
return m_wrapperMap.setReturnValueFrom(returnValue, V8T::toInternalPointer(object));
}
@@ -165,7 +165,7 @@ public:
template<typename V8T, typename T>
inline bool containsWrapper(T* object)
{
- if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == MainWorld)
+ if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_isMainWorld)
return !ScriptWrappable::getUnsafeWrapperFromObject(object).isEmpty();
return m_wrapperMap.containsKey(V8T::toInternalPointer(object));
}
@@ -176,7 +176,7 @@ private:
{
ASSERT(!!object);
ASSERT(!wrapper.IsEmpty());
- if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == MainWorld) {
+ if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_isMainWorld) {
ScriptWrappable::setWrapperInObject(object, wrapper, isolate, configuration);
return;
}
@@ -195,11 +195,11 @@ private:
{
// Verify our assumptions about the main world.
UnsafePersistent<v8::Object> unsafePersistent = wrappable->unsafePersistent();
- ASSERT(unsafePersistent.isEmpty() || !(holder == *unsafePersistent.persistent()) || current(v8::Isolate::GetCurrent()).m_type == MainWorld);
+ ASSERT(unsafePersistent.isEmpty() || !(holder == *unsafePersistent.persistent()) || current(v8::Isolate::GetCurrent()).m_isMainWorld);
return holder == *unsafePersistent.persistent();
}
- WrapperWorldType m_type;
+ bool m_isMainWorld;
DOMWrapperMap<void> m_wrapperMap;
};
« no previous file with comments | « no previous file | Source/bindings/v8/DOMDataStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698