| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
| 32 | 32 |
| 33 #include "config.h" | 33 #include "config.h" |
| 34 #if ENABLE(Condition1) || ENABLE(Condition2) | 34 #if ENABLE(Condition1) || ENABLE(Condition2) |
| 35 #include "V8TestInterface.h" | 35 #include "V8TestInterface.h" |
| 36 | 36 |
| 37 #include "RuntimeEnabledFeatures.h" | 37 #include "RuntimeEnabledFeatures.h" |
| 38 #include "V8Node.h" | 38 #include "V8Node.h" |
| 39 #include "V8NodeList.h" | 39 #include "V8NodeList.h" |
| 40 #include "V8ReferencedType.h" | 40 #include "V8ReferencedType.h" |
| 41 #include "V8TestInterfaceEmpty.h" |
| 41 #include "V8TestObject.h" | 42 #include "V8TestObject.h" |
| 42 #include "bindings/tests/idls/TestImplements.h" | 43 #include "bindings/tests/idls/TestImplements.h" |
| 43 #include "bindings/tests/idls/TestPartialInterface.h" | 44 #include "bindings/tests/idls/TestPartialInterface.h" |
| 44 #include "bindings/v8/ExceptionState.h" | 45 #include "bindings/v8/ExceptionState.h" |
| 45 #include "bindings/v8/V8AbstractEventListener.h" | 46 #include "bindings/v8/V8AbstractEventListener.h" |
| 46 #include "bindings/v8/V8DOMConfiguration.h" | 47 #include "bindings/v8/V8DOMConfiguration.h" |
| 47 #include "bindings/v8/V8EventListenerList.h" | 48 #include "bindings/v8/V8EventListenerList.h" |
| 48 #include "bindings/v8/V8ObjectConstructor.h" | 49 #include "bindings/v8/V8ObjectConstructor.h" |
| 49 #include "core/dom/ContextFeatures.h" | 50 #include "core/dom/ContextFeatures.h" |
| 50 #include "core/dom/Document.h" | 51 #include "core/dom/Document.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 73 WebCore::initializeScriptWrappableForInterface(object); | 74 WebCore::initializeScriptWrappableForInterface(object); |
| 74 } | 75 } |
| 75 | 76 |
| 76 namespace WebCore { | 77 namespace WebCore { |
| 77 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toA
ctiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPer
ContextEnabledMethods, 0, WrapperTypeObjectPrototype }; | 78 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toA
ctiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPer
ContextEnabledMethods, 0, WrapperTypeObjectPrototype }; |
| 78 | 79 |
| 79 namespace TestInterfaceV8Internal { | 80 namespace TestInterfaceV8Internal { |
| 80 | 81 |
| 81 template <typename T> void V8_USE(T) { } | 82 template <typename T> void V8_USE(T) { } |
| 82 | 83 |
| 83 static void implementsStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallba
ckInfo<v8::Value>& info) | 84 static void implementsStaticReadOnlyLongAttributeAttributeGetter(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
| 84 { | 85 { |
| 85 v8SetReturnValueInt(info, TestImplements::implementsStaticReadOnlyAttr()); | 86 v8SetReturnValueInt(info, TestImplements::implementsStaticReadOnlyLongAttrib
ute()); |
| 86 } | 87 } |
| 87 | 88 |
| 88 static void implementsStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::St
ring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 89 static void implementsStaticReadOnlyLongAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 89 { | 90 { |
| 90 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 91 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 91 TestInterfaceV8Internal::implementsStaticReadOnlyAttrAttributeGetter(info); | 92 TestInterfaceV8Internal::implementsStaticReadOnlyLongAttributeAttributeGette
r(info); |
| 92 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 93 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 93 } | 94 } |
| 94 | 95 |
| 95 static void implementsStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 96 static void implementsStaticStringAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) |
| 96 { | 97 { |
| 97 v8SetReturnValueString(info, TestImplements::implementsStaticAttr(), info.Ge
tIsolate()); | 98 v8SetReturnValueString(info, TestImplements::implementsStaticStringAttribute
(), info.GetIsolate()); |
| 98 } | 99 } |
| 99 | 100 |
| 100 static void implementsStaticAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 101 static void implementsStaticStringAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 101 { | 102 { |
| 102 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 103 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 103 TestInterfaceV8Internal::implementsStaticAttrAttributeGetter(info); | 104 TestInterfaceV8Internal::implementsStaticStringAttributeAttributeGetter(info
); |
| 104 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 105 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 105 } | 106 } |
| 106 | 107 |
| 107 static void implementsStaticAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) | 108 static void implementsStaticStringAttributeAttributeSetter(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 108 { | 109 { |
| 109 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 110 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| 110 TestImplements::setImplementsStaticAttr(cppValue); | 111 TestImplements::setImplementsStaticStringAttribute(cppValue); |
| 111 } | 112 } |
| 112 | 113 |
| 113 static void implementsStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 114 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) |
| 114 { | 115 { |
| 115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 116 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 116 TestInterfaceV8Internal::implementsStaticAttrAttributeSetter(jsValue, info); | 117 TestInterfaceV8Internal::implementsStaticStringAttributeAttributeSetter(jsVa
lue, info); |
| 117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 118 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 118 } | 119 } |
| 119 | 120 |
| 120 static void implementsStr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 121 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyC
allbackInfo<v8::Value>& info) |
| 121 { | 122 { |
| 122 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 123 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 123 v8SetReturnValueString(info, TestImplements::implementsStr1(imp), info.GetIs
olate()); | 124 v8SetReturnValueString(info, TestImplements::implementsReadonlyStringAttribu
te(imp), info.GetIsolate()); |
| 124 } | 125 } |
| 125 | 126 |
| 126 static void implementsStr1AttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 127 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v
8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 127 { | 128 { |
| 128 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 129 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 129 TestInterfaceV8Internal::implementsStr1AttributeGetter(info); | 130 TestInterfaceV8Internal::implementsReadonlyStringAttributeAttributeGetter(in
fo); |
| 130 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 131 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 131 } | 132 } |
| 132 | 133 |
| 133 static void implementsStr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 134 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
| 134 { | 135 { |
| 135 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 136 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 136 v8SetReturnValueString(info, TestImplements::implementsStr2(imp), info.GetIs
olate()); | 137 v8SetReturnValueString(info, TestImplements::implementsStringAttribute(imp),
info.GetIsolate()); |
| 137 } | 138 } |
| 138 | 139 |
| 139 static void implementsStr2AttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 140 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 140 { | 141 { |
| 141 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 142 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 142 TestInterfaceV8Internal::implementsStr2AttributeGetter(info); | 143 TestInterfaceV8Internal::implementsStringAttributeAttributeGetter(info); |
| 143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 144 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 144 } | 145 } |
| 145 | 146 |
| 146 static void implementsStr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) | 147 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
| 147 { | 148 { |
| 148 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 149 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 149 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 150 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| 150 TestImplements::setImplementsStr2(imp, cppValue); | 151 TestImplements::setImplementsStringAttribute(imp, cppValue); |
| 151 } | 152 } |
| 152 | 153 |
| 153 static void implementsStr2AttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 154 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 154 { | 155 { |
| 155 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 156 TestInterfaceV8Internal::implementsStr2AttributeSetter(jsValue, info); | 157 TestInterfaceV8Internal::implementsStringAttributeAttributeSetter(jsValue, i
nfo); |
| 157 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 158 } | 159 } |
| 159 | 160 |
| 160 static void implementsStr3AttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 161 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
| 162 { |
| 163 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 164 v8SetReturnValueFast(info, TestImplements::implementsNodeAttribute(imp), imp
); |
| 165 } |
| 166 |
| 167 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 161 { | 168 { |
| 162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 169 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 163 V8TestInterface::implementsStr3AttributeGetterCustom(info); | 170 TestInterfaceV8Internal::implementsNodeAttributeAttributeGetter(info); |
| 164 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 171 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 165 } | 172 } |
| 166 | 173 |
| 167 static void implementsStr3AttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 174 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
| 175 { |
| 176 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 177 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); |
| 178 TestImplements::setImplementsNodeAttribute(imp, WTF::getPtr(cppValue)); |
| 179 } |
| 180 |
| 181 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 168 { | 182 { |
| 169 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 183 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 170 V8TestInterface::implementsStr3AttributeSetterCustom(jsValue, info); | 184 TestInterfaceV8Internal::implementsNodeAttributeAttributeSetter(jsValue, inf
o); |
| 171 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 185 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 172 } | 186 } |
| 173 | 187 |
| 174 static void implementsNodeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 188 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) |
| 175 { | 189 { |
| 176 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 190 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 177 v8SetReturnValueFast(info, TestImplements::implementsNode(imp), imp); | 191 EventListener* jsValue = TestImplements::implementsEventHandlerAttribute(imp
, isolatedWorldForIsolate(info.GetIsolate())); |
| 192 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::
Value>(v8::Null(info.GetIsolate()))); |
| 178 } | 193 } |
| 179 | 194 |
| 180 static void implementsNodeAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 195 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 181 { | 196 { |
| 182 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 197 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 183 TestInterfaceV8Internal::implementsNodeAttributeGetter(info); | 198 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeGetter(info
); |
| 184 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 199 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 185 } | 200 } |
| 186 | 201 |
| 187 static void implementsNodeAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) | 202 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 203 { |
| 204 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 205 transferHiddenDependency(info.Holder(), TestImplements::implementsEventHandl
erAttribute(imp, isolatedWorldForIsolate(info.GetIsolate())), jsValue, V8TestInt
erface::eventListenerCacheIndex, info.GetIsolate()); |
| 206 TestImplements::setImplementsEventHandlerAttribute(imp, V8EventListenerList:
:getEventListener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(
info.GetIsolate())); |
| 207 } |
| 208 |
| 209 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) |
| 210 { |
| 211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 212 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeSetter(jsVa
lue, info); |
| 213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 214 } |
| 215 |
| 216 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
| 217 { |
| 218 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 219 v8SetReturnValueFast(info, TestImplements::implementsRuntimeEnabledNodeAttri
bute(imp), imp); |
| 220 } |
| 221 |
| 222 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 223 { |
| 224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 225 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGette
r(info); |
| 226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 227 } |
| 228 |
| 229 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 188 { | 230 { |
| 189 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 231 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 190 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 232 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); |
| 191 TestImplements::setImplementsNode(imp, WTF::getPtr(cppValue)); | 233 TestImplements::setImplementsRuntimeEnabledNodeAttribute(imp, WTF::getPtr(cp
pValue)); |
| 192 } | 234 } |
| 193 | 235 |
| 194 static void implementsNodeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 236 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) |
| 195 { | 237 { |
| 196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 238 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 197 TestInterfaceV8Internal::implementsNodeAttributeSetter(jsValue, info); | 239 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSette
r(jsValue, info); |
| 198 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 240 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 199 } | 241 } |
| 200 | 242 |
| 201 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | |
| 202 { | |
| 203 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | |
| 204 EventListener* jsValue = TestImplements::eventHandlerAttribute(imp, isolated
WorldForIsolate(info.GetIsolate())); | |
| 205 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::
Value>(v8::Null(info.GetIsolate()))); | |
| 206 } | |
| 207 | |
| 208 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 209 { | |
| 210 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
| 211 TestInterfaceV8Internal::eventHandlerAttributeAttributeGetter(info); | |
| 212 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
| 213 } | |
| 214 | |
| 215 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | |
| 216 { | |
| 217 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | |
| 218 transferHiddenDependency(info.Holder(), TestImplements::eventHandlerAttribut
e(imp, isolatedWorldForIsolate(info.GetIsolate())), jsValue, V8TestInterface::ev
entListenerCacheIndex, info.GetIsolate()); | |
| 219 TestImplements::setEventHandlerAttribute(imp, V8EventListenerList::getEventL
istener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIs
olate())); | |
| 220 } | |
| 221 | |
| 222 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | |
| 223 { | |
| 224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
| 225 TestInterfaceV8Internal::eventHandlerAttributeAttributeSetter(jsValue, info)
; | |
| 226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
| 227 } | |
| 228 | |
| 229 static void Node23AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf
o) | |
| 230 { | |
| 231 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | |
| 232 v8SetReturnValueFast(info, TestImplements::node23(imp), imp); | |
| 233 } | |
| 234 | |
| 235 static void Node23AttributeGetterCallback(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>& info) | |
| 236 { | |
| 237 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
| 238 TestInterfaceV8Internal::Node23AttributeGetter(info); | |
| 239 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
| 240 } | |
| 241 | |
| 242 static void Node23AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) | |
| 243 { | |
| 244 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | |
| 245 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | |
| 246 TestImplements::setNode23(imp, WTF::getPtr(cppValue)); | |
| 247 } | |
| 248 | |
| 249 static void Node23AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | |
| 250 { | |
| 251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
| 252 TestInterfaceV8Internal::Node23AttributeSetter(jsValue, info); | |
| 253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
| 254 } | |
| 255 | |
| 256 static void Node24AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf
o) | |
| 257 { | |
| 258 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | |
| 259 v8SetReturnValueFast(info, TestImplements::node24(imp), imp); | |
| 260 } | |
| 261 | |
| 262 static void Node24AttributeGetterCallback(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>& info) | |
| 263 { | |
| 264 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
| 265 TestInterfaceV8Internal::Node24AttributeGetter(info); | |
| 266 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
| 267 } | |
| 268 | |
| 269 static void Node24AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) | |
| 270 { | |
| 271 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | |
| 272 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | |
| 273 TestImplements::setNode24(imp, WTF::getPtr(cppValue)); | |
| 274 } | |
| 275 | |
| 276 static void Node24AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | |
| 277 { | |
| 278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
| 279 TestInterfaceV8Internal::Node24AttributeSetter(jsValue, info); | |
| 280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
| 281 } | |
| 282 | |
| 283 #if ENABLE(CONDITION_PARTIAL) | 243 #if ENABLE(CONDITION_PARTIAL) |
| 284 static void supplementalStaticReadOnlyAttrAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 244 static void supplementalStaticReadOnlyAttrAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
| 285 { | 245 { |
| 286 v8SetReturnValueInt(info, TestPartialInterface::supplementalStaticReadOnlyAt
tr()); | 246 v8SetReturnValueInt(info, TestPartialInterface::supplementalStaticReadOnlyAt
tr()); |
| 287 } | 247 } |
| 288 #endif // ENABLE(CONDITION_PARTIAL) | 248 #endif // ENABLE(CONDITION_PARTIAL) |
| 289 | 249 |
| 290 #if ENABLE(CONDITION_PARTIAL) | 250 #if ENABLE(CONDITION_PARTIAL) |
| 291 static void supplementalStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 251 static void supplementalStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 292 { | 252 { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 474 |
| 515 #if ENABLE(CONDITION_PARTIAL) | 475 #if ENABLE(CONDITION_PARTIAL) |
| 516 static void Node15AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 476 static void Node15AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 517 { | 477 { |
| 518 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 519 TestInterfaceV8Internal::Node15AttributeSetter(jsValue, info); | 479 TestInterfaceV8Internal::Node15AttributeSetter(jsValue, info); |
| 520 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 480 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 521 } | 481 } |
| 522 #endif // ENABLE(CONDITION_PARTIAL) | 482 #endif // ENABLE(CONDITION_PARTIAL) |
| 523 | 483 |
| 524 static void implementsMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 484 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 525 { | 485 { |
| 526 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 486 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 527 TestImplements::implementsMethod1(imp); | 487 TestImplements::implementsVoidMethod(imp); |
| 528 } | 488 } |
| 529 | 489 |
| 530 static void implementsMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 490 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 531 { | 491 { |
| 532 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 492 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 533 TestInterfaceV8Internal::implementsMethod1Method(info); | 493 TestInterfaceV8Internal::implementsVoidMethodMethod(info); |
| 534 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 494 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 535 } | 495 } |
| 536 | 496 |
| 537 static void implementsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 497 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 538 { | 498 { |
| 539 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsM
ethod2", "TestInterface", info.Holder(), info.GetIsolate()); | 499 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC
omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); |
| 540 if (UNLIKELY(info.Length() < 2)) { | 500 if (UNLIKELY(info.Length() < 2)) { |
| 541 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 501 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 542 exceptionState.throwIfNeeded(); | 502 exceptionState.throwIfNeeded(); |
| 543 return; | 503 return; |
| 544 } | 504 } |
| 545 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 505 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 546 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 506 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 547 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 507 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8
TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0); |
| 548 exceptionState.throwTypeError("The callback provided as parameter 2 is n
ot a function."); | |
| 549 exceptionState.throwIfNeeded(); | |
| 550 return; | |
| 551 } | |
| 552 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); | |
| 553 ExecutionContext* scriptContext = getExecutionContext(); | 508 ExecutionContext* scriptContext = getExecutionContext(); |
| 554 RefPtr<TestObj> result = TestImplements::implementsMethod2(scriptContext, im
p, strArg, objArg.release(), exceptionState); | 509 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod(
scriptContext, imp, strArg, testInterfaceEmptyArg, exceptionState); |
| 555 if (exceptionState.throwIfNeeded()) | 510 if (exceptionState.throwIfNeeded()) |
| 556 return; | 511 return; |
| 557 v8SetReturnValue(info, result.release()); | 512 v8SetReturnValue(info, result.release()); |
| 558 } | 513 } |
| 559 | 514 |
| 560 static void implementsMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 515 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 561 { | 516 { |
| 562 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 517 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 563 TestInterfaceV8Internal::implementsMethod2Method(info); | 518 TestInterfaceV8Internal::implementsComplexMethodMethod(info); |
| 564 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 519 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 565 } | 520 } |
| 566 | 521 |
| 567 static void implementsMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 522 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 568 { | 523 { |
| 569 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 524 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 570 V8TestInterface::implementsMethod3MethodCustom(info); | 525 V8TestInterface::implementsCustomVoidMethodMethodCustom(info); |
| 571 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 526 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 572 } | 527 } |
| 573 | 528 |
| 574 static void implementsMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 529 static void implementsStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 575 { | 530 { |
| 576 TestImplements::implementsMethod4(); | 531 TestImplements::implementsStaticVoidMethod(); |
| 577 } | 532 } |
| 578 | 533 |
| 579 static void implementsMethod4MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 534 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 580 { | 535 { |
| 581 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 536 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 582 TestInterfaceV8Internal::implementsMethod4Method(info); | 537 TestInterfaceV8Internal::implementsStaticVoidMethodMethod(info); |
| 583 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 538 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 584 } | 539 } |
| 585 | 540 |
| 586 #if ENABLE(CONDITION_PARTIAL) | 541 #if ENABLE(CONDITION_PARTIAL) |
| 587 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 542 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 588 { | 543 { |
| 589 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 544 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 590 TestPartialInterface::supplementalMethod1(imp); | 545 TestPartialInterface::supplementalMethod1(imp); |
| 591 } | 546 } |
| 592 #endif // ENABLE(CONDITION_PARTIAL) | 547 #endif // ENABLE(CONDITION_PARTIAL) |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 ReferencedType* referencedName = impl->referencedName(); | 729 ReferencedType* referencedName = impl->referencedName(); |
| 775 if (referencedName) { | 730 if (referencedName) { |
| 776 if (!DOMDataStore::containsWrapper<V8ReferencedType>(referencedName, iso
late)) | 731 if (!DOMDataStore::containsWrapper<V8ReferencedType>(referencedName, iso
late)) |
| 777 wrap(referencedName, creationContext, isolate); | 732 wrap(referencedName, creationContext, isolate); |
| 778 DOMDataStore::setWrapperReference<V8ReferencedType>(wrapper, referencedN
ame, isolate); | 733 DOMDataStore::setWrapperReference<V8ReferencedType>(wrapper, referencedN
ame, isolate); |
| 779 } | 734 } |
| 780 setObjectGroup(object, wrapper, isolate); | 735 setObjectGroup(object, wrapper, isolate); |
| 781 } | 736 } |
| 782 | 737 |
| 783 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttribute
s[] = { | 738 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttribute
s[] = { |
| 784 {"implementsStr1", TestInterfaceV8Internal::implementsStr1AttributeGetterCal
lback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::
PropertyAttribute>(v8::None), 0 /* on instance */}, | 739 {"implementsReadonlyStringAttribute", TestInterfaceV8Internal::implementsRea
donlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on inst
ance */}, |
| 785 {"implementsStr2", TestInterfaceV8Internal::implementsStr2AttributeGetterCal
lback, TestInterfaceV8Internal::implementsStr2AttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, | 740 {"implementsStringAttribute", TestInterfaceV8Internal::implementsStringAttri
buteAttributeGetterCallback, TestInterfaceV8Internal::implementsStringAttributeA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 786 {"implementsStr3", TestInterfaceV8Internal::implementsStr3AttributeGetterCal
lback, TestInterfaceV8Internal::implementsStr3AttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, | 741 {"implementsNodeAttribute", TestInterfaceV8Internal::implementsNodeAttribute
AttributeGetterCallback, TestInterfaceV8Internal::implementsNodeAttributeAttribu
teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 787 {"implementsNode", TestInterfaceV8Internal::implementsNodeAttributeGetterCal
lback, TestInterfaceV8Internal::implementsNodeAttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, | 742 {"implementsEventHandlerAttribute", TestInterfaceV8Internal::implementsEvent
HandlerAttributeAttributeGetterCallback, TestInterfaceV8Internal::implementsEven
tHandlerAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, |
| 788 {"eventHandlerAttribute", TestInterfaceV8Internal::eventHandlerAttributeAttr
ibuteGetterCallback, TestInterfaceV8Internal::eventHandlerAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 789 #if ENABLE(CONDITION_PARTIAL) | 743 #if ENABLE(CONDITION_PARTIAL) |
| 790 {"supplementalStr1", TestInterfaceV8Internal::supplementalStr1AttributeGette
rCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<
v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 744 {"supplementalStr1", TestInterfaceV8Internal::supplementalStr1AttributeGette
rCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<
v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 791 #endif // ENABLE(CONDITION_PARTIAL) | 745 #endif // ENABLE(CONDITION_PARTIAL) |
| 792 #if ENABLE(CONDITION_PARTIAL) | 746 #if ENABLE(CONDITION_PARTIAL) |
| 793 {"supplementalStr2", TestInterfaceV8Internal::supplementalStr2AttributeGette
rCallback, TestInterfaceV8Internal::supplementalStr2AttributeSetterCallback, 0,
0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, | 747 {"supplementalStr2", TestInterfaceV8Internal::supplementalStr2AttributeGette
rCallback, TestInterfaceV8Internal::supplementalStr2AttributeSetterCallback, 0,
0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, |
| 794 #endif // ENABLE(CONDITION_PARTIAL) | 748 #endif // ENABLE(CONDITION_PARTIAL) |
| 795 #if ENABLE(CONDITION_PARTIAL) | 749 #if ENABLE(CONDITION_PARTIAL) |
| 796 {"supplementalNode", TestInterfaceV8Internal::supplementalNodeAttributeGette
rCallback, TestInterfaceV8Internal::supplementalNodeAttributeSetterCallback, 0,
0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, | 750 {"supplementalNode", TestInterfaceV8Internal::supplementalNodeAttributeGette
rCallback, TestInterfaceV8Internal::supplementalNodeAttributeSetterCallback, 0,
0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, |
| 797 #endif // ENABLE(CONDITION_PARTIAL) | 751 #endif // ENABLE(CONDITION_PARTIAL) |
| 798 }; | 752 }; |
| 799 | 753 |
| 800 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] =
{ | 754 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] =
{ |
| 801 {"implementsMethod1", TestInterfaceV8Internal::implementsMethod1MethodCallba
ck, 0, 0}, | 755 {"implementsVoidMethod", TestInterfaceV8Internal::implementsVoidMethodMethod
Callback, 0, 0}, |
| 802 {"implementsMethod2", TestInterfaceV8Internal::implementsMethod2MethodCallba
ck, 0, 2}, | 756 {"implementsComplexMethod", TestInterfaceV8Internal::implementsComplexMethod
MethodCallback, 0, 2}, |
| 803 {"implementsMethod3", TestInterfaceV8Internal::implementsMethod3MethodCallba
ck, 0, 0}, | 757 {"implementsCustomVoidMethod", TestInterfaceV8Internal::implementsCustomVoid
MethodMethodCallback, 0, 0}, |
| 804 #if ENABLE(CONDITION_PARTIAL) | 758 #if ENABLE(CONDITION_PARTIAL) |
| 805 {"supplementalMethod1", TestInterfaceV8Internal::supplementalMethod1MethodCa
llback, 0, 0}, | 759 {"supplementalMethod1", TestInterfaceV8Internal::supplementalMethod1MethodCa
llback, 0, 0}, |
| 806 #endif // ENABLE(CONDITION_PARTIAL) | 760 #endif // ENABLE(CONDITION_PARTIAL) |
| 807 #if ENABLE(CONDITION_PARTIAL) | 761 #if ENABLE(CONDITION_PARTIAL) |
| 808 {"supplementalMethod2", TestInterfaceV8Internal::supplementalMethod2MethodCa
llback, 0, 2}, | 762 {"supplementalMethod2", TestInterfaceV8Internal::supplementalMethod2MethodCa
llback, 0, 2}, |
| 809 #endif // ENABLE(CONDITION_PARTIAL) | 763 #endif // ENABLE(CONDITION_PARTIAL) |
| 810 #if ENABLE(CONDITION_PARTIAL) | 764 #if ENABLE(CONDITION_PARTIAL) |
| 811 {"supplementalMethod3", TestInterfaceV8Internal::supplementalMethod3MethodCa
llback, 0, 0}, | 765 {"supplementalMethod3", TestInterfaceV8Internal::supplementalMethod3MethodCa
llback, 0, 0}, |
| 812 #endif // ENABLE(CONDITION_PARTIAL) | 766 #endif // ENABLE(CONDITION_PARTIAL) |
| 813 }; | 767 }; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 835 v8::Local<v8::Signature> defaultSignature; | 789 v8::Local<v8::Signature> defaultSignature; |
| 836 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern
alFieldCount, | 790 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern
alFieldCount, |
| 837 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes), | 791 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes), |
| 838 0, 0, | 792 0, 0, |
| 839 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), | 793 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), |
| 840 isolate, currentWorldType); | 794 isolate, currentWorldType); |
| 841 functionTemplate->SetCallHandler(V8TestInterface::constructorCallback); | 795 functionTemplate->SetCallHandler(V8TestInterface::constructorCallback); |
| 842 functionTemplate->SetLength(1); | 796 functionTemplate->SetLength(1); |
| 843 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 797 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 844 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 798 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 845 if (RuntimeEnabledFeatures::featureName23Enabled()) { | 799 if (RuntimeEnabledFeatures::implementsFeatureNameEnabled()) { |
| 846 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 800 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 847 {"Node23", TestInterfaceV8Internal::Node23AttributeGetterCallback, TestI
nterfaceV8Internal::Node23AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 801 {"implementsRuntimeEnabledNodeAttribute", TestInterfaceV8Internal::imple
mentsRuntimeEnabledNodeAttributeAttributeGetterCallback, TestInterfaceV8Internal
::implementsRuntimeEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0, static_
cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::Non
e), 0 /* on instance */}; |
| 848 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 802 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
| 849 } | 803 } |
| 850 #if ENABLE(CONDITION_PARTIAL) | 804 #if ENABLE(CONDITION_PARTIAL) |
| 851 if (RuntimeEnabledFeatures::condition13Enabled()) { | 805 if (RuntimeEnabledFeatures::condition13Enabled()) { |
| 852 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 806 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 853 {"Node13", TestInterfaceV8Internal::Node13AttributeGetterCallback, TestI
nterfaceV8Internal::Node13AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 807 {"Node13", TestInterfaceV8Internal::Node13AttributeGetterCallback, TestI
nterfaceV8Internal::Node13AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
| 854 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 808 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
| 855 } | 809 } |
| 856 #endif // ENABLE(CONDITION_PARTIAL) | 810 #endif // ENABLE(CONDITION_PARTIAL) |
| 857 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta
nts[] = { | 811 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta
nts[] = { |
| 858 {"IMPLEMENTSCONSTANT1", 1}, | 812 {"IMPLEMENTS_CONSTANT_1", 1}, |
| 859 {"IMPLEMENTSCONSTANT2", 2}, | 813 {"IMPLEMENTS_CONSTANT_2", 2}, |
| 860 {"SUPPLEMENTALCONSTANT1", 1}, | 814 {"SUPPLEMENTALCONSTANT1", 1}, |
| 861 {"SUPPLEMENTALCONSTANT2", 2}, | 815 {"SUPPLEMENTALCONSTANT2", 2}, |
| 862 }; | 816 }; |
| 863 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); | 817 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); |
| 864 COMPILE_ASSERT(1 == TestImplements::IMPLEMENTSCONSTANT1, TheValueOfTestInter
face_IMPLEMENTSCONSTANT1DoesntMatchWithImplementation); | 818 COMPILE_ASSERT(1 == TestImplements::IMPLEMENTS_CONSTANT_1, TheValueOfTestInt
erface_IMPLEMENTS_CONSTANT_1DoesntMatchWithImplementation); |
| 865 COMPILE_ASSERT(2 == TestImplements::CONST_IMPL, TheValueOfTestInterface_CONS
T_IMPLDoesntMatchWithImplementation); | 819 COMPILE_ASSERT(2 == TestImplements::IMPLEMENTS_REFLECT_CONSTANT, TheValueOfT
estInterface_IMPLEMENTS_REFLECT_CONSTANTDoesntMatchWithImplementation); |
| 866 COMPILE_ASSERT(1 == TestPartialInterface::SUPPLEMENTALCONSTANT1, TheValueOfT
estInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation); | 820 COMPILE_ASSERT(1 == TestPartialInterface::SUPPLEMENTALCONSTANT1, TheValueOfT
estInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation); |
| 867 COMPILE_ASSERT(2 == TestPartialInterface::CONST_IMPL, TheValueOfTestInterfac
e_CONST_IMPLDoesntMatchWithImplementation); | 821 COMPILE_ASSERT(2 == TestPartialInterface::CONST_IMPL, TheValueOfTestInterfac
e_CONST_IMPLDoesntMatchWithImplementation); |
| 868 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceV
8Internal::namedPropertyGetterCallback, TestInterfaceV8Internal::namedPropertySe
tterCallback, TestInterfaceV8Internal::namedPropertyQueryCallback, 0, TestInterf
aceV8Internal::namedPropertyEnumeratorCallback); | 822 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceV
8Internal::namedPropertyGetterCallback, TestInterfaceV8Internal::namedPropertySe
tterCallback, TestInterfaceV8Internal::namedPropertyQueryCallback, 0, TestInterf
aceV8Internal::namedPropertyEnumeratorCallback); |
| 869 functionTemplate->Set(v8AtomicString(isolate, "implementsMethod4"), v8::Func
tionTemplate::New(isolate, TestInterfaceV8Internal::implementsMethod4MethodCallb
ack, v8Undefined(), v8::Local<v8::Signature>(), 0)); | 823 functionTemplate->Set(v8AtomicString(isolate, "implementsStaticVoidMethod"),
v8::FunctionTemplate::New(isolate, TestInterfaceV8Internal::implementsStaticVoi
dMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| 870 #if ENABLE(CONDITION_PARTIAL) | 824 #if ENABLE(CONDITION_PARTIAL) |
| 871 functionTemplate->Set(v8AtomicString(isolate, "supplementalMethod4"), v8::Fu
nctionTemplate::New(isolate, TestInterfaceV8Internal::supplementalMethod4MethodC
allback, v8Undefined(), v8::Local<v8::Signature>(), 0)); | 825 functionTemplate->Set(v8AtomicString(isolate, "supplementalMethod4"), v8::Fu
nctionTemplate::New(isolate, TestInterfaceV8Internal::supplementalMethod4MethodC
allback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| 872 #endif // ENABLE(CONDITION_PARTIAL) | 826 #endif // ENABLE(CONDITION_PARTIAL) |
| 873 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticReadOnlyAttr"), TestInterfaceV8Internal::implementsStaticReadOnlyAttrAttrib
uteGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAtt
ribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessCo
ntrol>(v8::DEFAULT)); | 827 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticReadOnlyLongAttribute"), TestInterfaceV8Internal::implementsStaticReadOnlyL
ongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_ca
st<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static
_cast<v8::AccessControl>(v8::DEFAULT)); |
| 874 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticAttr"), TestInterfaceV8Internal::implementsStaticAttrAttributeGetterCallbac
k, TestInterfaceV8Internal::implementsStaticAttrAttributeSetterCallback, v8::Ext
ernal::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle
<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 828 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticStringAttribute"), TestInterfaceV8Internal::implementsStaticStringAttribute
AttributeGetterCallback, TestInterfaceV8Internal::implementsStaticStringAttribut
eAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); |
| 875 #if ENABLE(CONDITION_PARTIAL) | 829 #if ENABLE(CONDITION_PARTIAL) |
| 876 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "supplementa
lStaticReadOnlyAttr"), TestInterfaceV8Internal::supplementalStaticReadOnlyAttrAt
tributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); | 830 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "supplementa
lStaticReadOnlyAttr"), TestInterfaceV8Internal::supplementalStaticReadOnlyAttrAt
tributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); |
| 877 #endif // ENABLE(CONDITION_PARTIAL) | 831 #endif // ENABLE(CONDITION_PARTIAL) |
| 878 #if ENABLE(CONDITION_PARTIAL) | 832 #if ENABLE(CONDITION_PARTIAL) |
| 879 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "supplementa
lStaticAttr"), TestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCal
lback, TestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v
8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::
Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 833 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "supplementa
lStaticAttr"), TestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCal
lback, TestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v
8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::
Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| 880 #endif // ENABLE(CONDITION_PARTIAL) | 834 #endif // ENABLE(CONDITION_PARTIAL) |
| 881 | 835 |
| 882 // Custom toString template | 836 // Custom toString template |
| 883 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 837 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
| 884 } | 838 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 906 bool V8TestInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) | 860 bool V8TestInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) |
| 907 { | 861 { |
| 908 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | 862 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
| 909 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | 863 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
| 910 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | 864 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
| 911 } | 865 } |
| 912 | 866 |
| 913 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, TestInterface* impl, v8::Isolate* isolate) | 867 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, TestInterface* impl, v8::Isolate* isolate) |
| 914 { | 868 { |
| 915 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); | 869 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); |
| 916 if (ContextFeatures::featureName24Enabled(impl->document())) { | |
| 917 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | |
| 918 {"Node24", TestInterfaceV8Internal::Node24AttributeGetterCallback, TestI
nterfaceV8Internal::Node24AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | |
| 919 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | |
| 920 } | |
| 921 if (ContextFeatures::condition14Enabled(impl->document())) { | 870 if (ContextFeatures::condition14Enabled(impl->document())) { |
| 922 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 871 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 923 {"Node14", TestInterfaceV8Internal::Node14AttributeGetterCallback, TestI
nterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 872 {"Node14", TestInterfaceV8Internal::Node14AttributeGetterCallback, TestI
nterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
| 924 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 873 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
| 925 } | 874 } |
| 926 if (ContextFeatures::condition16Enabled(impl->document())) { | 875 if (ContextFeatures::condition16Enabled(impl->document())) { |
| 927 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 876 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 928 {"Node15", TestInterfaceV8Internal::Node15AttributeGetterCallback, TestI
nterfaceV8Internal::Node15AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 877 {"Node15", TestInterfaceV8Internal::Node15AttributeGetterCallback, TestI
nterfaceV8Internal::Node15AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
| 929 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 878 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
| 930 } | 879 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 961 } | 910 } |
| 962 | 911 |
| 963 template<> | 912 template<> |
| 964 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 913 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 965 { | 914 { |
| 966 return toV8(impl, creationContext, isolate); | 915 return toV8(impl, creationContext, isolate); |
| 967 } | 916 } |
| 968 | 917 |
| 969 } // namespace WebCore | 918 } // namespace WebCore |
| 970 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 919 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| OLD | NEW |