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

Unified Diff: Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp

Issue 953473002: bindings: Supports [Replaceable] accessors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 5 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
Index: Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp b/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
index 475e61cd54c55b06fa3f1bf2dbc1d3e35fd1cd9d..b8206ba6e3172d0590b3362d5b25b3c33e9cafdf 100644
--- a/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
@@ -30,17 +30,8 @@ const WrapperTypeInfo& TestInterfaceNamedConstructor::s_wrapperTypeInfo = V8Test
namespace TestInterfaceNamedConstructorV8Internal {
-static void TestInterfaceNamedConstructorConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
- v8::Local<v8::Value> data = info.Data();
- ASSERT(data->IsExternal());
- V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
- if (!perContextData)
- return;
- v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
-}
-
-static void TestInterfaceNamedConstructorForceSetAttributeOnThis(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
+template<class CallbackInfo>
+static void TestInterfaceNamedConstructorForceSetAttributeOnThis(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
if (info.This()->IsObject())
v8::Local<v8::Object>::Cast(info.This())->ForceSet(name, v8Value);
@@ -51,6 +42,16 @@ static void TestInterfaceNamedConstructorForceSetAttributeOnThisCallback(v8::Loc
TestInterfaceNamedConstructorV8Internal::TestInterfaceNamedConstructorForceSetAttributeOnThis(name, v8Value, info);
}
+static void TestInterfaceNamedConstructorConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ v8::Local<v8::Value> data = info.Data();
+ ASSERT(data->IsExternal());
+ V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
+ if (!perContextData)
+ return;
+ v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
+}
+
} // namespace TestInterfaceNamedConstructorV8Internal
static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNamedConstructorAttributes[] = {

Powered by Google App Engine
This is Rietveld 408576698