| 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 // clang-format off | 7 // clang-format off |
| 8 #include "V8TestInterface5.h" | 8 #include "V8TestInterface5.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 "Be consistent."); | 50 "Be consistent."); |
| 51 static_assert( | 51 static_assert( |
| 52 !std::is_same<decltype(&TestInterface5Implementation::hasPendingActivity), | 52 !std::is_same<decltype(&TestInterface5Implementation::hasPendingActivity), |
| 53 decltype(&ScriptWrappable::hasPendingActivity)>::value, | 53 decltype(&ScriptWrappable::hasPendingActivity)>::value, |
| 54 "TestInterface5Implementation is not overriding hasPendingActivity(), but is
specifying " | 54 "TestInterface5Implementation is not overriding hasPendingActivity(), but is
specifying " |
| 55 "[ActiveScriptWrappable] extended attribute in the IDL file. " | 55 "[ActiveScriptWrappable] extended attribute in the IDL file. " |
| 56 "Be consistent."); | 56 "Be consistent."); |
| 57 | 57 |
| 58 namespace TestInterface5ImplementationV8Internal { | 58 namespace TestInterface5ImplementationV8Internal { |
| 59 | 59 |
| 60 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 60 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 61 { | 61 v8::Local<v8::Object> holder = info.Holder(); |
| 62 v8::Local<v8::Object> holder = info.Holder(); | 62 |
| 63 | 63 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 64 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 64 |
| 65 | 65 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); |
| 66 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl
); | 66 } |
| 67 } | 67 |
| 68 | 68 void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 69 void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 69 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter(
info); |
| 70 { | 70 } |
| 71 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGette
r(info); | 71 |
| 72 } | 72 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 73 | 73 v8::Local<v8::Object> holder = info.Holder(); |
| 74 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 74 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 75 { | 75 |
| 76 v8::Local<v8::Object> holder = info.Holder(); | 76 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "testInterfaceAttribute"); |
| 77 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 77 |
| 78 | 78 // Prepare the value to be set. |
| 79 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "testInterfaceAttribute"); | 79 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeCheck
(info.GetIsolate(), v8Value); |
| 80 | 80 |
| 81 // Prepare the value to be set. | 81 // Type check per: http://heycam.github.io/webidl/#es-interface |
| 82 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeChe
ck(info.GetIsolate(), v8Value); | 82 if (!cppValue) { |
| 83 | 83 exceptionState.throwTypeError("The provided value is not of type 'TestInterf
ace5'."); |
| 84 // Type check per: http://heycam.github.io/webidl/#es-interface | 84 return; |
| 85 if (!cppValue) { | 85 } |
| 86 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface5'."); | 86 |
| 87 return; | 87 impl->setTestInterfaceAttribute(cppValue); |
| 88 } | 88 } |
| 89 | 89 |
| 90 impl->setTestInterfaceAttribute(cppValue); | 90 void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 91 } | 91 v8::Local<v8::Value> v8Value = info[0]; |
| 92 | 92 |
| 93 void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 93 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter(
v8Value, info); |
| 94 { | 94 } |
| 95 v8::Local<v8::Value> v8Value = info[0]; | 95 |
| 96 | 96 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { |
| 97 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette
r(v8Value, info); | 97 v8::Local<v8::Object> holder = info.Holder(); |
| 98 } | 98 |
| 99 | 99 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 100 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 100 |
| 101 { | 101 v8SetReturnValue(info, impl->doubleAttribute()); |
| 102 v8::Local<v8::Object> holder = info.Holder(); | 102 } |
| 103 | 103 |
| 104 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 104 void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 105 | 105 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info); |
| 106 v8SetReturnValue(info, impl->doubleAttribute()); | 106 } |
| 107 } | 107 |
| 108 | 108 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::FunctionCallbackInfo<v8::Value>& info) { |
| 109 void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 109 v8::Local<v8::Object> holder = info.Holder(); |
| 110 { | 110 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 111 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info)
; | 111 |
| 112 } | 112 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "doubleAttribute"); |
| 113 | 113 |
| 114 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::FunctionCallbackInfo<v8::Value>& info) | 114 // Prepare the value to be set. |
| 115 { | 115 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionStat
e); |
| 116 v8::Local<v8::Object> holder = info.Holder(); | 116 if (exceptionState.hadException()) |
| 117 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 117 return; |
| 118 | 118 |
| 119 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "doubleAttribute"); | 119 impl->setDoubleAttribute(cppValue); |
| 120 | 120 } |
| 121 // Prepare the value to be set. | 121 |
| 122 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionSt
ate); | 122 void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 123 if (exceptionState.hadException()) | 123 v8::Local<v8::Value> v8Value = info[0]; |
| 124 return; | 124 |
| 125 | 125 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value
, info); |
| 126 impl->setDoubleAttribute(cppValue); | 126 } |
| 127 } | 127 |
| 128 | 128 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { |
| 129 void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 129 v8::Local<v8::Object> holder = info.Holder(); |
| 130 { | 130 |
| 131 v8::Local<v8::Value> v8Value = info[0]; | 131 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 132 | 132 |
| 133 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Val
ue, info); | 133 v8SetReturnValue(info, impl->floatAttribute()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 136 void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { |
| 137 { | 137 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); |
| 138 v8::Local<v8::Object> holder = info.Holder(); | 138 } |
| 139 | 139 |
| 140 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 140 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
::FunctionCallbackInfo<v8::Value>& info) { |
| 141 | 141 v8::Local<v8::Object> holder = info.Holder(); |
| 142 v8SetReturnValue(info, impl->floatAttribute()); | 142 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 143 } | 143 |
| 144 | 144 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "floatAttribute"); |
| 145 void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 145 |
| 146 { | 146 // Prepare the value to be set. |
| 147 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); | 147 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState)
; |
| 148 } | 148 if (exceptionState.hadException()) |
| 149 | 149 return; |
| 150 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
::FunctionCallbackInfo<v8::Value>& info) | 150 |
| 151 { | 151 impl->setFloatAttribute(cppValue); |
| 152 v8::Local<v8::Object> holder = info.Holder(); | 152 } |
| 153 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 153 |
| 154 | 154 void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { |
| 155 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "floatAttribute"); | 155 v8::Local<v8::Value> v8Value = info[0]; |
| 156 | 156 |
| 157 // Prepare the value to be set. | 157 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value,
info); |
| 158 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionStat
e); | 158 } |
| 159 if (exceptionState.hadException()) | 159 |
| 160 return; | 160 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 161 | 161 v8::Local<v8::Object> holder = info.Holder(); |
| 162 impl->setFloatAttribute(cppValue); | 162 |
| 163 } | 163 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 164 | 164 |
| 165 void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 165 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); |
| 166 { | 166 } |
| 167 v8::Local<v8::Value> v8Value = info[0]; | 167 |
| 168 | 168 void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) { |
| 169 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Valu
e, info); | 169 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGe
tter(info); |
| 170 } | 170 } |
| 171 | 171 |
| 172 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 172 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 173 { | 173 v8::Local<v8::Object> holder = info.Holder(); |
| 174 v8::Local<v8::Object> holder = info.Holder(); | 174 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 175 | 175 |
| 176 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 176 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "unrestrictedDoubleAttribute"); |
| 177 | 177 |
| 178 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); | 178 // Prepare the value to be set. |
| 179 } | 179 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); |
| 180 | 180 if (exceptionState.hadException()) |
| 181 void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 181 return; |
| 182 { | 182 |
| 183 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute
Getter(info); | 183 impl->setUnrestrictedDoubleAttribute(cppValue); |
| 184 } | 184 } |
| 185 | 185 |
| 186 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) | 186 void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) { |
| 187 { | 187 v8::Local<v8::Value> v8Value = info[0]; |
| 188 v8::Local<v8::Object> holder = info.Holder(); | 188 |
| 189 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 189 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSe
tter(v8Value, info); |
| 190 | 190 } |
| 191 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "unrestrictedDoubleAttribute"); | 191 |
| 192 | 192 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback
Info<v8::Value>& info) { |
| 193 // Prepare the value to be set. | 193 v8::Local<v8::Object> holder = info.Holder(); |
| 194 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); | 194 |
| 195 if (exceptionState.hadException()) | 195 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 196 return; | 196 |
| 197 | 197 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); |
| 198 impl->setUnrestrictedDoubleAttribute(cppValue); | 198 } |
| 199 } | 199 |
| 200 | 200 void unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 201 void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 201 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGet
ter(info); |
| 202 { | 202 } |
| 203 v8::Local<v8::Value> v8Value = info[0]; | 203 |
| 204 | 204 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 205 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute
Setter(v8Value, info); | 205 v8::Local<v8::Object> holder = info.Holder(); |
| 206 } | 206 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 207 | 207 |
| 208 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback
Info<v8::Value>& info) | 208 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "unrestrictedFloatAttribute"); |
| 209 { | 209 |
| 210 v8::Local<v8::Object> holder = info.Holder(); | 210 // Prepare the value to be set. |
| 211 | 211 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); |
| 212 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 212 if (exceptionState.hadException()) |
| 213 | 213 return; |
| 214 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); | 214 |
| 215 } | 215 impl->setUnrestrictedFloatAttribute(cppValue); |
| 216 | 216 } |
| 217 void unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 217 |
| 218 { | 218 void unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 219 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeG
etter(info); | 219 v8::Local<v8::Value> v8Value = info[0]; |
| 220 } | 220 |
| 221 | 221 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSet
ter(v8Value, info); |
| 222 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::FunctionCallbackInfo<v8::Value>& info) | 222 } |
| 223 { | 223 |
| 224 v8::Local<v8::Object> holder = info.Holder(); | 224 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) { |
| 225 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 225 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribu
te(), info.GetIsolate()); |
| 226 | 226 } |
| 227 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "unrestrictedFloatAttribute"); | 227 |
| 228 | 228 void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 229 // Prepare the value to be set. | 229 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i
nfo); |
| 230 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); | 230 } |
| 231 if (exceptionState.hadException()) | 231 |
| 232 return; | 232 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) { |
| 233 | 233 // Prepare the value to be set. |
| 234 impl->setUnrestrictedFloatAttribute(cppValue); | 234 V8StringResource<> cppValue = v8Value; |
| 235 } | 235 if (!cppValue.prepare()) |
| 236 | 236 return; |
| 237 void unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 237 |
| 238 { | 238 TestInterface5Implementation::setStaticStringAttribute(cppValue); |
| 239 v8::Local<v8::Value> v8Value = info[0]; | 239 } |
| 240 | 240 |
| 241 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeS
etter(v8Value, info); | 241 void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 242 } | 242 v8::Local<v8::Value> v8Value = info[0]; |
| 243 | 243 |
| 244 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) | 244 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v
8Value, info); |
| 245 { | 245 } |
| 246 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttri
bute(), info.GetIsolate()); | 246 |
| 247 } | 247 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 248 | 248 v8::Local<v8::Object> holder = info.Holder(); |
| 249 void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 249 |
| 250 { | 250 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 251 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter
(info); | 251 |
| 252 } | 252 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); |
| 253 | 253 } |
| 254 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) | 254 |
| 255 { | 255 void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 256 // Prepare the value to be set. | 256 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(
info); |
| 257 V8StringResource<> cppValue = v8Value; | 257 } |
| 258 if (!cppValue.prepare()) | 258 |
| 259 return; | 259 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 260 | 260 v8::Local<v8::Object> holder = info.Holder(); |
| 261 TestInterface5Implementation::setStaticStringAttribute(cppValue); | 261 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 262 } | 262 |
| 263 | 263 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "alwaysExposedAttribute"); |
| 264 void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 264 |
| 265 { | 265 // Prepare the value to be set. |
| 266 v8::Local<v8::Value> v8Value = info[0]; | 266 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); |
| 267 | 267 if (exceptionState.hadException()) |
| 268 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter
(v8Value, info); | 268 return; |
| 269 } | 269 |
| 270 | 270 impl->setAlwaysExposedAttribute(cppValue); |
| 271 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 271 } |
| 272 { | 272 |
| 273 v8::Local<v8::Object> holder = info.Holder(); | 273 void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 274 | 274 v8::Local<v8::Value> v8Value = info[0]; |
| 275 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 275 |
| 276 | 276 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(
v8Value, info); |
| 277 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); | 277 } |
| 278 } | 278 |
| 279 | 279 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 280 void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 280 v8::Local<v8::Object> holder = info.Holder(); |
| 281 { | 281 |
| 282 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGette
r(info); | 282 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 283 } | 283 |
| 284 | 284 v8SetReturnValueInt(info, impl->workerExposedAttribute()); |
| 285 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 285 } |
| 286 { | 286 |
| 287 v8::Local<v8::Object> holder = info.Holder(); | 287 void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 288 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 288 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter(
info); |
| 289 | 289 } |
| 290 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "alwaysExposedAttribute"); | 290 |
| 291 | 291 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 292 // Prepare the value to be set. | 292 v8::Local<v8::Object> holder = info.Holder(); |
| 293 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 293 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 294 if (exceptionState.hadException()) | 294 |
| 295 return; | 295 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "workerExposedAttribute"); |
| 296 | 296 |
| 297 impl->setAlwaysExposedAttribute(cppValue); | 297 // Prepare the value to be set. |
| 298 } | 298 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); |
| 299 | 299 if (exceptionState.hadException()) |
| 300 void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 300 return; |
| 301 { | 301 |
| 302 v8::Local<v8::Value> v8Value = info[0]; | 302 impl->setWorkerExposedAttribute(cppValue); |
| 303 | 303 } |
| 304 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSette
r(v8Value, info); | 304 |
| 305 } | 305 void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 306 | 306 v8::Local<v8::Value> v8Value = info[0]; |
| 307 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 307 |
| 308 { | 308 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter(
v8Value, info); |
| 309 v8::Local<v8::Object> holder = info.Holder(); | 309 } |
| 310 | 310 |
| 311 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 311 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 312 | 312 v8::Local<v8::Object> holder = info.Holder(); |
| 313 v8SetReturnValueInt(info, impl->workerExposedAttribute()); | 313 |
| 314 } | 314 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 315 | 315 |
| 316 void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 316 v8SetReturnValueInt(info, impl->windowExposedAttribute()); |
| 317 { | 317 } |
| 318 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGette
r(info); | 318 |
| 319 } | 319 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 320 | 320 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter(
info); |
| 321 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 321 } |
| 322 { | 322 |
| 323 v8::Local<v8::Object> holder = info.Holder(); | 323 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 324 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 324 v8::Local<v8::Object> holder = info.Holder(); |
| 325 | 325 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 326 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "workerExposedAttribute"); | 326 |
| 327 | 327 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "windowExposedAttribute"); |
| 328 // Prepare the value to be set. | 328 |
| 329 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 329 // Prepare the value to be set. |
| 330 if (exceptionState.hadException()) | 330 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); |
| 331 return; | 331 if (exceptionState.hadException()) |
| 332 | 332 return; |
| 333 impl->setWorkerExposedAttribute(cppValue); | 333 |
| 334 } | 334 impl->setWindowExposedAttribute(cppValue); |
| 335 | 335 } |
| 336 void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 336 |
| 337 { | 337 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 338 v8::Local<v8::Value> v8Value = info[0]; | 338 v8::Local<v8::Value> v8Value = info[0]; |
| 339 | 339 |
| 340 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSette
r(v8Value, info); | 340 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter(
v8Value, info); |
| 341 } | 341 } |
| 342 | 342 |
| 343 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 343 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 344 { | 344 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 345 v8::Local<v8::Object> holder = info.Holder(); | 345 |
| 346 | 346 if (UNLIKELY(info.Length() < 1)) { |
| 347 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 347 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage
s::notEnoughArguments(1, info.Length()))); |
| 348 | 348 return; |
| 349 v8SetReturnValueInt(info, impl->windowExposedAttribute()); | 349 } |
| 350 } | 350 |
| 351 | 351 TestInterfaceEmpty* testInterfaceEmptyArg; |
| 352 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 352 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsol
ate(), info[0]); |
| 353 { | 353 if (!testInterfaceEmptyArg) { |
| 354 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGette
r(info); | 354 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is
not of type 'TestInterfaceEmpty'.")); |
| 355 } | 355 |
| 356 | 356 return; |
| 357 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 357 } |
| 358 { | 358 |
| 359 v8::Local<v8::Object> holder = info.Holder(); | 359 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); |
| 360 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 360 } |
| 361 | 361 |
| 362 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "windowExposedAttribute"); | 362 void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 363 | 363 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(
info); |
| 364 // Prepare the value to be set. | 364 } |
| 365 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 365 |
| 366 if (exceptionState.hadException()) | 366 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) { |
| 367 return; | 367 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodDoubleArgFloatArg"); |
| 368 | 368 |
| 369 impl->setWindowExposedAttribute(cppValue); | 369 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 370 } | 370 |
| 371 | 371 if (UNLIKELY(info.Length() < 2)) { |
| 372 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 372 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.
Length())); |
| 373 { | 373 return; |
| 374 v8::Local<v8::Value> v8Value = info[0]; | 374 } |
| 375 | 375 |
| 376 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette
r(v8Value, info); | 376 double doubleArg; |
| 377 } | 377 float floatArg; |
| 378 | 378 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
| 379 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) | 379 if (exceptionState.hadException()) |
| 380 { | 380 return; |
| 381 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 381 |
| 382 | 382 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); |
| 383 if (UNLIKELY(info.Length() < 1)) { | 383 if (exceptionState.hadException()) |
| 384 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMes
sages::notEnoughArguments(1, info.Length()))); | 384 return; |
| 385 return; | 385 |
| 386 } | 386 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); |
| 387 | 387 } |
| 388 TestInterfaceEmpty* testInterfaceEmptyArg; | 388 |
| 389 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs
olate(), info[0]); | 389 void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) { |
| 390 if (!testInterfaceEmptyArg) { | 390 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info
); |
| 391 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1
is not of type 'TestInterfaceEmpty'.")); | 391 } |
| 392 | 392 |
| 393 return; | 393 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
FunctionCallbackInfo<v8::Value>& info) { |
| 394 } | 394 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); |
| 395 | 395 |
| 396 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); | 396 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 397 } | 397 |
| 398 | 398 if (UNLIKELY(info.Length() < 2)) { |
| 399 void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 399 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.
Length())); |
| 400 { | 400 return; |
| 401 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMetho
d(info); | 401 } |
| 402 } | 402 |
| 403 | 403 double unrestrictedDoubleArg; |
| 404 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 404 float unrestrictedFloatArg; |
| 405 { | 405 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState); |
| 406 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "voidMethodDoubleArgFloatArg"); | 406 if (exceptionState.hadException()) |
| 407 | 407 return; |
| 408 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 408 |
| 409 | 409 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); |
| 410 if (UNLIKELY(info.Length() < 2)) { | 410 if (exceptionState.hadException()) |
| 411 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 411 return; |
| 412 return; | 412 |
| 413 } | 413 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleAr
g, unrestrictedFloatArg); |
| 414 | 414 } |
| 415 double doubleArg; | 415 |
| 416 float floatArg; | 416 void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) { |
| 417 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); | 417 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestr
ictedFloatArgMethod(info); |
| 418 if (exceptionState.hadException()) | 418 } |
| 419 return; | 419 |
| 420 | 420 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 421 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); | 421 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 422 if (exceptionState.hadException()) | 422 |
| 423 return; | 423 impl->voidMethod(); |
| 424 | 424 } |
| 425 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); | 425 |
| 426 } | 426 void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 427 | 427 TestInterface5ImplementationV8Internal::voidMethodMethod(info); |
| 428 void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 428 } |
| 429 { | 429 |
| 430 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(in
fo); | 430 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) { |
| 431 } | 431 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 432 | 432 |
| 433 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
FunctionCallbackInfo<v8::Value>& info) | 433 impl->voidMethod(); |
| 434 { | 434 } |
| 435 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); | 435 |
| 436 | 436 void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { |
| 437 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 437 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); |
| 438 | 438 } |
| 439 if (UNLIKELY(info.Length() < 2)) { | 439 |
| 440 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 440 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { |
| 441 return; | 441 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 442 } | 442 |
| 443 | 443 impl->alwaysExposedMethod(); |
| 444 double unrestrictedDoubleArg; | 444 } |
| 445 float unrestrictedFloatArg; | 445 |
| 446 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState)
; | 446 void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { |
| 447 if (exceptionState.hadException()) | 447 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); |
| 448 return; | 448 } |
| 449 | 449 |
| 450 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); | 450 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { |
| 451 if (exceptionState.hadException()) | 451 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 452 return; | 452 |
| 453 | 453 impl->workerExposedMethod(); |
| 454 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble
Arg, unrestrictedFloatArg); | 454 } |
| 455 } | 455 |
| 456 | 456 void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { |
| 457 void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 457 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); |
| 458 { | 458 } |
| 459 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnres
trictedFloatArgMethod(info); | 459 |
| 460 } | 460 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { |
| 461 | 461 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 462 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 462 |
| 463 { | 463 impl->windowExposedMethod(); |
| 464 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 464 } |
| 465 | 465 |
| 466 impl->voidMethod(); | 466 void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { |
| 467 } | 467 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); |
| 468 | 468 } |
| 469 void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 469 |
| 470 { | 470 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 471 TestInterface5ImplementationV8Internal::voidMethodMethod(info); | 471 TestInterface5Implementation::alwaysExposedStaticMethod(); |
| 472 } | 472 } |
| 473 | 473 |
| 474 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 474 void alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { |
| 475 { | 475 TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info); |
| 476 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 476 } |
| 477 | 477 |
| 478 impl->voidMethod(); | 478 static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 479 } | 479 TestInterface5Implementation::workerExposedStaticMethod(); |
| 480 | 480 } |
| 481 void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 481 |
| 482 { | 482 void workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { |
| 483 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); | 483 TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info); |
| 484 } | 484 } |
| 485 | 485 |
| 486 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 486 static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 487 { | 487 TestInterface5Implementation::windowExposedStaticMethod(); |
| 488 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 488 } |
| 489 | 489 |
| 490 impl->alwaysExposedMethod(); | 490 void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { |
| 491 } | 491 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info); |
| 492 | 492 } |
| 493 void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 493 |
| 494 { | 494 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) { |
| 495 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); | 495 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 496 } | 496 |
| 497 | 497 impl->windowAndServiceWorkerExposedMethod(); |
| 498 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 498 } |
| 499 { | 499 |
| 500 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 500 void windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 501 | 501 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMet
hod(info); |
| 502 impl->workerExposedMethod(); | 502 } |
| 503 } | 503 |
| 504 | 504 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 505 void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 505 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodBooleanOrDOMStringArg"); |
| 506 { | 506 |
| 507 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); | 507 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 508 } | 508 |
| 509 | 509 if (UNLIKELY(info.Length() < 1)) { |
| 510 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 510 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); |
| 511 { | 511 return; |
| 512 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 512 } |
| 513 | 513 |
| 514 impl->windowExposedMethod(); | 514 BooleanOrString arg; |
| 515 } | 515 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversion
Mode::NotNullable, exceptionState); |
| 516 | 516 if (exceptionState.hadException()) |
| 517 void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 517 return; |
| 518 { | 518 |
| 519 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); | 519 impl->voidMethodBooleanOrDOMStringArg(arg); |
| 520 } | 520 } |
| 521 | 521 |
| 522 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 522 void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { |
| 523 { | 523 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMethod(
info); |
| 524 TestInterface5Implementation::alwaysExposedStaticMethod(); | 524 } |
| 525 } | 525 |
| 526 | 526 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) { |
| 527 void alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 527 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodDoubleOrDOMStringArg"); |
| 528 { | 528 |
| 529 TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info
); | 529 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 530 } | 530 |
| 531 | 531 if (UNLIKELY(info.Length() < 1)) { |
| 532 static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 532 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); |
| 533 { | 533 return; |
| 534 TestInterface5Implementation::workerExposedStaticMethod(); | 534 } |
| 535 } | 535 |
| 536 | 536 DoubleOrString arg; |
| 537 void workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 537 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionM
ode::NotNullable, exceptionState); |
| 538 { | 538 if (exceptionState.hadException()) |
| 539 TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info
); | 539 return; |
| 540 } | 540 |
| 541 | 541 impl->voidMethodDoubleOrDOMStringArg(arg); |
| 542 static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 542 } |
| 543 { | 543 |
| 544 TestInterface5Implementation::windowExposedStaticMethod(); | 544 void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 545 } | 545 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod(i
nfo); |
| 546 | 546 } |
| 547 void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 547 |
| 548 { | 548 static void voidMethodVoidExperimentalCallbackFunctionMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) { |
| 549 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info
); | 549 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 550 } | 550 |
| 551 | 551 if (UNLIKELY(info.Length() < 1)) { |
| 552 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 552 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", Excep
tionMessages::notEnoughArguments(1, info.Length()))); |
| 553 { | 553 return; |
| 554 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 554 } |
| 555 | 555 |
| 556 impl->windowAndServiceWorkerExposedMethod(); | 556 VoidExperimentalCallbackFunction* arg; |
| 557 } | 557 arg = V8VoidExperimentalCallbackFunction::toImplWithTypeCheck(info.GetIsolate(
), info[0]); |
| 558 | 558 if (!arg) { |
| 559 void windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 559 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", "para
meter 1 is not of type 'VoidExperimentalCallbackFunction'.")); |
| 560 { | 560 |
| 561 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodM
ethod(info); | 561 return; |
| 562 } | 562 } |
| 563 | 563 |
| 564 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) | 564 impl->voidMethodVoidExperimentalCallbackFunction(arg); |
| 565 { | 565 } |
| 566 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "voidMethodBooleanOrDOMStringArg"); | 566 |
| 567 | 567 void voidMethodVoidExperimentalCallbackFunctionMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) { |
| 568 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 568 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc
tionMethod(info); |
| 569 | 569 } |
| 570 if (UNLIKELY(info.Length() < 1)) { | 570 |
| 571 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 571 static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) { |
| 572 return; | 572 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 573 } | 573 |
| 574 | 574 if (UNLIKELY(info.Length() < 1)) { |
| 575 BooleanOrString arg; | 575 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", Excepti
onMessages::notEnoughArguments(1, info.Length()))); |
| 576 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversi
onMode::NotNullable, exceptionState); | 576 return; |
| 577 if (exceptionState.hadException()) | 577 } |
| 578 return; | 578 |
| 579 | 579 VoidCallbackFunctionModules* arg; |
| 580 impl->voidMethodBooleanOrDOMStringArg(arg); | 580 if (!info[0]->IsFunction()) { |
| 581 } | 581 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca
llback provided as parameter 1 is not a function.")); |
| 582 | 582 |
| 583 void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 583 return; |
| 584 { | 584 } |
| 585 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMetho
d(info); | 585 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate
()), v8::Local<v8::Function>::Cast(info[0])); |
| 586 } | 586 |
| 587 | 587 impl->voidMethodVoidCallbackFunctionModulesArg(arg); |
| 588 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 588 } |
| 589 { | 589 |
| 590 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "voidMethodDoubleOrDOMStringArg"); | 590 void voidMethodVoidCallbackFunctionModulesArgMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) { |
| 591 | 591 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA
rgMethod(info); |
| 592 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 592 } |
| 593 | 593 |
| 594 if (UNLIKELY(info.Length() < 1)) { | 594 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 595 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 595 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "keys"); |
| 596 return; | 596 |
| 597 } | 597 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 598 | 598 |
| 599 DoubleOrString arg; | 599 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 600 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversio
nMode::NotNullable, exceptionState); | 600 |
| 601 if (exceptionState.hadException()) | 601 Iterator* result = impl->keysForBinding(scriptState, exceptionState); |
| 602 return; | 602 if (exceptionState.hadException()) { |
| 603 | 603 return; |
| 604 impl->voidMethodDoubleOrDOMStringArg(arg); | 604 } |
| 605 } | 605 v8SetReturnValue(info, result); |
| 606 | 606 } |
| 607 void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 607 |
| 608 { | 608 void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 609 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod
(info); | 609 TestInterface5ImplementationV8Internal::keysMethod(info); |
| 610 } | 610 } |
| 611 | 611 |
| 612 static void voidMethodVoidExperimentalCallbackFunctionMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) | 612 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 613 { | 613 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "values"); |
| 614 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 614 |
| 615 | 615 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 616 if (UNLIKELY(info.Length() < 1)) { | 616 |
| 617 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", E
xceptionMessages::notEnoughArguments(1, info.Length()))); | 617 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 618 return; | 618 |
| 619 } | 619 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
| 620 | 620 if (exceptionState.hadException()) { |
| 621 VoidExperimentalCallbackFunction* arg; | 621 return; |
| 622 arg = V8VoidExperimentalCallbackFunction::toImplWithTypeCheck(info.GetIsolat
e(), info[0]); | 622 } |
| 623 if (!arg) { | 623 v8SetReturnValue(info, result); |
| 624 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", "
parameter 1 is not of type 'VoidExperimentalCallbackFunction'.")); | 624 } |
| 625 | 625 |
| 626 return; | 626 void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 627 } | 627 TestInterface5ImplementationV8Internal::valuesMethod(info); |
| 628 | 628 } |
| 629 impl->voidMethodVoidExperimentalCallbackFunction(arg); | 629 |
| 630 } | 630 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 631 | 631 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "entries"); |
| 632 void voidMethodVoidExperimentalCallbackFunctionMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 632 |
| 633 { | 633 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 634 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFu
nctionMethod(info); | 634 |
| 635 } | 635 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 636 | 636 |
| 637 static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 637 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
| 638 { | 638 if (exceptionState.hadException()) { |
| 639 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 639 return; |
| 640 | 640 } |
| 641 if (UNLIKELY(info.Length() < 1)) { | 641 v8SetReturnValue(info, result); |
| 642 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", Exc
eptionMessages::notEnoughArguments(1, info.Length()))); | 642 } |
| 643 return; | 643 |
| 644 } | 644 void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 645 | 645 TestInterface5ImplementationV8Internal::entriesMethod(info); |
| 646 VoidCallbackFunctionModules* arg; | 646 } |
| 647 if (!info[0]->IsFunction()) { | 647 |
| 648 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "Th
e callback provided as parameter 1 is not a function.")); | 648 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 649 | 649 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "forEach"); |
| 650 return; | 650 |
| 651 } | 651 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 652 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsola
te()), v8::Local<v8::Function>::Cast(info[0])); | 652 |
| 653 | 653 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 654 impl->voidMethodVoidCallbackFunctionModulesArg(arg); | 654 |
| 655 } | 655 if (UNLIKELY(info.Length() < 1)) { |
| 656 | 656 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); |
| 657 void voidMethodVoidCallbackFunctionModulesArgMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 657 return; |
| 658 { | 658 } |
| 659 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModule
sArgMethod(info); | 659 |
| 660 } | 660 ScriptValue callback; |
| 661 | 661 ScriptValue thisArg; |
| 662 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 662 if (!info[0]->IsFunction()) { |
| 663 { | 663 exceptionState.throwTypeError("The callback provided as parameter 1 is not a
function."); |
| 664 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "keys"); | 664 |
| 665 | 665 return; |
| 666 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 666 } |
| 667 | 667 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); |
| 668 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 668 |
| 669 | 669 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
| 670 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | 670 |
| 671 if (exceptionState.hadException()) { | 671 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()),
callback, thisArg, exceptionState); |
| 672 return; | 672 if (exceptionState.hadException()) { |
| 673 } | 673 return; |
| 674 v8SetReturnValue(info, result); | 674 } |
| 675 } | 675 } |
| 676 | 676 |
| 677 void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 677 void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 678 { | 678 TestInterface5ImplementationV8Internal::forEachMethod(info); |
| 679 TestInterface5ImplementationV8Internal::keysMethod(info); | 679 } |
| 680 } | 680 |
| 681 | 681 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 682 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 682 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 683 { | 683 |
| 684 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "values"); | 684 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); |
| 685 | 685 } |
| 686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 686 |
| 687 | 687 void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 688 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 688 TestInterface5ImplementationV8Internal::toStringMethod(info); |
| 689 | 689 } |
| 690 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 690 |
| 691 if (exceptionState.hadException()) { | 691 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 692 return; | 692 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "iterator"); |
| 693 } | 693 |
| 694 v8SetReturnValue(info, result); | 694 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 695 } | 695 |
| 696 | 696 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 697 void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 697 |
| 698 { | 698 Iterator* result = impl->iterator(scriptState, exceptionState); |
| 699 TestInterface5ImplementationV8Internal::valuesMethod(info); | 699 if (exceptionState.hadException()) { |
| 700 } | 700 return; |
| 701 | 701 } |
| 702 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 702 v8SetReturnValue(info, result); |
| 703 { | 703 } |
| 704 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "entries"); | 704 |
| 705 | 705 void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 706 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 706 TestInterface5ImplementationV8Internal::iteratorMethod(info); |
| 707 | 707 } |
| 708 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 708 |
| 709 | 709 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) { |
| 710 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 710 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 711 if (exceptionState.hadException()) { | 711 String result = impl->anonymousNamedGetter(name); |
| 712 return; | 712 if (result.isNull()) |
| 713 } | 713 return; |
| 714 v8SetReturnValue(info, result); | 714 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 715 } | 715 } |
| 716 | 716 |
| 717 void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 717 void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Value>& info) { |
| 718 { | 718 if (!name->IsString()) |
| 719 TestInterface5ImplementationV8Internal::entriesMethod(info); | 719 return; |
| 720 } | 720 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 721 | 721 |
| 722 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 722 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info
); |
| 723 { | 723 } |
| 724 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "forEach"); | 724 |
| 725 | 725 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 726 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 726 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 727 | 727 V8StringResource<> propertyValue = v8Value; |
| 728 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 728 if (!propertyValue.prepare()) |
| 729 | 729 return; |
| 730 if (UNLIKELY(info.Length() < 1)) { | 730 |
| 731 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 731 bool result = impl->anonymousNamedSetter(name, propertyValue); |
| 732 return; | 732 if (!result) |
| 733 } | 733 return; |
| 734 | 734 v8SetReturnValue(info, v8Value); |
| 735 ScriptValue callback; | 735 } |
| 736 ScriptValue thisArg; | 736 |
| 737 if (!info[0]->IsFunction()) { | 737 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 738 exceptionState.throwTypeError("The callback provided as parameter 1 is n
ot a function."); | 738 if (!name->IsString()) |
| 739 | 739 return; |
| 740 return; | 740 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 741 } | 741 |
| 742 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); | 742 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8Va
lue, info); |
| 743 | 743 } |
| 744 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | 744 |
| 745 | 745 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) { |
| 746 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); | 746 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 747 if (exceptionState.hadException()) { | 747 |
| 748 return; | 748 DeleteResult result = impl->anonymousNamedDeleter(name); |
| 749 } | 749 if (result == DeleteUnknownProperty) |
| 750 } | 750 return; |
| 751 | 751 v8SetReturnValue(info, result == DeleteSuccess); |
| 752 void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 752 } |
| 753 { | 753 |
| 754 TestInterface5ImplementationV8Internal::forEachMethod(info); | 754 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
llbackInfo<v8::Boolean>& info) { |
| 755 } | 755 if (!name->IsString()) |
| 756 | 756 return; |
| 757 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 757 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 758 { | 758 |
| 759 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 759 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, inf
o); |
| 760 | 760 } |
| 761 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); | 761 |
| 762 } | 762 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) { |
| 763 | 763 const CString& nameInUtf8 = name.utf8(); |
| 764 void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 764 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext
, "TestInterface5", nameInUtf8.data()); |
| 765 { | 765 |
| 766 TestInterface5ImplementationV8Internal::toStringMethod(info); | 766 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 767 } | 767 |
| 768 | 768 bool result = impl->namedPropertyQuery(name, exceptionState); |
| 769 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 769 if (!result) |
| 770 { | 770 return; |
| 771 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface5", "iterator"); | 771 v8SetReturnValueInt(info, v8::None); |
| 772 | 772 } |
| 773 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 773 |
| 774 | 774 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Integer>& info) { |
| 775 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 775 if (!name->IsString()) |
| 776 | 776 return; |
| 777 Iterator* result = impl->iterator(scriptState, exceptionState); | 777 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 778 if (exceptionState.hadException()) { | 778 |
| 779 return; | 779 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, info)
; |
| 780 } | 780 } |
| 781 v8SetReturnValue(info, result); | 781 |
| 782 } | 782 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) { |
| 783 | 783 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationCo
ntext, "TestInterface5"); |
| 784 void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 784 |
| 785 { | 785 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 786 TestInterface5ImplementationV8Internal::iteratorMethod(info); | 786 |
| 787 } | 787 Vector<String> names; |
| 788 | 788 impl->namedPropertyEnumerator(names, exceptionState); |
| 789 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) | 789 if (exceptionState.hadException()) |
| 790 { | 790 return; |
| 791 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 791 v8SetReturnValue(info, toV8(names, info.Holder(), info.GetIsolate()).As<v8::Ar
ray>()); |
| 792 String result = impl->anonymousNamedGetter(name); | 792 } |
| 793 if (result.isNull()) | 793 |
| 794 return; | 794 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>&
info) { |
| 795 v8SetReturnValueString(info, result, info.GetIsolate()); | 795 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); |
| 796 } | 796 } |
| 797 | 797 |
| 798 void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Value>& info) | 798 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) { |
| 799 { | 799 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 800 if (!name->IsString()) | 800 |
| 801 return; | 801 // We assume that all the implementations support length() method, although |
| 802 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; | 802 // the spec doesn't require that length() must exist. It's okay that |
| 803 | 803 // the interface does not have length attribute as long as the |
| 804 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, in
fo); | 804 // implementation supports length() member function. |
| 805 } | 805 if (index >= impl->length()) |
| 806 | 806 return; // Returns undefined due to out-of-range. |
| 807 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 807 |
| 808 { | 808 String result = impl->anonymousIndexedGetter(index); |
| 809 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 809 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 810 V8StringResource<> propertyValue = v8Value; | 810 } |
| 811 if (!propertyValue.prepare()) | 811 |
| 812 return; | 812 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) { |
| 813 | 813 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); |
| 814 bool result = impl->anonymousNamedSetter(name, propertyValue); | 814 } |
| 815 if (!result) | 815 |
| 816 return; | 816 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 817 v8SetReturnValue(info, v8Value); | 817 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 818 } | 818 V8StringResource<> propertyValue = v8Value; |
| 819 | 819 if (!propertyValue.prepare()) |
| 820 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 820 return; |
| 821 { | 821 |
| 822 if (!name->IsString()) | 822 bool result = impl->anonymousIndexedSetter(index, propertyValue); |
| 823 return; | 823 if (!result) |
| 824 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; | 824 return; |
| 825 | 825 v8SetReturnValue(info, v8Value); |
| 826 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8
Value, info); | 826 } |
| 827 } | 827 |
| 828 | 828 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 829 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 829 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value,
info); |
| 830 { | 830 } |
| 831 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 831 |
| 832 | 832 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) { |
| 833 DeleteResult result = impl->anonymousNamedDeleter(name); | 833 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 834 if (result == DeleteUnknownProperty) | 834 |
| 835 return; | 835 DeleteResult result = impl->anonymousIndexedDeleter(index); |
| 836 v8SetReturnValue(info, result == DeleteSuccess); | 836 if (result == DeleteUnknownProperty) |
| 837 } | 837 return; |
| 838 | 838 v8SetReturnValue(info, result == DeleteSuccess); |
| 839 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
llbackInfo<v8::Boolean>& info) | 839 } |
| 840 { | 840 |
| 841 if (!name->IsString()) | 841 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) { |
| 842 return; | 842 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); |
| 843 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; | |
| 844 | |
| 845 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, i
nfo); | |
| 846 } | |
| 847 | |
| 848 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) | |
| 849 { | |
| 850 const CString& nameInUtf8 = name.utf8(); | |
| 851 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterConte
xt, "TestInterface5", nameInUtf8.data()); | |
| 852 | |
| 853 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 854 | |
| 855 bool result = impl->namedPropertyQuery(name, exceptionState); | |
| 856 if (!result) | |
| 857 return; | |
| 858 v8SetReturnValueInt(info, v8::None); | |
| 859 } | |
| 860 | |
| 861 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Integer>& info) | |
| 862 { | |
| 863 if (!name->IsString()) | |
| 864 return; | |
| 865 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; | |
| 866 | |
| 867 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, inf
o); | |
| 868 } | |
| 869 | |
| 870 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | |
| 871 { | |
| 872 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Enumeration
Context, "TestInterface5"); | |
| 873 | |
| 874 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 875 | |
| 876 Vector<String> names; | |
| 877 impl->namedPropertyEnumerator(names, exceptionState); | |
| 878 if (exceptionState.hadException()) | |
| 879 return; | |
| 880 v8SetReturnValue(info, toV8(names, info.Holder(), info.GetIsolate()).As<v8::
Array>()); | |
| 881 } | |
| 882 | |
| 883 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>&
info) | |
| 884 { | |
| 885 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); | |
| 886 } | |
| 887 | |
| 888 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | |
| 889 { | |
| 890 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 891 | |
| 892 // We assume that all the implementations support length() method, although | |
| 893 // the spec doesn't require that length() must exist. It's okay that | |
| 894 // the interface does not have length attribute as long as the | |
| 895 // implementation supports length() member function. | |
| 896 if (index >= impl->length()) | |
| 897 return; // Returns undefined due to out-of-range. | |
| 898 | |
| 899 String result = impl->anonymousIndexedGetter(index); | |
| 900 v8SetReturnValueString(info, result, info.GetIsolate()); | |
| 901 } | |
| 902 | |
| 903 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) | |
| 904 { | |
| 905 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); | |
| 906 } | |
| 907 | |
| 908 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 909 { | |
| 910 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 911 V8StringResource<> propertyValue = v8Value; | |
| 912 if (!propertyValue.prepare()) | |
| 913 return; | |
| 914 | |
| 915 bool result = impl->anonymousIndexedSetter(index, propertyValue); | |
| 916 if (!result) | |
| 917 return; | |
| 918 v8SetReturnValue(info, v8Value); | |
| 919 } | |
| 920 | |
| 921 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 922 { | |
| 923 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value
, info); | |
| 924 } | |
| 925 | |
| 926 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | |
| 927 { | |
| 928 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 929 | |
| 930 DeleteResult result = impl->anonymousIndexedDeleter(index); | |
| 931 if (result == DeleteUnknownProperty) | |
| 932 return; | |
| 933 v8SetReturnValue(info, result == DeleteSuccess); | |
| 934 } | |
| 935 | |
| 936 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) | |
| 937 { | |
| 938 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); | |
| 939 } | 843 } |
| 940 | 844 |
| 941 } // namespace TestInterface5ImplementationV8Internal | 845 } // namespace TestInterface5ImplementationV8Internal |
| 942 | 846 |
| 943 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) | 847 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) { |
| 944 { | 848 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5Imp
lementation>(); |
| 945 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I
mplementation>(); | 849 TestInterface5Implementation* referencedName = impl->referencedName(); |
| 946 TestInterface5Implementation* referencedName = impl->referencedName(); | 850 if (referencedName) { |
| 947 if (referencedName) { | 851 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName, is
olate); |
| 948 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName
, isolate); | 852 } |
| 949 } | |
| 950 } | 853 } |
| 951 | 854 |
| 952 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial | 855 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial |
| 953 // and does not depend on another global objects. | 856 // and does not depend on another global objects. |
| 954 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 857 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 955 #pragma clang diagnostic push | 858 #pragma clang diagnostic push |
| 956 #pragma clang diagnostic ignored "-Wglobal-constructors" | 859 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 957 #endif | 860 #endif |
| 958 const V8DOMConfiguration::AttributeConfiguration V8TestInterface5Attributes[] =
{ | 861 const V8DOMConfiguration::AttributeConfiguration V8TestInterface5Attributes[] =
{ |
| 959 {"testInterfaceConstructorAttribute", v8ConstructorAttributeGetter, 0, 0, 0,
const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo), static_cast<v
8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum)
, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOM
Configuration::CheckHolder}, | 862 {"testInterfaceConstructorAttribute", v8ConstructorAttributeGetter, 0, 0, 0,
const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo), static_cast<v
8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum)
, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOM
Configuration::CheckHolder}, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 983 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v
oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration:
:ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 886 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v
oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration:
:ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 984 {"voidMethodVoidExperimentalCallbackFunction", TestInterface5ImplementationV
8Internal::voidMethodVoidExperimentalCallbackFunctionMethodCallback, 0, 1, v8::N
one, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 887 {"voidMethodVoidExperimentalCallbackFunction", TestInterface5ImplementationV
8Internal::voidMethodVoidExperimentalCallbackFunctionMethodCallback, 0, 1, v8::N
one, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 985 {"voidMethodVoidCallbackFunctionModulesArg", TestInterface5ImplementationV8I
nternal::voidMethodVoidCallbackFunctionModulesArgMethodCallback, 0, 1, v8::None,
V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 888 {"voidMethodVoidCallbackFunctionModulesArg", TestInterface5ImplementationV8I
nternal::voidMethodVoidCallbackFunctionModulesArgMethodCallback, 0, 1, v8::None,
V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 986 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, v
8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp
e}, | 889 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, v
8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp
e}, |
| 987 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0,
0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProt
otype}, | 890 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0,
0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProt
otype}, |
| 988 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0
, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr
ototype}, | 891 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0
, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr
ototype}, |
| 989 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0
, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr
ototype}, | 892 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0
, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr
ototype}, |
| 990 {"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback,
0, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::Exp
osedToAllScripts, V8DOMConfiguration::OnPrototype}, | 893 {"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback,
0, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::Exp
osedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 991 }; | 894 }; |
| 992 | 895 |
| 993 static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp
erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) | 896 static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp
erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) { |
| 994 { | 897 // Initialize the interface object's template. |
| 995 // Initialize the interface object's template. | 898 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate,
V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTempl
ate(isolate, world), V8TestInterface5::internalFieldCount); |
| 996 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTem
plate(isolate, world), V8TestInterface5::internalFieldCount); | 899 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); |
| 997 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 900 ALLOW_UNUSED_LOCAL(signature); |
| 998 ALLOW_UNUSED_LOCAL(signature); | 901 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTe
mplate(); |
| 999 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); | 902 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 1000 ALLOW_UNUSED_LOCAL(instanceTemplate); | 903 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototype
Template(); |
| 1001 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); | 904 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 1002 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 905 // Register DOM constants, attributes and operations. |
| 1003 // Register DOM constants, attributes and operations. | 906 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
| 1004 if (RuntimeEnabledFeatures::featureNameEnabled()) { | 907 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[
] = { |
| 1005 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constant
s[] = { | 908 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}, |
| 1006 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong
}, | 909 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, |
| 1007 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, | 910 }; |
| 1008 }; | 911 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototype
Template, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants)
); |
| 1009 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototy
peTemplate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constant
s)); | 912 V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, pr
ototypeTemplate, V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5At
tributes)); |
| 1010 V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate,
prototypeTemplate, V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5
Attributes)); | 913 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, pro
totypeTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARR
AY_LENGTH(V8TestInterface5Accessors)); |
| 1011 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, p
rototypeTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_A
RRAY_LENGTH(V8TestInterface5Accessors)); | 914 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, proto
typeTemplate, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_L
ENGTH(V8TestInterface5Methods)); |
| 1012 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, pro
totypeTemplate, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY
_LENGTH(V8TestInterface5Methods)); | 915 } |
| 1013 } | |
| 1014 | 916 |
| 1015 // Indexed properties | 917 // Indexed properties |
| 1016 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInt
erface5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5Im
plementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5Implemen
tationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<Test
Interface5Implementation>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNo
ne); | 918 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInter
face5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5Impl
ementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5Implementa
tionV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestIn
terface5Implementation>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNone
); |
| 1017 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); | 919 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); |
| 1018 // Named properties | 920 // Named properties |
| 1019 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterfa
ce5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5Implemen
tationV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Int
ernal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::named
PropertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEn
umeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(
int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFl
ags::kNonMasking))); | 921 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterface
5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5Implementa
tionV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Inter
nal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::namedPr
opertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEnum
eratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(in
t(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFlag
s::kNonMasking))); |
| 1020 instanceTemplate->SetHandler(namedPropertyHandlerConfig); | 922 instanceTemplate->SetHandler(namedPropertyHandlerConfig); |
| 1021 | 923 |
| 1022 // Iterator (@@iterator) | 924 // Iterator (@@iterator) |
| 1023 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIterator
Configuration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Interna
l::iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::ExposedToAllScri
pts, V8DOMConfiguration::OnPrototype }; | 925 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo
nfiguration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Internal:
:iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::ExposedToAllScript
s, V8DOMConfiguration::OnPrototype }; |
| 1024 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signatu
re, symbolKeyedIteratorConfiguration); | 926 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature
, symbolKeyedIteratorConfiguration); |
| 1025 | 927 |
| 1026 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCusto
m); | 928 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom)
; |
| 1027 } | 929 } |
| 1028 | 930 |
| 1029 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola
te, const DOMWrapperWorld& world) | 931 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola
te, const DOMWrapperWorld& world) { |
| 1030 { | 932 return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<Wrapper
TypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template); |
| 1031 return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<Wrapp
erTypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template); | |
| 1032 } | 933 } |
| 1033 | 934 |
| 1034 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is
olate) | 935 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is
olate) { |
| 1035 { | 936 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value)
; |
| 1036 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | |
| 1037 } | 937 } |
| 1038 | 938 |
| 1039 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v
8::Value> v8Value, v8::Isolate* isolate) | 939 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v
8::Value> v8Value, v8::Isolate* isolate) { |
| 1040 { | 940 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperT
ypeInfo, v8Value); |
| 1041 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | |
| 1042 } | 941 } |
| 1043 | 942 |
| 1044 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Local<v8::Value> value) | 943 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Local<v8::Value> value) { |
| 1045 { | 944 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)
) : nullptr; |
| 1046 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | |
| 1047 } | 945 } |
| 1048 | 946 |
| 1049 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Local<v8::Context>
context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v
8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfac
eTemplate) | 947 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Local<v8::Context>
context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v
8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfac
eTemplate) { |
| 1050 { | 948 v8::Isolate* isolate = context->GetIsolate(); |
| 1051 v8::Isolate* isolate = context->GetIsolate(); | 949 ExecutionContext* executionContext = toExecutionContext(context); |
| 1052 ExecutionContext* executionContext = toExecutionContext(context); | 950 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); |
| 1053 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 951 if (executionContext && (executionContext->isWorkerGlobalScope())) { |
| 1054 if (executionContext && (executionContext->isWorkerGlobalScope())) { | 952 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"
workerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposedAt
tributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::workerEx
posedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::Pro
pertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfigu
ration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
| 1055 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
{"workerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposed
AttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::worker
ExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::P
ropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype, V8DOMConfiguration::CheckHolder}; | 953 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, accessorConfiguration); |
| 1056 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object
>(), prototypeObject, interfaceObject, signature, accessorConfiguration); | 954 } |
| 1057 } | 955 if (executionContext && (executionContext->isDocument())) { |
| 1058 if (executionContext && (executionContext->isDocument())) { | 956 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"
windowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposedAt
tributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::windowEx
posedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::Pro
pertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfigu
ration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
| 1059 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
{"windowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposed
AttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::window
ExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::P
ropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype, V8DOMConfiguration::CheckHolder}; | 957 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, accessorConfiguration); |
| 1060 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object
>(), prototypeObject, interfaceObject, signature, accessorConfiguration); | 958 } |
| 1061 } | 959 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); |
| 1062 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 960 ExecutionContext* executionContext = toExecutionContext(prototypeObject->Creat
ionContext()); |
| 1063 ExecutionContext* executionContext = toExecutionContext(prototypeObject->Cre
ationContext()); | 961 DCHECK(executionContext); |
| 1064 ASSERT(executionContext); | 962 if (executionContext && (executionContext->isWorkerGlobalScope())) { |
| 1065 if (executionContext && (executionContext->isWorkerGlobalScope())) { | 963 const V8DOMConfiguration::MethodConfiguration workerExposedMethodMethodCon
figuration = {"workerExposedMethod", TestInterface5ImplementationV8Internal::wor
kerExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAll
Scripts, V8DOMConfiguration::OnPrototype}; |
| 1066 const V8DOMConfiguration::MethodConfiguration workerExposedMethodMethodC
onfiguration = {"workerExposedMethod", TestInterface5ImplementationV8Internal::w
orkerExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToA
llScripts, V8DOMConfiguration::OnPrototype}; | 964 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, workerExposedMethodMethodConfigura
tion); |
| 1067 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, workerExposedMethodMethodConfigu
ration); | 965 } |
| 1068 } | 966 if (executionContext && (executionContext->isDocument())) { |
| 1069 if (executionContext && (executionContext->isDocument())) { | 967 const V8DOMConfiguration::MethodConfiguration windowExposedMethodMethodCon
figuration = {"windowExposedMethod", TestInterface5ImplementationV8Internal::win
dowExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAll
Scripts, V8DOMConfiguration::OnPrototype}; |
| 1070 const V8DOMConfiguration::MethodConfiguration windowExposedMethodMethodC
onfiguration = {"windowExposedMethod", TestInterface5ImplementationV8Internal::w
indowExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToA
llScripts, V8DOMConfiguration::OnPrototype}; | 968 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowExposedMethodMethodConfigura
tion); |
| 1071 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowExposedMethodMethodConfigu
ration); | 969 } |
| 1072 } | 970 if (executionContext && (executionContext->isWorkerGlobalScope())) { |
| 1073 if (executionContext && (executionContext->isWorkerGlobalScope())) { | 971 const V8DOMConfiguration::MethodConfiguration workerExposedStaticMethodMet
hodConfiguration = {"workerExposedStaticMethod", TestInterface5ImplementationV8I
nternal::workerExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigura
tion::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; |
| 1074 const V8DOMConfiguration::MethodConfiguration workerExposedStaticMethodM
ethodConfiguration = {"workerExposedStaticMethod", TestInterface5ImplementationV
8Internal::workerExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; | 972 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, workerExposedStaticMethodMethodCon
figuration); |
| 1075 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, workerExposedStaticMethodMethodC
onfiguration); | 973 } |
| 1076 } | 974 if (executionContext && (executionContext->isDocument())) { |
| 1077 if (executionContext && (executionContext->isDocument())) { | 975 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMet
hodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV8I
nternal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigura
tion::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; |
| 1078 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM
ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV
8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; | 976 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodCon
figuration); |
| 1079 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC
onfiguration); | 977 } |
| 1080 } | 978 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { |
| 1081 if (executionContext && (executionContext->isDocument() || executionContext-
>isServiceWorkerGlobalScope())) { | 979 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpose
dMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInterfa
ce5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback,
0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnP
rototype}; |
| 1082 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo
sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter
face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback
, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O
nPrototype}; | 980 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMetho
dMethodConfiguration); |
| 1083 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet
hodMethodConfiguration); | 981 } |
| 1084 } | |
| 1085 } | 982 } |
| 1086 | 983 |
| 1087 } // namespace blink | 984 } // namespace blink |
| OLD | NEW |