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

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

Issue 345393004: IDL: Support 'stringifier' keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move handling of unnamed operations Created 6 years, 6 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 | « Source/bindings/tests/results/V8TestInterface2.cpp ('k') | Source/core/css/WebKitCSSMatrix.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp
index 4b312e40b928d0b9eed5158f1026900df98c2222..cba7dbdb9ef32660d45f5eff7bb6aaa2c2e455ff 100644
--- a/Source/bindings/tests/results/V8TestObject.cpp
+++ b/Source/bindings/tests/results/V8TestObject.cpp
@@ -88,6 +88,35 @@ namespace TestObjectV8Internal {
template <typename T> void V8_USE(T) { }
+static void stringifierAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestObject* impl = V8TestObject::toNative(holder);
+ v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate());
+}
+
+static void stringifierAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectV8Internal::stringifierAttributeAttributeGetter(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
+}
+
+static void stringifierAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
+{
+ v8::Handle<v8::Object> holder = info.Holder();
+ TestObject* impl = V8TestObject::toNative(holder);
+ TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
+ impl->setStringifierAttribute(cppValue);
+}
+
+static void stringifierAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestObjectV8Internal::stringifierAttributeAttributeSetter(v8Value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
+}
+
static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
@@ -9575,9 +9604,23 @@ static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback(
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
+static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestObject* impl = V8TestObject::toNative(info.Holder());
+ v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate());
+}
+
+static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ TestObjectV8Internal::toStringMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
+}
+
} // namespace TestObjectV8Internal
static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = {
+ {"stringifierAttribute", TestObjectV8Internal::stringifierAttributeAttributeGetterCallback, TestObjectV8Internal::stringifierAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
{"readonlyStringAttribute", TestObjectV8Internal::readonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
{"readonlyTestInterfaceEmptyAttribute", TestObjectV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
{"readonlyLongAttribute", TestObjectV8Internal::readonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
@@ -9932,6 +9975,7 @@ static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
{"voidMethodTestInterfaceGarbageCollectedArrayArg", TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedArrayArgMethodCallback, 0, 1},
{"voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback, 0, 1},
{"voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback, 0, 1},
+ {"toString", TestObjectV8Internal::toStringMethodCallback, 0, 0},
};
static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface2.cpp ('k') | Source/core/css/WebKitCSSMatrix.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698