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

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

Issue 721383003: bindings: Retires ScriptWrappableBase mostly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: Source/bindings/core/v8/DOMDataStore.h
diff --git a/Source/bindings/core/v8/DOMDataStore.h b/Source/bindings/core/v8/DOMDataStore.h
index 7ab5ae8a5c8c20c0a3eedb692b982d9cb9176894..2142472cac8045f18941579a516ff35fdd7cc72e 100644
--- a/Source/bindings/core/v8/DOMDataStore.h
+++ b/Source/bindings/core/v8/DOMDataStore.h
@@ -61,30 +61,6 @@ public:
return DOMWrapperWorld::current(isolate).domDataStore();
}
- static bool setReturnValueFast(v8::ReturnValue<v8::Value> returnValue, ScriptWrappable* object, v8::Local<v8::Object> holder, const ScriptWrappable* wrappable)
- {
- // The second fastest way to check if we're in the main world is to check if
- // the wrappable's wrapper is the same as the holder.
- if (holderContainsWrapper(holder, wrappable))
- return object->setReturnValue(returnValue);
- return current(returnValue.GetIsolate()).setReturnValueFrom(returnValue, object);
- }
-
- static bool setReturnValueFast(v8::ReturnValue<v8::Value> returnValue, Node* node, v8::Local<v8::Object> holder, const ScriptWrappable* wrappable)
- {
- if (canUseScriptWrappable(node)
- // The second fastest way to check if we're in the main world is to
- // check if the wrappable's wrapper is the same as the holder.
- || holderContainsWrapper(holder, wrappable))
- return ScriptWrappable::fromNode(node)->setReturnValue(returnValue);
- return current(returnValue.GetIsolate()).setReturnValueFrom(returnValue, ScriptWrappable::fromNode(node));
- }
-
- static bool setReturnValue(v8::ReturnValue<v8::Value> returnValue, ScriptWrappableBase* object)
- {
- return current(returnValue.GetIsolate()).setReturnValueFrom(returnValue, object);
- }
-
static bool setReturnValue(v8::ReturnValue<v8::Value> returnValue, ScriptWrappable* object)
{
return current(returnValue.GetIsolate()).setReturnValueFrom(returnValue, object);
@@ -102,9 +78,23 @@ public:
return object->setReturnValue(returnValue);
}
- static v8::Handle<v8::Object> getWrapper(ScriptWrappableBase* object, v8::Isolate* isolate)
+ static bool setReturnValueFast(v8::ReturnValue<v8::Value> returnValue, ScriptWrappable* object, v8::Local<v8::Object> holder, const ScriptWrappable* wrappable)
{
- return current(isolate).get(object, isolate);
+ // The second fastest way to check if we're in the main world is to check if
+ // the wrappable's wrapper is the same as the holder.
+ if (holderContainsWrapper(holder, wrappable))
+ return object->setReturnValue(returnValue);
+ return current(returnValue.GetIsolate()).setReturnValueFrom(returnValue, object);
+ }
+
+ static bool setReturnValueFast(v8::ReturnValue<v8::Value> returnValue, Node* node, v8::Local<v8::Object> holder, const ScriptWrappable* wrappable)
+ {
+ if (canUseScriptWrappable(node)
+ // The second fastest way to check if we're in the main world is to
+ // check if the wrappable's wrapper is the same as the holder.
+ || holderContainsWrapper(holder, wrappable))
+ return ScriptWrappable::fromNode(node)->setReturnValue(returnValue);
+ return current(returnValue.GetIsolate()).setReturnValueFrom(returnValue, ScriptWrappable::fromNode(node));
}
static v8::Handle<v8::Object> getWrapper(ScriptWrappable* object, v8::Isolate* isolate)
@@ -123,11 +113,6 @@ public:
return current(isolate).get(ScriptWrappable::fromNode(node), isolate);
}
- static void setWrapperReference(const v8::Persistent<v8::Object>& parent, ScriptWrappableBase* child, v8::Isolate* isolate)
- {
- current(isolate).setReference(parent, child, isolate);
- }
-
static void setWrapperReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable* child, v8::Isolate* isolate)
{
current(isolate).setReference(parent, child, isolate);
@@ -142,11 +127,6 @@ public:
current(isolate).setReference(parent, ScriptWrappable::fromNode(child), isolate);
}
- static void setWrapper(ScriptWrappableBase* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo)
- {
- return current(isolate).set(object, wrapper, isolate, wrapperTypeInfo);
- }
-
static void setWrapper(ScriptWrappable* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo)
{
return current(isolate).set(object, wrapper, isolate, wrapperTypeInfo);
@@ -161,21 +141,11 @@ public:
return current(isolate).set(ScriptWrappable::fromNode(node), wrapper, isolate, wrapperTypeInfo);
}
- static bool containsWrapper(ScriptWrappableBase* object, v8::Isolate* isolate)
- {
- return current(isolate).containsWrapper(object);
- }
-
static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate)
{
return current(isolate).containsWrapper(object);
}
- v8::Handle<v8::Object> get(ScriptWrappableBase* object, v8::Isolate* isolate)
- {
- return m_wrapperMap.newLocal(object->toScriptWrappableBase(), isolate);
- }
-
v8::Handle<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate)
{
if (m_isMainWorld)
@@ -183,11 +153,6 @@ public:
return m_wrapperMap.newLocal(object->toScriptWrappableBase(), isolate);
}
- void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappableBase* child, v8::Isolate* isolate)
- {
- m_wrapperMap.setReference(parent, child, isolate);
- }
-
void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable* child, v8::Isolate* isolate)
{
if (m_isMainWorld) {
@@ -197,11 +162,6 @@ public:
m_wrapperMap.setReference(parent, child->toScriptWrappableBase(), isolate);
}
- bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, ScriptWrappableBase* object)
- {
- return m_wrapperMap.setReturnValueFrom(returnValue, object);
- }
-
bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, ScriptWrappable* object)
{
if (m_isMainWorld)
@@ -209,11 +169,6 @@ public:
return m_wrapperMap.setReturnValueFrom(returnValue, object->toScriptWrappableBase());
}
- bool containsWrapper(ScriptWrappableBase* object)
- {
- return m_wrapperMap.containsKey(object->toScriptWrappableBase());
- }
-
bool containsWrapper(ScriptWrappable* object)
{
if (m_isMainWorld)
@@ -222,13 +177,6 @@ public:
}
private:
- void set(ScriptWrappableBase* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo)
- {
- ASSERT(object);
- ASSERT(!wrapper.IsEmpty());
- m_wrapperMap.set(object->toScriptWrappableBase(), wrapper, wrapperTypeInfo);
- }
-
void set(ScriptWrappable* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo)
{
ASSERT(object);

Powered by Google App Engine
This is Rietveld 408576698