| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 decltype(&ScriptWrappable::hasPendingActivity)>::value, | 52 decltype(&ScriptWrappable::hasPendingActivity)>::value, |
| 53 "TestInterface5Implementation is not overriding hasPendingActivity(), but is
specifying " | 53 "TestInterface5Implementation is not overriding hasPendingActivity(), but is
specifying " |
| 54 "[ActiveScriptWrappable] extended attribute in the IDL file. " | 54 "[ActiveScriptWrappable] extended attribute in the IDL file. " |
| 55 "Be consistent."); | 55 "Be consistent."); |
| 56 | 56 |
| 57 namespace TestInterface5ImplementationV8Internal { | 57 namespace TestInterface5ImplementationV8Internal { |
| 58 | 58 |
| 59 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 59 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 60 { | 60 { |
| 61 v8::Local<v8::Object> holder = info.Holder(); | 61 v8::Local<v8::Object> holder = info.Holder(); |
| 62 |
| 62 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 63 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 64 |
| 63 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl
); | 65 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl
); |
| 64 } | 66 } |
| 65 | 67 |
| 66 void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 68 void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 67 { | 69 { |
| 68 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGette
r(info); | 70 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGette
r(info); |
| 69 } | 71 } |
| 70 | 72 |
| 71 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 73 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) |
| 72 { | 74 { |
| 73 v8::Local<v8::Object> holder = info.Holder(); | 75 v8::Local<v8::Object> holder = info.Holder(); |
| 74 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA
ttribute", "TestInterface5", holder, info.GetIsolate()); | |
| 75 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 76 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 77 |
| 78 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "testInterfaceAttribute"); |
| 79 |
| 80 // Prepare the value to be set. |
| 76 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeChe
ck(info.GetIsolate(), v8Value); | 81 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeChe
ck(info.GetIsolate(), v8Value); |
| 82 |
| 83 // Type check per: http://heycam.github.io/webidl/#es-interface |
| 77 if (!cppValue) { | 84 if (!cppValue) { |
| 78 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface5'."); | 85 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface5'."); |
| 79 return; | 86 return; |
| 80 } | 87 } |
| 88 |
| 81 impl->setTestInterfaceAttribute(cppValue); | 89 impl->setTestInterfaceAttribute(cppValue); |
| 82 } | 90 } |
| 83 | 91 |
| 84 void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 92 void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 85 { | 93 { |
| 86 v8::Local<v8::Value> v8Value = info[0]; | 94 v8::Local<v8::Value> v8Value = info[0]; |
| 95 |
| 87 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette
r(v8Value, info); | 96 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette
r(v8Value, info); |
| 88 } | 97 } |
| 89 | 98 |
| 90 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 99 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 91 { | 100 { |
| 92 v8::Local<v8::Object> holder = info.Holder(); | 101 v8::Local<v8::Object> holder = info.Holder(); |
| 102 |
| 93 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 103 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 104 |
| 94 v8SetReturnValue(info, impl->doubleAttribute()); | 105 v8SetReturnValue(info, impl->doubleAttribute()); |
| 95 } | 106 } |
| 96 | 107 |
| 97 void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 108 void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 98 { | 109 { |
| 99 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info)
; | 110 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info)
; |
| 100 } | 111 } |
| 101 | 112 |
| 102 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::FunctionCallbackInfo<v8::Value>& info) | 113 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::FunctionCallbackInfo<v8::Value>& info) |
| 103 { | 114 { |
| 104 v8::Local<v8::Object> holder = info.Holder(); | 115 v8::Local<v8::Object> holder = info.Holder(); |
| 105 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut
e", "TestInterface5", holder, info.GetIsolate()); | |
| 106 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 116 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 117 |
| 118 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "doubleAttribute"); |
| 119 |
| 120 // Prepare the value to be set. |
| 107 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionSt
ate); | 121 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionSt
ate); |
| 108 if (exceptionState.hadException()) | 122 if (exceptionState.hadException()) |
| 109 return; | 123 return; |
| 124 |
| 110 impl->setDoubleAttribute(cppValue); | 125 impl->setDoubleAttribute(cppValue); |
| 111 } | 126 } |
| 112 | 127 |
| 113 void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 128 void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 114 { | 129 { |
| 115 v8::Local<v8::Value> v8Value = info[0]; | 130 v8::Local<v8::Value> v8Value = info[0]; |
| 131 |
| 116 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Val
ue, info); | 132 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Val
ue, info); |
| 117 } | 133 } |
| 118 | 134 |
| 119 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 135 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 120 { | 136 { |
| 121 v8::Local<v8::Object> holder = info.Holder(); | 137 v8::Local<v8::Object> holder = info.Holder(); |
| 138 |
| 122 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 139 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 140 |
| 123 v8SetReturnValue(info, impl->floatAttribute()); | 141 v8SetReturnValue(info, impl->floatAttribute()); |
| 124 } | 142 } |
| 125 | 143 |
| 126 void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 144 void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 127 { | 145 { |
| 128 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); | 146 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); |
| 129 } | 147 } |
| 130 | 148 |
| 131 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
::FunctionCallbackInfo<v8::Value>& info) | 149 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
::FunctionCallbackInfo<v8::Value>& info) |
| 132 { | 150 { |
| 133 v8::Local<v8::Object> holder = info.Holder(); | 151 v8::Local<v8::Object> holder = info.Holder(); |
| 134 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute
", "TestInterface5", holder, info.GetIsolate()); | |
| 135 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 152 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 153 |
| 154 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "floatAttribute"); |
| 155 |
| 156 // Prepare the value to be set. |
| 136 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionStat
e); | 157 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionStat
e); |
| 137 if (exceptionState.hadException()) | 158 if (exceptionState.hadException()) |
| 138 return; | 159 return; |
| 160 |
| 139 impl->setFloatAttribute(cppValue); | 161 impl->setFloatAttribute(cppValue); |
| 140 } | 162 } |
| 141 | 163 |
| 142 void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 164 void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 143 { | 165 { |
| 144 v8::Local<v8::Value> v8Value = info[0]; | 166 v8::Local<v8::Value> v8Value = info[0]; |
| 167 |
| 145 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Valu
e, info); | 168 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Valu
e, info); |
| 146 } | 169 } |
| 147 | 170 |
| 148 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 171 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 149 { | 172 { |
| 150 v8::Local<v8::Object> holder = info.Holder(); | 173 v8::Local<v8::Object> holder = info.Holder(); |
| 174 |
| 151 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 175 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 176 |
| 152 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); | 177 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); |
| 153 } | 178 } |
| 154 | 179 |
| 155 void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 180 void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 156 { | 181 { |
| 157 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute
Getter(info); | 182 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute
Getter(info); |
| 158 } | 183 } |
| 159 | 184 |
| 160 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) | 185 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 161 { | 186 { |
| 162 v8::Local<v8::Object> holder = info.Holder(); | 187 v8::Local<v8::Object> holder = info.Holder(); |
| 163 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDo
ubleAttribute", "TestInterface5", holder, info.GetIsolate()); | |
| 164 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 188 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 189 |
| 190 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "unrestrictedDoubleAttribute"); |
| 191 |
| 192 // Prepare the value to be set. |
| 165 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); | 193 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); |
| 166 if (exceptionState.hadException()) | 194 if (exceptionState.hadException()) |
| 167 return; | 195 return; |
| 196 |
| 168 impl->setUnrestrictedDoubleAttribute(cppValue); | 197 impl->setUnrestrictedDoubleAttribute(cppValue); |
| 169 } | 198 } |
| 170 | 199 |
| 171 void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 200 void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 172 { | 201 { |
| 173 v8::Local<v8::Value> v8Value = info[0]; | 202 v8::Local<v8::Value> v8Value = info[0]; |
| 203 |
| 174 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute
Setter(v8Value, info); | 204 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute
Setter(v8Value, info); |
| 175 } | 205 } |
| 176 | 206 |
| 177 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback
Info<v8::Value>& info) | 207 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback
Info<v8::Value>& info) |
| 178 { | 208 { |
| 179 v8::Local<v8::Object> holder = info.Holder(); | 209 v8::Local<v8::Object> holder = info.Holder(); |
| 210 |
| 180 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 211 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 212 |
| 181 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); | 213 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); |
| 182 } | 214 } |
| 183 | 215 |
| 184 void unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 216 void unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 185 { | 217 { |
| 186 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeG
etter(info); | 218 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeG
etter(info); |
| 187 } | 219 } |
| 188 | 220 |
| 189 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::FunctionCallbackInfo<v8::Value>& info) | 221 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 190 { | 222 { |
| 191 v8::Local<v8::Object> holder = info.Holder(); | 223 v8::Local<v8::Object> holder = info.Holder(); |
| 192 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFl
oatAttribute", "TestInterface5", holder, info.GetIsolate()); | |
| 193 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 224 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 225 |
| 226 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "unrestrictedFloatAttribute"); |
| 227 |
| 228 // Prepare the value to be set. |
| 194 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); | 229 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); |
| 195 if (exceptionState.hadException()) | 230 if (exceptionState.hadException()) |
| 196 return; | 231 return; |
| 232 |
| 197 impl->setUnrestrictedFloatAttribute(cppValue); | 233 impl->setUnrestrictedFloatAttribute(cppValue); |
| 198 } | 234 } |
| 199 | 235 |
| 200 void unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 236 void unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 201 { | 237 { |
| 202 v8::Local<v8::Value> v8Value = info[0]; | 238 v8::Local<v8::Value> v8Value = info[0]; |
| 239 |
| 203 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeS
etter(v8Value, info); | 240 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeS
etter(v8Value, info); |
| 204 } | 241 } |
| 205 | 242 |
| 206 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) | 243 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 207 { | 244 { |
| 208 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttri
bute(), info.GetIsolate()); | 245 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttri
bute(), info.GetIsolate()); |
| 209 } | 246 } |
| 210 | 247 |
| 211 void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 248 void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 212 { | 249 { |
| 213 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter
(info); | 250 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter
(info); |
| 214 } | 251 } |
| 215 | 252 |
| 216 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) | 253 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) |
| 217 { | 254 { |
| 255 // Prepare the value to be set. |
| 218 V8StringResource<> cppValue = v8Value; | 256 V8StringResource<> cppValue = v8Value; |
| 219 if (!cppValue.prepare()) | 257 if (!cppValue.prepare()) |
| 220 return; | 258 return; |
| 259 |
| 221 TestInterface5Implementation::setStaticStringAttribute(cppValue); | 260 TestInterface5Implementation::setStaticStringAttribute(cppValue); |
| 222 } | 261 } |
| 223 | 262 |
| 224 void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 263 void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 225 { | 264 { |
| 226 v8::Local<v8::Value> v8Value = info[0]; | 265 v8::Local<v8::Value> v8Value = info[0]; |
| 266 |
| 227 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter
(v8Value, info); | 267 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter
(v8Value, info); |
| 228 } | 268 } |
| 229 | 269 |
| 230 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 270 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 231 { | 271 { |
| 232 v8::Local<v8::Object> holder = info.Holder(); | 272 v8::Local<v8::Object> holder = info.Holder(); |
| 273 |
| 233 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 274 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 275 |
| 234 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); | 276 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); |
| 235 } | 277 } |
| 236 | 278 |
| 237 void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 279 void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 238 { | 280 { |
| 239 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGette
r(info); | 281 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGette
r(info); |
| 240 } | 282 } |
| 241 | 283 |
| 242 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 284 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) |
| 243 { | 285 { |
| 244 v8::Local<v8::Object> holder = info.Holder(); | 286 v8::Local<v8::Object> holder = info.Holder(); |
| 245 ExceptionState exceptionState(ExceptionState::SetterContext, "alwaysExposedA
ttribute", "TestInterface5", holder, info.GetIsolate()); | |
| 246 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 287 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 288 |
| 289 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "alwaysExposedAttribute"); |
| 290 |
| 291 // Prepare the value to be set. |
| 247 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 292 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 248 if (exceptionState.hadException()) | 293 if (exceptionState.hadException()) |
| 249 return; | 294 return; |
| 295 |
| 250 impl->setAlwaysExposedAttribute(cppValue); | 296 impl->setAlwaysExposedAttribute(cppValue); |
| 251 } | 297 } |
| 252 | 298 |
| 253 void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 299 void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 254 { | 300 { |
| 255 v8::Local<v8::Value> v8Value = info[0]; | 301 v8::Local<v8::Value> v8Value = info[0]; |
| 302 |
| 256 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSette
r(v8Value, info); | 303 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSette
r(v8Value, info); |
| 257 } | 304 } |
| 258 | 305 |
| 259 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 306 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 260 { | 307 { |
| 261 v8::Local<v8::Object> holder = info.Holder(); | 308 v8::Local<v8::Object> holder = info.Holder(); |
| 309 |
| 262 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 310 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 311 |
| 263 v8SetReturnValueInt(info, impl->workerExposedAttribute()); | 312 v8SetReturnValueInt(info, impl->workerExposedAttribute()); |
| 264 } | 313 } |
| 265 | 314 |
| 266 void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 315 void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 267 { | 316 { |
| 268 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGette
r(info); | 317 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGette
r(info); |
| 269 } | 318 } |
| 270 | 319 |
| 271 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 320 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) |
| 272 { | 321 { |
| 273 v8::Local<v8::Object> holder = info.Holder(); | 322 v8::Local<v8::Object> holder = info.Holder(); |
| 274 ExceptionState exceptionState(ExceptionState::SetterContext, "workerExposedA
ttribute", "TestInterface5", holder, info.GetIsolate()); | |
| 275 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 323 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 324 |
| 325 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "workerExposedAttribute"); |
| 326 |
| 327 // Prepare the value to be set. |
| 276 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 328 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 277 if (exceptionState.hadException()) | 329 if (exceptionState.hadException()) |
| 278 return; | 330 return; |
| 331 |
| 279 impl->setWorkerExposedAttribute(cppValue); | 332 impl->setWorkerExposedAttribute(cppValue); |
| 280 } | 333 } |
| 281 | 334 |
| 282 void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 335 void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 283 { | 336 { |
| 284 v8::Local<v8::Value> v8Value = info[0]; | 337 v8::Local<v8::Value> v8Value = info[0]; |
| 338 |
| 285 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSette
r(v8Value, info); | 339 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSette
r(v8Value, info); |
| 286 } | 340 } |
| 287 | 341 |
| 288 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 342 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 289 { | 343 { |
| 290 v8::Local<v8::Object> holder = info.Holder(); | 344 v8::Local<v8::Object> holder = info.Holder(); |
| 345 |
| 291 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 346 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 347 |
| 292 v8SetReturnValueInt(info, impl->windowExposedAttribute()); | 348 v8SetReturnValueInt(info, impl->windowExposedAttribute()); |
| 293 } | 349 } |
| 294 | 350 |
| 295 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 351 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 296 { | 352 { |
| 297 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGette
r(info); | 353 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGette
r(info); |
| 298 } | 354 } |
| 299 | 355 |
| 300 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | 356 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) |
| 301 { | 357 { |
| 302 v8::Local<v8::Object> holder = info.Holder(); | 358 v8::Local<v8::Object> holder = info.Holder(); |
| 303 ExceptionState exceptionState(ExceptionState::SetterContext, "windowExposedA
ttribute", "TestInterface5", holder, info.GetIsolate()); | |
| 304 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 359 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 360 |
| 361 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "windowExposedAttribute"); |
| 362 |
| 363 // Prepare the value to be set. |
| 305 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 364 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 306 if (exceptionState.hadException()) | 365 if (exceptionState.hadException()) |
| 307 return; | 366 return; |
| 367 |
| 308 impl->setWindowExposedAttribute(cppValue); | 368 impl->setWindowExposedAttribute(cppValue); |
| 309 } | 369 } |
| 310 | 370 |
| 311 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 371 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 312 { | 372 { |
| 313 v8::Local<v8::Value> v8Value = info[0]; | 373 v8::Local<v8::Value> v8Value = info[0]; |
| 374 |
| 314 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette
r(v8Value, info); | 375 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette
r(v8Value, info); |
| 315 } | 376 } |
| 316 | 377 |
| 317 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) | 378 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 318 { | 379 { |
| 319 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 380 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 320 | 381 |
| 321 if (UNLIKELY(info.Length() < 1)) { | 382 if (UNLIKELY(info.Length() < 1)) { |
| 322 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMes
sages::notEnoughArguments(1, info.Length()))); | 383 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMes
sages::notEnoughArguments(1, info.Length()))); |
| 323 return; | 384 return; |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM
ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV
8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; | 1025 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM
ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV
8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; |
| 965 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC
onfiguration); | 1026 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC
onfiguration); |
| 966 } | 1027 } |
| 967 if (executionContext && (executionContext->isDocument() || executionContext-
>isServiceWorkerGlobalScope())) { | 1028 if (executionContext && (executionContext->isDocument() || executionContext-
>isServiceWorkerGlobalScope())) { |
| 968 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo
sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter
face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback
, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O
nPrototype}; | 1029 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo
sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter
face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback
, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O
nPrototype}; |
| 969 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet
hodMethodConfiguration); | 1030 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet
hodMethodConfiguration); |
| 970 } | 1031 } |
| 971 } | 1032 } |
| 972 | 1033 |
| 973 } // namespace blink | 1034 } // namespace blink |
| OLD | NEW |