| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "config.h" | 7 #include "config.h" |
| 8 #include "V8TestInterfaceNode.h" | 8 #include "V8TestInterfaceNode.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli
nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::refObject, V8TestInte
rfaceNode::derefObject, V8TestInterfaceNode::trace, 0, 0, V8TestInterfaceNode::i
nstallConditionallyEnabledMethods, V8TestInterfaceNode::installConditionallyEnab
ledProperties, &V8Node::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectProto
type, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::InheritFromEventTarget, Wra
pperTypeInfo::Dependent, WrapperTypeInfo::WillBeGarbageCollectedObject }; | 28 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli
nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::refObject, V8TestInte
rfaceNode::derefObject, V8TestInterfaceNode::trace, 0, 0, V8TestInterfaceNode::i
nstallConditionallyEnabledMethods, V8TestInterfaceNode::installConditionallyEnab
ledProperties, &V8Node::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectProto
type, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::InheritFromEventTarget, Wra
pperTypeInfo::Dependent, WrapperTypeInfo::WillBeGarbageCollectedObject }; |
| 29 | 29 |
| 30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNode.h. | 30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNode.h. |
| 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 32 // bindings/core/v8/ScriptWrappable.h. | 32 // bindings/core/v8/ScriptWrappable.h. |
| 33 const WrapperTypeInfo& TestInterfaceNode::s_wrapperTypeInfo = V8TestInterfaceNod
e::wrapperTypeInfo; | 33 const WrapperTypeInfo& TestInterfaceNode::s_wrapperTypeInfo = V8TestInterfaceNod
e::wrapperTypeInfo; |
| 34 | 34 |
| 35 namespace TestInterfaceNodeV8Internal { | 35 namespace TestInterfaceNodeV8Internal { |
| 36 | 36 |
| 37 static void nodeNameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) | 37 static void nodeNameAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 38 { | 38 { |
| 39 v8::Local<v8::Object> holder = info.Holder(); | 39 v8::Local<v8::Object> holder = info.Holder(); |
| 40 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 40 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 41 v8SetReturnValueString(info, impl->nodeName(), info.GetIsolate()); | 41 v8SetReturnValueString(info, impl->nodeName(), info.GetIsolate()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 static void nodeNameAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 44 static void nodeNameAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 45 { | 45 { |
| 46 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 46 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 47 TestInterfaceNodeV8Internal::nodeNameAttributeGetter(info); | 47 TestInterfaceNodeV8Internal::nodeNameAttributeGetter(info); |
| 48 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 48 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 49 } | 49 } |
| 50 | 50 |
| 51 static void nodeNameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Prop
ertyCallbackInfo<void>& info) | 51 static void nodeNameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Func
tionCallbackInfo<v8::Value>& info) |
| 52 { | 52 { |
| 53 v8::Local<v8::Object> holder = info.Holder(); | 53 v8::Local<v8::Object> holder = info.Holder(); |
| 54 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 54 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 55 V8StringResource<> cppValue = v8Value; | 55 V8StringResource<> cppValue = v8Value; |
| 56 if (!cppValue.prepare()) | 56 if (!cppValue.prepare()) |
| 57 return; | 57 return; |
| 58 impl->setNodeName(cppValue); | 58 impl->setNodeName(cppValue); |
| 59 } | 59 } |
| 60 | 60 |
| 61 static void nodeNameAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 61 static void nodeNameAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 62 { | 62 { |
| 63 v8::Local<v8::Value> v8Value = info[0]; |
| 63 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 64 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 64 TestInterfaceNodeV8Internal::nodeNameAttributeSetter(v8Value, info); | 65 TestInterfaceNodeV8Internal::nodeNameAttributeSetter(v8Value, info); |
| 65 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 66 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 66 } | 67 } |
| 67 | 68 |
| 68 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) | 69 static void stringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 69 { | 70 { |
| 70 v8::Local<v8::Object> holder = info.Holder(); | 71 v8::Local<v8::Object> holder = info.Holder(); |
| 71 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 72 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 72 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate()); | 73 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate()); |
| 73 } | 74 } |
| 74 | 75 |
| 75 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 76 static void stringAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 76 { | 77 { |
| 77 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 78 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 78 TestInterfaceNodeV8Internal::stringAttributeAttributeGetter(info); | 79 TestInterfaceNodeV8Internal::stringAttributeAttributeGetter(info); |
| 79 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 80 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 80 } | 81 } |
| 81 | 82 |
| 82 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::PropertyCallbackInfo<void>& info) | 83 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::FunctionCallbackInfo<v8::Value>& info) |
| 83 { | 84 { |
| 84 v8::Local<v8::Object> holder = info.Holder(); | 85 v8::Local<v8::Object> holder = info.Holder(); |
| 85 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 86 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 86 V8StringResource<> cppValue = v8Value; | 87 V8StringResource<> cppValue = v8Value; |
| 87 if (!cppValue.prepare()) | 88 if (!cppValue.prepare()) |
| 88 return; | 89 return; |
| 89 impl->setStringAttribute(cppValue); | 90 impl->setStringAttribute(cppValue); |
| 90 } | 91 } |
| 91 | 92 |
| 92 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo
cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 93 static void stringAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 93 { | 94 { |
| 95 v8::Local<v8::Value> v8Value = info[0]; |
| 94 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 96 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 95 TestInterfaceNodeV8Internal::stringAttributeAttributeSetter(v8Value, info); | 97 TestInterfaceNodeV8Internal::stringAttributeAttributeSetter(v8Value, info); |
| 96 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 98 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 97 } | 99 } |
| 98 | 100 |
| 99 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) | 101 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 100 { | 102 { |
| 101 v8::Local<v8::Object> holder = info.Holder(); | 103 v8::Local<v8::Object> holder = info.Holder(); |
| 102 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 104 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 103 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyTestInterfaceEmptyAttri
bute()), impl); | 105 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyTestInterfaceEmptyAttri
bute()), impl); |
| 104 } | 106 } |
| 105 | 107 |
| 106 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 108 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 107 { | 109 { |
| 108 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 110 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 109 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet
ter(info); | 111 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet
ter(info); |
| 110 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 112 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 111 } | 113 } |
| 112 | 114 |
| 113 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 115 static void eventHandlerAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 114 { | 116 { |
| 115 v8::Local<v8::Object> holder = info.Holder(); | 117 v8::Local<v8::Object> holder = info.Holder(); |
| 116 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 118 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 117 EventListener* cppValue(impl->eventHandlerAttribute()); | 119 EventListener* cppValue(impl->eventHandlerAttribute()); |
| 118 v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListen
er::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Local<v8:
:Value>(v8::Null(info.GetIsolate()))); | 120 v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListen
er::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Local<v8:
:Value>(v8::Null(info.GetIsolate()))); |
| 119 } | 121 } |
| 120 | 122 |
| 121 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 123 static void eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 122 { | 124 { |
| 123 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 125 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 124 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); | 126 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); |
| 125 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 127 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 126 } | 128 } |
| 127 | 129 |
| 128 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::PropertyCallbackInfo<void>& info) | 130 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) |
| 129 { | 131 { |
| 130 v8::Local<v8::Object> holder = info.Holder(); | 132 v8::Local<v8::Object> holder = info.Holder(); |
| 131 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 133 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 132 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(ScriptS
tate::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)); | 134 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(ScriptS
tate::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)); |
| 133 } | 135 } |
| 134 | 136 |
| 135 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 137 static void eventHandlerAttributeAttributeSetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 136 { | 138 { |
| 139 v8::Local<v8::Value> v8Value = info[0]; |
| 137 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 140 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 138 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeSetter(v8Value, i
nfo); | 141 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeSetter(v8Value, i
nfo); |
| 139 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 142 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 140 } | 143 } |
| 141 | 144 |
| 142 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 145 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c
onst v8::FunctionCallbackInfo<v8::Value>& info) |
| 143 { | 146 { |
| 144 v8::Local<v8::Object> holder = info.Holder(); | 147 v8::Local<v8::Object> holder = info.Holder(); |
| 145 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 148 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 146 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInt
erfaceEmptyAttribute()), impl); | 149 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInt
erfaceEmptyAttribute()), impl); |
| 147 } | 150 } |
| 148 | 151 |
| 149 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 152 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
llback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 150 { | 153 { |
| 151 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 154 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 152 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri
buteAttributeGetter(info); | 155 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri
buteAttributeGetter(info); |
| 153 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 156 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 154 } | 157 } |
| 155 | 158 |
| 156 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterFo
rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) | 159 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterFo
rMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 157 { | 160 { |
| 158 v8::Local<v8::Object> holder = info.Holder(); | 161 v8::Local<v8::Object> holder = info.Holder(); |
| 159 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 162 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 160 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsReadonl
yTestInterfaceEmptyAttribute())); | 163 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsReadonl
yTestInterfaceEmptyAttribute())); |
| 161 } | 164 } |
| 162 | 165 |
| 163 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 166 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
llbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 164 { | 167 { |
| 165 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 168 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 166 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri
buteAttributeGetterForMainWorld(info); | 169 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri
buteAttributeGetterForMainWorld(info); |
| 167 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 170 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 168 } | 171 } |
| 169 | 172 |
| 170 static void reflectStringAttributeAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 173 static void reflectStringAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 171 { | 174 { |
| 172 v8::Local<v8::Object> holder = info.Holder(); | 175 v8::Local<v8::Object> holder = info.Holder(); |
| 173 Element* impl = V8Element::toImpl(holder); | 176 Element* impl = V8Element::toImpl(holder); |
| 174 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstring
attributeAttr), info.GetIsolate()); | 177 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstring
attributeAttr), info.GetIsolate()); |
| 175 } | 178 } |
| 176 | 179 |
| 177 static void reflectStringAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 180 static void reflectStringAttributeAttributeGetterCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 178 { | 181 { |
| 179 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 182 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 180 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeGetter(info); | 183 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeGetter(info); |
| 181 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 184 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 182 } | 185 } |
| 183 | 186 |
| 184 static void reflectStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<void>& info) | 187 static void reflectStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) |
| 185 { | 188 { |
| 186 v8::Local<v8::Object> holder = info.Holder(); | 189 v8::Local<v8::Object> holder = info.Holder(); |
| 187 Element* impl = V8Element::toImpl(holder); | 190 Element* impl = V8Element::toImpl(holder); |
| 188 V8StringResource<> cppValue = v8Value; | 191 V8StringResource<> cppValue = v8Value; |
| 189 if (!cppValue.prepare()) | 192 if (!cppValue.prepare()) |
| 190 return; | 193 return; |
| 191 impl->setAttribute(HTMLNames::reflectstringattributeAttr, cppValue); | 194 impl->setAttribute(HTMLNames::reflectstringattributeAttr, cppValue); |
| 192 } | 195 } |
| 193 | 196 |
| 194 static void reflectStringAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 197 static void reflectStringAttributeAttributeSetterCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 195 { | 198 { |
| 199 v8::Local<v8::Value> v8Value = info[0]; |
| 196 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 200 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 197 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 201 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
| 198 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeSetter(v8Value,
info); | 202 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeSetter(v8Value,
info); |
| 199 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 203 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 200 } | 204 } |
| 201 | 205 |
| 202 static void reflectUrlStringAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 206 static void reflectUrlStringAttributeAttributeGetter(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 203 { | 207 { |
| 204 v8::Local<v8::Object> holder = info.Holder(); | 208 v8::Local<v8::Object> holder = info.Holder(); |
| 205 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 209 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 206 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstri
ngattributeAttr), info.GetIsolate()); | 210 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstri
ngattributeAttr), info.GetIsolate()); |
| 207 } | 211 } |
| 208 | 212 |
| 209 static void reflectUrlStringAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 213 static void reflectUrlStringAttributeAttributeGetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 210 { | 214 { |
| 211 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 215 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 212 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info); | 216 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info); |
| 213 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 217 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 214 } | 218 } |
| 215 | 219 |
| 216 static void reflectUrlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
e, const v8::PropertyCallbackInfo<void>& info) | 220 static void reflectUrlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
e, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 217 { | 221 { |
| 218 v8::Local<v8::Object> holder = info.Holder(); | 222 v8::Local<v8::Object> holder = info.Holder(); |
| 219 Element* impl = V8Element::toImpl(holder); | 223 Element* impl = V8Element::toImpl(holder); |
| 220 V8StringResource<> cppValue = v8Value; | 224 V8StringResource<> cppValue = v8Value; |
| 221 if (!cppValue.prepare()) | 225 if (!cppValue.prepare()) |
| 222 return; | 226 return; |
| 223 impl->setAttribute(HTMLNames::reflecturlstringattributeAttr, cppValue); | 227 impl->setAttribute(HTMLNames::reflecturlstringattributeAttr, cppValue); |
| 224 } | 228 } |
| 225 | 229 |
| 226 static void reflectUrlStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 230 static void reflectUrlStringAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 227 { | 231 { |
| 232 v8::Local<v8::Value> v8Value = info[0]; |
| 228 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 233 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 229 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 234 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
| 230 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(v8Valu
e, info); | 235 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(v8Valu
e, info); |
| 231 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 236 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 232 } | 237 } |
| 233 | 238 |
| 234 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 239 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 235 { | 240 { |
| 236 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | 241 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); |
| 237 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceEmptyMethod()), im
pl); | 242 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceEmptyMethod()), im
pl); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 312 |
| 308 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) | 313 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 309 { | 314 { |
| 310 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 315 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 311 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethodForMainWorld(info); | 316 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethodForMainWorld(info); |
| 312 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 317 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 313 } | 318 } |
| 314 | 319 |
| 315 } // namespace TestInterfaceNodeV8Internal | 320 } // namespace TestInterfaceNodeV8Internal |
| 316 | 321 |
| 317 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNodeAttri
butes[] = { | 322 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceNodeAccess
ors[] = { |
| 318 {"nodeName", TestInterfaceNodeV8Internal::nodeNameAttributeGetterCallback, T
estInterfaceNodeV8Internal::nodeNameAttributeSetterCallback, 0, 0, 0, static_cas
t<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None),
V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 323 {"nodeName", TestInterfaceNodeV8Internal::nodeNameAttributeGetterCallback, T
estInterfaceNodeV8Internal::nodeNameAttributeSetterCallback, 0, 0, 0, static_cas
t<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None),
V8DOMConfiguration::ExposedToAllScripts}, |
| 319 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet
terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguratio
n::OnInstance}, | 324 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet
terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts}, |
| 320 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl
yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO
MConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 325 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl
yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO
MConfiguration::ExposedToAllScripts}, |
| 321 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute
AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri
buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts,
V8DOMConfiguration::OnInstance}, | 326 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute
AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri
buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts}
, |
| 322 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8I
nternal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallb
ack, 0, TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyA
ttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | 327 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8I
nternal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallb
ack, 0, TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyA
ttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::ExposedToAllScripts}, |
| 323 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu
teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt
tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScrip
ts, V8DOMConfiguration::OnInstance}, | 328 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu
teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt
tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScrip
ts}, |
| 324 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA
ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt
tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA
ULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedT
oAllScripts, V8DOMConfiguration::OnInstance}, | 329 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA
ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt
tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA
ULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedT
oAllScripts}, |
| 325 }; | 330 }; |
| 326 | 331 |
| 327 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNodeMethods[
] = { | 332 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNodeMethods[
] = { |
| 328 {"testInterfaceEmptyMethod", TestInterfaceNodeV8Internal::testInterfaceEmpty
MethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, | 333 {"testInterfaceEmptyMethod", TestInterfaceNodeV8Internal::testInterfaceEmpty
MethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, |
| 329 {"perWorldBindingsTestInterfaceEmptyMethod", TestInterfaceNodeV8Internal::pe
rWorldBindingsTestInterfaceEmptyMethodMethodCallback, TestInterfaceNodeV8Interna
l::perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld, 0, V8DOMC
onfiguration::ExposedToAllScripts}, | 334 {"perWorldBindingsTestInterfaceEmptyMethod", TestInterfaceNodeV8Internal::pe
rWorldBindingsTestInterfaceEmptyMethodMethodCallback, TestInterfaceNodeV8Interna
l::perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld, 0, V8DOMC
onfiguration::ExposedToAllScripts}, |
| 330 {"perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg", TestInterface
NodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod
Callback, TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodO
ptionalBooleanArgMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAll
Scripts}, | 335 {"perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg", TestInterface
NodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod
Callback, TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodO
ptionalBooleanArgMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAll
Scripts}, |
| 331 }; | 336 }; |
| 332 | 337 |
| 333 static void installV8TestInterfaceNodeTemplate(v8::Local<v8::FunctionTemplate> f
unctionTemplate, v8::Isolate* isolate) | 338 static void installV8TestInterfaceNodeTemplate(v8::Local<v8::FunctionTemplate> f
unctionTemplate, v8::Isolate* isolate) |
| 334 { | 339 { |
| 335 functionTemplate->ReadOnlyPrototype(); | 340 functionTemplate->ReadOnlyPrototype(); |
| 336 | 341 |
| 337 v8::Local<v8::Signature> defaultSignature; | 342 v8::Local<v8::Signature> defaultSignature; |
| 338 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceNode", V8Node::domTemplate(isolate), V8TestInterface
Node::internalFieldCount, | 343 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceNode", V8Node::domTemplate(isolate), V8TestInterface
Node::internalFieldCount, |
| 339 V8TestInterfaceNodeAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAttri
butes), | |
| 340 0, 0, | 344 0, 0, |
| 345 V8TestInterfaceNodeAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAccess
ors), |
| 341 V8TestInterfaceNodeMethods, WTF_ARRAY_LENGTH(V8TestInterfaceNodeMethods)
); | 346 V8TestInterfaceNodeMethods, WTF_ARRAY_LENGTH(V8TestInterfaceNodeMethods)
); |
| 342 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 347 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
| 343 ALLOW_UNUSED_LOCAL(instanceTemplate); | 348 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 344 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 349 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
| 345 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 350 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 346 | 351 |
| 347 // Custom toString template | 352 // Custom toString template |
| 348 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 353 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
| 349 } | 354 } |
| 350 | 355 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 376 } | 381 } |
| 377 | 382 |
| 378 void V8TestInterfaceNode::derefObject(ScriptWrappable* scriptWrappable) | 383 void V8TestInterfaceNode::derefObject(ScriptWrappable* scriptWrappable) |
| 379 { | 384 { |
| 380 #if !ENABLE(OILPAN) | 385 #if !ENABLE(OILPAN) |
| 381 scriptWrappable->toImpl<TestInterfaceNode>()->deref(); | 386 scriptWrappable->toImpl<TestInterfaceNode>()->deref(); |
| 382 #endif | 387 #endif |
| 383 } | 388 } |
| 384 | 389 |
| 385 } // namespace blink | 390 } // namespace blink |
| OLD | NEW |