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

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

Issue 27003002: IDL compiler: [Reflect] for getters (+ remove unnecessary WebCore::) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/V8TestObjectPython.cpp
diff --git a/Source/bindings/tests/results/V8TestObjectPython.cpp b/Source/bindings/tests/results/V8TestObjectPython.cpp
index c22cf16f719ccaf611b5c97b8f12ad4dc9fbe6e6..7374da432113c395946e938dd2143fa3ee206dda 100644
--- a/Source/bindings/tests/results/V8TestObjectPython.cpp
+++ b/Source/bindings/tests/results/V8TestObjectPython.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "V8TestObjectPython.h"
+#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "V8Document.h"
#include "V8DocumentFragment.h"
@@ -32,6 +33,7 @@
#include "V8Node.h"
#include "V8NodeFilter.h"
#include "V8ShadowRoot.h"
+#include "V8TestInterface.h"
#include "V8TestInterfaceEmpty.h"
#include "V8Window.h"
#include "bindings/v8/BindingSecurity.h"
@@ -888,6 +890,176 @@ static void readonlyDocumentFragmentAttributeAttributeGetterCallback(v8::Local<v
TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
}
+static void reflectReadonlyTestInterfaceAttributeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ RefPtr<TestInterface> result = imp->fastGetAttribute(WebCore::HTMLNames::reflectreadonlytestinterfaceattributeAttr);
+ if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterface>(info.GetReturnValue(), result.get()))
+ return;
+ v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
+ if (!wrapper.IsEmpty()) {
+ V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "reflectReadonlyTestInterfaceAttribute", wrapper);
+ v8SetReturnValue(info, wrapper);
+ }
+}
+
+static void reflectReadonlyTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectReadonlyTestInterfaceAttributeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectReflectedNameAttributeReadonlyTestAttributeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ RefPtr<TestInterface> result = imp->fastGetAttribute(WebCore::HTMLNames::reflectedNameAttributeAttr);
+ if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterface>(info.GetReturnValue(), result.get()))
+ return;
+ v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
+ if (!wrapper.IsEmpty()) {
+ V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "reflectReflectedNameAttributeReadonlyTestAttribute", wrapper);
+ v8SetReturnValue(info, wrapper);
+ }
+}
+
+static void reflectReflectedNameAttributeReadonlyTestAttributeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectReflectedNameAttributeReadonlyTestAttributeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectReadonlyBooleanAttributeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueBool(info, imp->fastHasAttribute(WebCore::HTMLNames::reflectreadonlybooleanattributeAttr));
+}
+
+static void reflectReadonlyBooleanAttributeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectReadonlyBooleanAttributeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectReadonlyLongAttributeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueInt(info, imp->getIntegralAttribute(WebCore::HTMLNames::reflectreadonlylongattributeAttr));
+}
+
+static void reflectReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectReadonlyLongAttributeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectReadonlyUnsignedShortAttributeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueUnsigned(info, std::max(0, imp->fastGetAttribute(WebCore::HTMLNames::reflectreadonlyunsignedshortattributeAttr)));
+}
+
+static void reflectReadonlyUnsignedShortAttributeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectReadonlyUnsignedShortAttributeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectReadonlyUnsignedLongAttributeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueUnsigned(info, std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::reflectreadonlyunsignedlongattributeAttr)));
+}
+
+static void reflectReadonlyUnsignedLongAttributeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectReadonlyUnsignedLongAttributeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void idAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueString(info, imp->getIdAttribute(), info.GetIsolate());
+}
+
+static void idAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::idAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void nameAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueString(info, imp->getNameAttribute(), info.GetIsolate());
+}
+
+static void nameAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::nameAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void classAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueString(info, imp->getClassAttribute(), info.GetIsolate());
+}
+
+static void classAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::classAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectedIdAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueString(info, imp->getIdAttribute(), info.GetIsolate());
+}
+
+static void reflectedIdAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectedIdAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectedNameAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueString(info, imp->getNameAttribute(), info.GetIsolate());
+}
+
+static void reflectedNameAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectedNameAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void reflectedClassAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
+ v8SetReturnValueString(info, imp->getClassAttribute(), info.GetIsolate());
+}
+
+static void reflectedClassAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestObjectPythonV8Internal::reflectedClassAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
} // namespace TestObjectPythonV8Internal
static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttributes[] = {
@@ -956,6 +1128,18 @@ static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib
{"customElementsCallbacksReadonlyLongAttribute", TestObjectPythonV8Internal::customElementsCallbacksReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
{"deprecatedReadonlyLongAttribute", TestObjectPythonV8Internal::deprecatedReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
{"readonlyDocumentFragmentAttribute", TestObjectPythonV8Internal::readonlyDocumentFragmentAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectReadonlyTestInterfaceAttribute", TestObjectPythonV8Internal::reflectReadonlyTestInterfaceAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectReflectedNameAttributeReadonlyTestAttribute", TestObjectPythonV8Internal::reflectReflectedNameAttributeReadonlyTestAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectReadonlyBooleanAttribute", TestObjectPythonV8Internal::reflectReadonlyBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectReadonlyLongAttribute", TestObjectPythonV8Internal::reflectReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectReadonlyUnsignedShortAttribute", TestObjectPythonV8Internal::reflectReadonlyUnsignedShortAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectReadonlyUnsignedLongAttribute", TestObjectPythonV8Internal::reflectReadonlyUnsignedLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"id", TestObjectPythonV8Internal::idAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"name", TestObjectPythonV8Internal::nameAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"class", TestObjectPythonV8Internal::classAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectedId", TestObjectPythonV8Internal::reflectedIdAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectedName", TestObjectPythonV8Internal::reflectedNameAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"reflectedClass", TestObjectPythonV8Internal::reflectedClassAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
};
static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectPythonTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)

Powered by Google App Engine
This is Rietveld 408576698