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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceNode.cpp

Issue 214143003: Bindings: use |holder| local variable in attribute getters and setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 9 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: Source/bindings/tests/results/V8TestInterfaceNode.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceNode.cpp b/Source/bindings/tests/results/V8TestInterfaceNode.cpp
index 79d551e89b42edf309922ace313c8a2469b0a9b3..af4a425fd523d495e4e5ddc481380d3204d7e522 100644
--- a/Source/bindings/tests/results/V8TestInterfaceNode.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceNode.cpp
@@ -49,7 +49,8 @@ template <typename T> void V8_USE(T) { }
static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate());
}
@@ -62,7 +63,8 @@ static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const
static void stringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
impl->setStringAttribute(cppValue);
}
@@ -76,7 +78,8 @@ static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo
static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyTestInterfaceEmptyAttribute()), impl);
}
@@ -89,7 +92,8 @@ static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local
static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
EventListener* jsValue = impl->eventHandlerAttribute();
v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(jsValue)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
}
@@ -103,7 +107,8 @@ static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>,
static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate));
}
@@ -116,7 +121,8 @@ static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>,
static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()), impl);
}
@@ -129,7 +135,8 @@ static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()));
}
@@ -142,7 +149,8 @@ static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
static void reflectStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- Element* impl = V8Element::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ Element* impl = V8Element::toNative(holder);
v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstringattributeAttr), info.GetIsolate());
}
@@ -155,7 +163,8 @@ static void reflectStringAttributeAttributeGetterCallback(v8::Local<v8::String>,
static void reflectStringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
- Element* impl = V8Element::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ Element* impl = V8Element::toNative(holder);
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
impl->setAttribute(HTMLNames::reflectstringattributeAttr, cppValue);
}
@@ -170,7 +179,8 @@ static void reflectStringAttributeAttributeSetterCallback(v8::Local<v8::String>,
static void reflectUrlStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstringattributeAttr), info.GetIsolate());
}
@@ -183,7 +193,8 @@ static void reflectUrlStringAttributeAttributeGetterCallback(v8::Local<v8::Strin
static void reflectUrlStringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
- Element* impl = V8Element::toNative(info.Holder());
+ v8::Handle<v8::Object> holder = info.Holder();
+ Element* impl = V8Element::toNative(holder);
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
impl->setAttribute(HTMLNames::reflecturlstringattributeAttr, cppValue);
}

Powered by Google App Engine
This is Rietveld 408576698