| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
|
| index 61e6a68408311acc6a0e26d3170c7070eaf31037..b26c7cb5a84da394fbbae04059e0844c5d10941d 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
|
| @@ -49,154 +49,137 @@ static_assert(
|
|
|
| namespace TestNodeV8Internal {
|
|
|
| -static void hrefAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void hrefAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - v8SetReturnValueString(info, impl->href(), info.GetIsolate());
|
| + v8SetReturnValueString(info, impl->href(), info.GetIsolate());
|
| }
|
|
|
| -void hrefAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestNodeV8Internal::hrefAttributeGetter(info);
|
| +void hrefAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestNodeV8Internal::hrefAttributeGetter(info);
|
| }
|
|
|
| -static void hrefAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| +static void hrefAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - // Prepare the value to be set.
|
| - V8StringResource<> cppValue = v8Value;
|
| - if (!cppValue.prepare())
|
| - return;
|
| + // Prepare the value to be set.
|
| + V8StringResource<> cppValue = v8Value;
|
| + if (!cppValue.prepare())
|
| + return;
|
|
|
| - impl->setHref(cppValue);
|
| + impl->setHref(cppValue);
|
| }
|
|
|
| -void hrefAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void hrefAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestNodeV8Internal::hrefAttributeSetter(v8Value, info);
|
| + TestNodeV8Internal::hrefAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void hrefThrowsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void hrefThrowsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - v8SetReturnValueString(info, impl->hrefThrows(), info.GetIsolate());
|
| + v8SetReturnValueString(info, impl->hrefThrows(), info.GetIsolate());
|
| }
|
|
|
| -void hrefThrowsAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestNodeV8Internal::hrefThrowsAttributeGetter(info);
|
| +void hrefThrowsAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestNodeV8Internal::hrefThrowsAttributeGetter(info);
|
| }
|
|
|
| -static void hrefThrowsAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| +static void hrefThrowsAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestNode", "hrefThrows");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestNode", "hrefThrows");
|
|
|
| - // Prepare the value to be set.
|
| - V8StringResource<> cppValue = v8Value;
|
| - if (!cppValue.prepare())
|
| - return;
|
| + // Prepare the value to be set.
|
| + V8StringResource<> cppValue = v8Value;
|
| + if (!cppValue.prepare())
|
| + return;
|
|
|
| - impl->setHrefThrows(cppValue, exceptionState);
|
| + impl->setHrefThrows(cppValue, exceptionState);
|
| }
|
|
|
| -void hrefThrowsAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void hrefThrowsAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestNodeV8Internal::hrefThrowsAttributeSetter(v8Value, info);
|
| + TestNodeV8Internal::hrefThrowsAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void hrefCallWithAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void hrefCallWithAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - v8SetReturnValueString(info, impl->hrefCallWith(), info.GetIsolate());
|
| + v8SetReturnValueString(info, impl->hrefCallWith(), info.GetIsolate());
|
| }
|
|
|
| -void hrefCallWithAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestNodeV8Internal::hrefCallWithAttributeGetter(info);
|
| +void hrefCallWithAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestNodeV8Internal::hrefCallWithAttributeGetter(info);
|
| }
|
|
|
| -static void hrefCallWithAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| +static void hrefCallWithAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - // Prepare the value to be set.
|
| - V8StringResource<> cppValue = v8Value;
|
| - if (!cppValue.prepare())
|
| - return;
|
| + // Prepare the value to be set.
|
| + V8StringResource<> cppValue = v8Value;
|
| + if (!cppValue.prepare())
|
| + return;
|
|
|
| - ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
|
| + ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
|
|
|
| - impl->setHrefCallWith(executionContext, currentDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue);
|
| + impl->setHrefCallWith(executionContext, currentDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue);
|
| }
|
|
|
| -void hrefCallWithAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void hrefCallWithAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestNodeV8Internal::hrefCallWithAttributeSetter(v8Value, info);
|
| + TestNodeV8Internal::hrefCallWithAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void hrefByteStringAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| +static void hrefByteStringAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
|
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - v8SetReturnValueString(info, impl->hrefByteString(), info.GetIsolate());
|
| + v8SetReturnValueString(info, impl->hrefByteString(), info.GetIsolate());
|
| }
|
|
|
| -void hrefByteStringAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestNodeV8Internal::hrefByteStringAttributeGetter(info);
|
| +void hrefByteStringAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestNodeV8Internal::hrefByteStringAttributeGetter(info);
|
| }
|
|
|
| -static void hrefByteStringAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| - TestNode* impl = V8TestNode::toImpl(holder);
|
| +static void hrefByteStringAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| + TestNode* impl = V8TestNode::toImpl(holder);
|
|
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestNode", "hrefByteString");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestNode", "hrefByteString");
|
|
|
| - // Prepare the value to be set.
|
| - V8StringResource<> cppValue = toByteString(info.GetIsolate(), v8Value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| + // Prepare the value to be set.
|
| + V8StringResource<> cppValue = toByteString(info.GetIsolate(), v8Value, exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
|
|
| - impl->setHrefByteString(cppValue);
|
| + impl->setHrefByteString(cppValue);
|
| }
|
|
|
| -void hrefByteStringAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - v8::Local<v8::Value> v8Value = info[0];
|
| +void hrefByteStringAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + v8::Local<v8::Value> v8Value = info[0];
|
|
|
| - TestNodeV8Internal::hrefByteStringAttributeSetter(v8Value, info);
|
| + TestNodeV8Internal::hrefByteStringAttributeSetter(v8Value, info);
|
| }
|
|
|
| -static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - TestNode* impl = TestNode::create();
|
| - v8::Local<v8::Object> wrapper = info.Holder();
|
| - wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestNode::wrapperTypeInfo, wrapper);
|
| - v8SetReturnValue(info, wrapper);
|
| +static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + TestNode* impl = TestNode::create();
|
| + v8::Local<v8::Object> wrapper = info.Holder();
|
| + wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestNode::wrapperTypeInfo, wrapper);
|
| + v8SetReturnValue(info, wrapper);
|
| }
|
|
|
| } // namespace TestNodeV8Internal
|
| @@ -208,55 +191,49 @@ const V8DOMConfiguration::AccessorConfiguration V8TestNodeAccessors[] = {
|
| {"hrefByteString", TestNodeV8Internal::hrefByteStringAttributeGetterCallback, TestNodeV8Internal::hrefByteStringAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
|
| };
|
|
|
| -void V8TestNode::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| -{
|
| - if (!info.IsConstructCall()) {
|
| - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestNode"));
|
| - return;
|
| - }
|
| +void V8TestNode::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + if (!info.IsConstructCall()) {
|
| + V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestNode"));
|
| + return;
|
| + }
|
|
|
| - if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
|
| - v8SetReturnValue(info, info.Holder());
|
| - return;
|
| - }
|
| + if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
|
| + v8SetReturnValue(info, info.Holder());
|
| + return;
|
| + }
|
|
|
| - TestNodeV8Internal::constructor(info);
|
| + TestNodeV8Internal::constructor(info);
|
| }
|
|
|
| -static void installV8TestNodeTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate)
|
| -{
|
| - // Initialize the interface object's template.
|
| - V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestNode::wrapperTypeInfo.interfaceName, V8Node::domTemplate(isolate, world), V8TestNode::internalFieldCount);
|
| - interfaceTemplate->SetCallHandler(V8TestNode::constructorCallback);
|
| - interfaceTemplate->SetLength(0);
|
| - v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
|
| - ALLOW_UNUSED_LOCAL(signature);
|
| - v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
|
| - ALLOW_UNUSED_LOCAL(instanceTemplate);
|
| - v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
|
| - ALLOW_UNUSED_LOCAL(prototypeTemplate);
|
| - // Register DOM constants, attributes and operations.
|
| - V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestNodeAccessors, WTF_ARRAY_LENGTH(V8TestNodeAccessors));
|
| +static void installV8TestNodeTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
|
| + // Initialize the interface object's template.
|
| + V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestNode::wrapperTypeInfo.interfaceName, V8Node::domTemplate(isolate, world), V8TestNode::internalFieldCount);
|
| + interfaceTemplate->SetCallHandler(V8TestNode::constructorCallback);
|
| + interfaceTemplate->SetLength(0);
|
| + v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
|
| + ALLOW_UNUSED_LOCAL(signature);
|
| + v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
|
| + ALLOW_UNUSED_LOCAL(instanceTemplate);
|
| + v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
|
| + ALLOW_UNUSED_LOCAL(prototypeTemplate);
|
| + // Register DOM constants, attributes and operations.
|
| + V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestNodeAccessors, WTF_ARRAY_LENGTH(V8TestNodeAccessors));
|
| }
|
|
|
| -v8::Local<v8::FunctionTemplate> V8TestNode::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world)
|
| -{
|
| - return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestNodeTemplate);
|
| +v8::Local<v8::FunctionTemplate> V8TestNode::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
|
| + return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestNodeTemplate);
|
| }
|
|
|
| -bool V8TestNode::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
|
| -{
|
| - return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
|
| +bool V8TestNode::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
|
| + return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
|
| }
|
|
|
| -v8::Local<v8::Object> V8TestNode::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
|
| -{
|
| - return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
|
| +v8::Local<v8::Object> V8TestNode::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
|
| + return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
|
| }
|
|
|
| -TestNode* V8TestNode::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
| -{
|
| - return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
|
| +TestNode* V8TestNode::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) {
|
| + return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
|
| }
|
|
|
| -} // namespace blink
|
| +} // namespace blink
|
|
|