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

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

Issue 110023002: IDL compiler: [InitializedByEventConstructor] attribute any (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years 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/V8TestInterfaceEventConstructor.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp b/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp
index 5e9a5b963d63289deb9debd78e37d2c6d95020d8..20902c965c872fb5b4c8f93037d026a0f5bca2d0 100644
--- a/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp
@@ -37,6 +37,8 @@
#include "V8Event.h"
#include "bindings/v8/Dictionary.h"
#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ScriptValue.h"
+#include "bindings/v8/SerializedScriptValue.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8DOMConfiguration.h"
#include "bindings/v8/V8DOMWrapper.h"
@@ -74,29 +76,42 @@ namespace TestInterfaceEventConstructorV8Internal {
template <typename T> void V8_USE(T) { }
-static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
- v8SetReturnValueString(info, imp->attr1(), info.GetIsolate());
+ v8SetReturnValueString(info, imp->readonlyStringAttribute(), info.GetIsolate());
}
-static void attr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- TestInterfaceEventConstructorV8Internal::attr1AttributeGetter(info);
+ TestInterfaceEventConstructorV8Internal::readonlyStringAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
}
-static void attr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+static void InitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
- v8SetReturnValueString(info, imp->attr2(), info.GetIsolate());
+ v8SetReturnValueString(info, imp->initializedByEventConstructorReadonlyStringAttribute(), info.GetIsolate());
}
-static void attr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+static void InitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
- TestInterfaceEventConstructorV8Internal::attr2AttributeGetter(info);
+ TestInterfaceEventConstructorV8Internal::InitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void InitializedByEventConstructorReadonlyAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+ v8SetReturnValue(info, imp->initializedByEventConstructorReadonlyAnyAttribute().v8Value());
+}
+
+static void InitializedByEventConstructorReadonlyAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestInterfaceEventConstructorV8Internal::InitializedByEventConstructorReadonlyAnyAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
}
@@ -108,6 +123,7 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
}
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
+ v8::Local<v8::Value> InitializedByEventConstructorReadonlyAnyAttribute;
TestInterfaceEventConstructorInit eventInit;
if (info.Length() >= 2) {
V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()));
@@ -116,8 +132,16 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
exceptionState.throwIfNeeded();
return;
}
+ options.get("InitializedByEventConstructorReadonlyAnyAttribute", InitializedByEventConstructorReadonlyAnyAttribute);
+ if (!InitializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
+ info.Holder()->SetHiddenValue(V8HiddenPropertyName::InitializedByEventConstructorReadonlyAnyAttribute(info.GetIsolate()), InitializedByEventConstructorReadonlyAnyAttribute);
}
RefPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor::create(type, eventInit);
+ if (isolatedWorldForIsolate(info.GetIsolate())) {
+ if (!InitializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
+ event->setSerializedInitializedByEventConstructorReadonlyAnyAttribute(SerializedScriptValue::createAndSwallowExceptions(InitializedByEventConstructorReadonlyAnyAttribute, info.GetIsolate()));
+ }
+
v8::Handle<v8::Object> wrapper = info.Holder();
V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(event.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
v8SetReturnValue(info, wrapper);
@@ -126,8 +150,9 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
} // namespace TestInterfaceEventConstructorV8Internal
static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventConstructorAttributes[] = {
- {"attr1", TestInterfaceEventConstructorV8Internal::attr1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- {"attr2", TestInterfaceEventConstructorV8Internal::attr2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"InitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::InitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ {"InitializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventConstructorV8Internal::InitializedByEventConstructorReadonlyAnyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
};
bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit& eventInit, const Dictionary& options, ExceptionState& exceptionState, const String& forEventName)
@@ -136,7 +161,7 @@ bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&
if (!initializeEvent(eventInit, options, exceptionState, forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName))
return false;
- if (!options.convert(conversionContext, "attr2", eventInit.attr2))
+ if (!options.convert(conversionContext, "InitializedByEventConstructorReadonlyStringAttribute", eventInit.InitializedByEventConstructorReadonlyStringAttribute))
return false;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698