| 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 } | |
| 342 | |
| 343 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | |
| 344 { | |
| 345 v8::Local<v8::Object> holder = info.Holder(); | |
| 346 | |
| 347 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | |
| 348 | |
| 349 v8SetReturnValueInt(info, impl->windowExposedAttribute()); | |
| 350 } | |
| 351 | |
| 352 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | |
| 353 { | |
| 354 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGette
r(info); | |
| 355 } | |
| 356 | |
| 357 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 358 { | |
| 359 v8::Local<v8::Object> holder = info.Holder(); | |
| 360 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | |
| 361 | |
| 362 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterConte
xt, "TestInterface5", "windowExposedAttribute"); | |
| 363 | |
| 364 // Prepare the value to be set. | |
| 365 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | |
| 366 if (exceptionState.hadException()) | |
| 367 return; | |
| 368 | |
| 369 impl->setWindowExposedAttribute(cppValue); | |
| 370 } | |
| 371 | |
| 372 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | |
| 373 { | |
| 374 v8::Local<v8::Value> v8Value = info[0]; | |
| 375 | |
| 376 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette
r(v8Value, info); | |
| 377 } | 341 } |
| 378 | 342 |
| 379 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 343 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 380 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 344 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 381 | 345 |
| 382 if (UNLIKELY(info.Length() < 1)) { | 346 if (UNLIKELY(info.Length() < 1)) { |
| 383 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage
s::notEnoughArguments(1, info.Length()))); | 347 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage
s::notEnoughArguments(1, info.Length()))); |
| 384 return; | 348 return; |
| 385 } | 349 } |
| 386 | 350 |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMet
hodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV8I
nternal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigura
tion::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; | 975 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMet
hodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV8I
nternal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigura
tion::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; |
| 1012 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodCon
figuration); | 976 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodCon
figuration); |
| 1013 } | 977 } |
| 1014 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { | 978 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { |
| 1015 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpose
dMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInterfa
ce5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback,
0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnP
rototype}; | 979 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpose
dMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInterfa
ce5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback,
0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnP
rototype}; |
| 1016 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMetho
dMethodConfiguration); | 980 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMetho
dMethodConfiguration); |
| 1017 } | 981 } |
| 1018 } | 982 } |
| 1019 | 983 |
| 1020 } // namespace blink | 984 } // namespace blink |
| OLD | NEW |