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