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

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

Issue 68173017: Have DOMDataStore::current() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 154d8d8d1ba09d407e5ce8afe1ac3631045edb46..a75d38f02d5861fbc7f9b426a269361b0c76cf04 100644
--- a/Source/bindings/v8/DOMDataStore.h
+++ b/Source/bindings/v8/DOMDataStore.h
@@ -49,7 +49,7 @@ public:
explicit DOMDataStore(WrapperWorldType);
~DOMDataStore();
- static DOMDataStore* current(v8::Isolate*);
+ static DOMDataStore& current(v8::Isolate*);
template<typename V8T, typename T, typename Wrappable>
static bool setReturnValueFromWrapperFast(v8::ReturnValue<v8::Value> returnValue, T* object, v8::Local<v8::Object> holder, Wrappable* wrappable)
@@ -63,9 +63,9 @@ public:
if ((!DOMWrapperWorld::isolatedWorldsExist() && !canExistInWorker(object)) || holderContainsWrapper(holder, wrappable)) {
if (ScriptWrappable::wrapperCanBeStoredInObject(object))
return ScriptWrappable::setReturnValueWithSecurityCheck<V8T>(returnValue, object);
- return mainWorldStore()->m_wrapperMap.setReturnValueFrom(returnValue, V8T::toInternalPointer(object));
+ return mainWorldStore().m_wrapperMap.setReturnValueFrom(returnValue, V8T::toInternalPointer(object));
}
- return current(returnValue.GetIsolate())->template setReturnValueFrom<V8T>(returnValue, object);
+ return current(returnValue.GetIsolate()).template setReturnValueFrom<V8T>(returnValue, object);
}
template<typename V8T, typename T>
@@ -75,7 +75,7 @@ public:
if (LIKELY(!DOMWrapperWorld::isolatedWorldsExist()))
return ScriptWrappable::setReturnValueWithSecurityCheck<V8T>(returnValue, object);
}
- return current(returnValue.GetIsolate())->template setReturnValueFrom<V8T>(returnValue, object);
+ return current(returnValue.GetIsolate()).template setReturnValueFrom<V8T>(returnValue, object);
}
template<typename V8T, typename T>
@@ -83,7 +83,7 @@ public:
{
if (ScriptWrappable::wrapperCanBeStoredInObject(object))
return ScriptWrappable::setReturnValue(returnValue, object);
- return mainWorldStore()->m_wrapperMap.setReturnValueFrom(returnValue, V8T::toInternalPointer(object));
+ return mainWorldStore().m_wrapperMap.setReturnValueFrom(returnValue, V8T::toInternalPointer(object));
}
template<typename V8T, typename T>
@@ -97,7 +97,7 @@ public:
return result;
}
}
- return current(isolate)->template get<V8T>(object, isolate);
+ return current(isolate).template get<V8T>(object, isolate);
}
template<typename V8T, typename T>
@@ -111,7 +111,7 @@ public:
unsafePersistent.setReferenceFrom(parent, isolate);
}
}
- current(isolate)->template setReference<V8T>(parent, child, isolate);
+ current(isolate).template setReference<V8T>(parent, child, isolate);
}
template<typename V8T, typename T>
@@ -123,13 +123,13 @@ public:
return;
}
}
- return current(isolate)->template set<V8T>(object, wrapper, isolate, configuration);
+ return current(isolate).template set<V8T>(object, wrapper, isolate, configuration);
}
template<typename V8T, typename T>
static bool containsWrapper(T* object, v8::Isolate* isolate)
{
- return current(isolate)->template containsWrapper<V8T>(object);
+ return current(isolate).template containsWrapper<V8T>(object);
}
template<typename V8T, typename T>
@@ -179,7 +179,7 @@ private:
m_wrapperMap.set(V8T::toInternalPointer(object), wrapper, configuration);
}
- static DOMDataStore* mainWorldStore();
+ static DOMDataStore& mainWorldStore();
static bool canExistInWorker(void*) { return true; }
static bool canExistInWorker(Node*) { return false; }
@@ -193,7 +193,7 @@ 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_type == MainWorld);
return holder == *unsafePersistent.persistent();
}
« 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