Index: Source/bindings/tests/results/core/V8TestInterface.cpp |
=================================================================== |
--- Source/bindings/tests/results/core/V8TestInterface.cpp (revision 197430) |
+++ Source/bindings/tests/results/core/V8TestInterface.cpp (working copy) |
@@ -363,6 +363,38 @@ |
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
} |
+static void staticReturnDOMWrapperAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8SetReturnValue(info, TestInterfaceImplementation::staticReturnDOMWrapperAttribute(), info.GetIsolate()->GetCurrentContext()->Global()); |
+} |
+ |
+static void staticReturnDOMWrapperAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void staticReturnDOMWrapperAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "staticReturnDOMWrapperAttribute", "TestInterface", holder, info.GetIsolate()); |
+ TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); |
+ if (!cppValue) { |
+ exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ TestInterfaceImplementation::setStaticReturnDOMWrapperAttribute(WTF::getPtr(cppValue)); |
+} |
+ |
+static void staticReturnDOMWrapperAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
static void legacyInterfaceTypeCheckingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
{ |
v8::Local<v8::Object> holder = info.Holder(); |
@@ -1312,6 +1344,18 @@ |
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
} |
+static void staticReturnDOMWrapperMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8SetReturnValue(info, TestInterfaceImplementation::staticReturnDOMWrapperMethod(), info.GetIsolate()->GetCurrentContext()->Global()); |
+} |
+ |
+static void staticReturnDOMWrapperMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterfaceImplementationV8Internal::staticReturnDOMWrapperMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
static void methodWithExposedAndRuntimeEnabledFlagMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
@@ -2279,6 +2323,10 @@ |
}; |
V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::Signature>(), v8::None, windowExposedStaticMethodMethodConfiguration); |
} |
+ const V8DOMConfiguration::MethodConfiguration staticReturnDOMWrapperMethodMethodConfiguration = { |
+ "staticReturnDOMWrapperMethod", TestInterfaceImplementationV8Internal::staticReturnDOMWrapperMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, |
+ }; |
+ V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::Signature>(), v8::None, staticReturnDOMWrapperMethodMethodConfiguration); |
const V8DOMConfiguration::MethodConfiguration implementsStaticVoidMethodMethodConfiguration = { |
"implementsStaticVoidMethod", TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, |
}; |
@@ -2362,6 +2410,7 @@ |
}; |
V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignature, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum), toStringMethodConfiguration); |
functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttribute"), TestInterfaceImplementationV8Internal::staticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
+ functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticReturnDOMWrapperAttribute"), TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsStaticReadOnlyLongAttribute"), TestInterfaceImplementationV8Internal::implementsStaticReadOnlyLongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsStaticStringAttribute"), TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements2StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |