| 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. | 5 // This file has been auto-generated by code_generator_v8.py. |
| 6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
| 7 | 7 |
| 8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 namespace TestInterface5ImplementationV8Internal { | 62 namespace TestInterface5ImplementationV8Internal { |
| 63 | 63 |
| 64 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 64 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 65 v8::Local<v8::Object> holder = info.Holder(); | 65 v8::Local<v8::Object> holder = info.Holder(); |
| 66 | 66 |
| 67 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 67 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 68 | 68 |
| 69 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); | 69 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 72 MODULES_EXPORT void testInterfaceAttributeAttributeGetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 73 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter(
info); | 73 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter(
info); |
| 74 } | 74 } |
| 75 | 75 |
| 76 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { | 76 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 77 v8::Local<v8::Object> holder = info.Holder(); | 77 v8::Local<v8::Object> holder = info.Holder(); |
| 78 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 78 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 79 | 79 |
| 80 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "testInterfaceAttribute"); | 80 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "testInterfaceAttribute"); |
| 81 | 81 |
| 82 // Prepare the value to be set. | 82 // Prepare the value to be set. |
| 83 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeCheck
(info.GetIsolate(), v8Value); | 83 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeCheck
(info.GetIsolate(), v8Value); |
| 84 | 84 |
| 85 // Type check per: http://heycam.github.io/webidl/#es-interface | 85 // Type check per: http://heycam.github.io/webidl/#es-interface |
| 86 if (!cppValue) { | 86 if (!cppValue) { |
| 87 exceptionState.throwTypeError("The provided value is not of type 'TestInterf
ace5'."); | 87 exceptionState.throwTypeError("The provided value is not of type 'TestInterf
ace5'."); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 impl->setTestInterfaceAttribute(cppValue); | 91 impl->setTestInterfaceAttribute(cppValue); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 94 MODULES_EXPORT void testInterfaceAttributeAttributeSetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 95 v8::Local<v8::Value> v8Value = info[0]; | 95 v8::Local<v8::Value> v8Value = info[0]; |
| 96 | 96 |
| 97 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter(
v8Value, info); | 97 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter(
v8Value, info); |
| 98 } | 98 } |
| 99 | 99 |
| 100 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { | 100 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { |
| 101 v8::Local<v8::Object> holder = info.Holder(); | 101 v8::Local<v8::Object> holder = info.Holder(); |
| 102 | 102 |
| 103 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 103 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 104 | 104 |
| 105 v8SetReturnValue(info, impl->doubleAttribute()); | 105 v8SetReturnValue(info, impl->doubleAttribute()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { | 108 MODULES_EXPORT void doubleAttributeAttributeGetterCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) { |
| 109 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info); | 109 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info); |
| 110 } | 110 } |
| 111 | 111 |
| 112 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) { |
| 113 v8::Local<v8::Object> holder = info.Holder(); | 113 v8::Local<v8::Object> holder = info.Holder(); |
| 114 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 114 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 115 | 115 |
| 116 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "doubleAttribute"); | 116 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "doubleAttribute"); |
| 117 | 117 |
| 118 // Prepare the value to be set. | 118 // Prepare the value to be set. |
| 119 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionStat
e); | 119 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionStat
e); |
| 120 if (exceptionState.hadException()) | 120 if (exceptionState.hadException()) |
| 121 return; | 121 return; |
| 122 | 122 |
| 123 impl->setDoubleAttribute(cppValue); | 123 impl->setDoubleAttribute(cppValue); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { | 126 MODULES_EXPORT void doubleAttributeAttributeSetterCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) { |
| 127 v8::Local<v8::Value> v8Value = info[0]; | 127 v8::Local<v8::Value> v8Value = info[0]; |
| 128 | 128 |
| 129 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value
, info); | 129 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value
, info); |
| 130 } | 130 } |
| 131 | 131 |
| 132 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { | 132 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { |
| 133 v8::Local<v8::Object> holder = info.Holder(); | 133 v8::Local<v8::Object> holder = info.Holder(); |
| 134 | 134 |
| 135 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 135 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 136 | 136 |
| 137 v8SetReturnValue(info, impl->floatAttribute()); | 137 v8SetReturnValue(info, impl->floatAttribute()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { | 140 MODULES_EXPORT void floatAttributeAttributeGetterCallback(const v8::FunctionCall
backInfo<v8::Value>& info) { |
| 141 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); | 141 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); |
| 142 } | 142 } |
| 143 | 143 |
| 144 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
::FunctionCallbackInfo<v8::Value>& info) { | 144 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
::FunctionCallbackInfo<v8::Value>& info) { |
| 145 v8::Local<v8::Object> holder = info.Holder(); | 145 v8::Local<v8::Object> holder = info.Holder(); |
| 146 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 146 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 147 | 147 |
| 148 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "floatAttribute"); | 148 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "floatAttribute"); |
| 149 | 149 |
| 150 // Prepare the value to be set. | 150 // Prepare the value to be set. |
| 151 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState)
; | 151 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState)
; |
| 152 if (exceptionState.hadException()) | 152 if (exceptionState.hadException()) |
| 153 return; | 153 return; |
| 154 | 154 |
| 155 impl->setFloatAttribute(cppValue); | 155 impl->setFloatAttribute(cppValue); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { | 158 MODULES_EXPORT void floatAttributeAttributeSetterCallback(const v8::FunctionCall
backInfo<v8::Value>& info) { |
| 159 v8::Local<v8::Value> v8Value = info[0]; | 159 v8::Local<v8::Value> v8Value = info[0]; |
| 160 | 160 |
| 161 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value,
info); | 161 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value,
info); |
| 162 } | 162 } |
| 163 | 163 |
| 164 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) { | 164 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 165 v8::Local<v8::Object> holder = info.Holder(); | 165 v8::Local<v8::Object> holder = info.Holder(); |
| 166 | 166 |
| 167 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 167 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 168 | 168 |
| 169 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); | 169 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) { | 172 MODULES_EXPORT void unrestrictedDoubleAttributeAttributeGetterCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) { |
| 173 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGe
tter(info); | 173 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGe
tter(info); |
| 174 } | 174 } |
| 175 | 175 |
| 176 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) { | 176 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 177 v8::Local<v8::Object> holder = info.Holder(); | 177 v8::Local<v8::Object> holder = info.Holder(); |
| 178 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 178 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 179 | 179 |
| 180 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "unrestrictedDoubleAttribute"); | 180 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "unrestrictedDoubleAttribute"); |
| 181 | 181 |
| 182 // Prepare the value to be set. | 182 // Prepare the value to be set. |
| 183 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); | 183 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); |
| 184 if (exceptionState.hadException()) | 184 if (exceptionState.hadException()) |
| 185 return; | 185 return; |
| 186 | 186 |
| 187 impl->setUnrestrictedDoubleAttribute(cppValue); | 187 impl->setUnrestrictedDoubleAttribute(cppValue); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) { | 190 MODULES_EXPORT void unrestrictedDoubleAttributeAttributeSetterCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) { |
| 191 v8::Local<v8::Value> v8Value = info[0]; | 191 v8::Local<v8::Value> v8Value = info[0]; |
| 192 | 192 |
| 193 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSe
tter(v8Value, info); | 193 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSe
tter(v8Value, info); |
| 194 } | 194 } |
| 195 | 195 |
| 196 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback
Info<v8::Value>& info) { | 196 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback
Info<v8::Value>& info) { |
| 197 v8::Local<v8::Object> holder = info.Holder(); | 197 v8::Local<v8::Object> holder = info.Holder(); |
| 198 | 198 |
| 199 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 199 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 200 | 200 |
| 201 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); | 201 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { | 204 MODULES_EXPORT void unrestrictedFloatAttributeAttributeGetterCallback(const v8::
FunctionCallbackInfo<v8::Value>& info) { |
| 205 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGet
ter(info); | 205 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGet
ter(info); |
| 206 } | 206 } |
| 207 | 207 |
| 208 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::FunctionCallbackInfo<v8::Value>& info) { | 208 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 209 v8::Local<v8::Object> holder = info.Holder(); | 209 v8::Local<v8::Object> holder = info.Holder(); |
| 210 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 210 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 211 | 211 |
| 212 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "unrestrictedFloatAttribute"); | 212 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "unrestrictedFloatAttribute"); |
| 213 | 213 |
| 214 // Prepare the value to be set. | 214 // Prepare the value to be set. |
| 215 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); | 215 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); |
| 216 if (exceptionState.hadException()) | 216 if (exceptionState.hadException()) |
| 217 return; | 217 return; |
| 218 | 218 |
| 219 impl->setUnrestrictedFloatAttribute(cppValue); | 219 impl->setUnrestrictedFloatAttribute(cppValue); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { | 222 MODULES_EXPORT void unrestrictedFloatAttributeAttributeSetterCallback(const v8::
FunctionCallbackInfo<v8::Value>& info) { |
| 223 v8::Local<v8::Value> v8Value = info[0]; | 223 v8::Local<v8::Value> v8Value = info[0]; |
| 224 | 224 |
| 225 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSet
ter(v8Value, info); | 225 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSet
ter(v8Value, info); |
| 226 } | 226 } |
| 227 | 227 |
| 228 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) { | 228 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) { |
| 229 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribu
te(), info.GetIsolate()); | 229 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribu
te(), info.GetIsolate()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 232 MODULES_EXPORT void staticStringAttributeAttributeGetterCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) { |
| 233 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i
nfo); | 233 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i
nfo); |
| 234 } | 234 } |
| 235 | 235 |
| 236 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) { | 236 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) { |
| 237 // Prepare the value to be set. | 237 // Prepare the value to be set. |
| 238 V8StringResource<> cppValue = v8Value; | 238 V8StringResource<> cppValue = v8Value; |
| 239 if (!cppValue.prepare()) | 239 if (!cppValue.prepare()) |
| 240 return; | 240 return; |
| 241 | 241 |
| 242 TestInterface5Implementation::setStaticStringAttribute(cppValue); | 242 TestInterface5Implementation::setStaticStringAttribute(cppValue); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 245 MODULES_EXPORT void staticStringAttributeAttributeSetterCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) { |
| 246 v8::Local<v8::Value> v8Value = info[0]; | 246 v8::Local<v8::Value> v8Value = info[0]; |
| 247 | 247 |
| 248 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v
8Value, info); | 248 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v
8Value, info); |
| 249 } | 249 } |
| 250 | 250 |
| 251 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 251 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 252 v8::Local<v8::Object> holder = info.Holder(); | 252 v8::Local<v8::Object> holder = info.Holder(); |
| 253 | 253 |
| 254 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 254 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 255 | 255 |
| 256 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); | 256 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 259 MODULES_EXPORT void alwaysExposedAttributeAttributeGetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 260 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(
info); | 260 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(
info); |
| 261 } | 261 } |
| 262 | 262 |
| 263 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { | 263 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 264 v8::Local<v8::Object> holder = info.Holder(); | 264 v8::Local<v8::Object> holder = info.Holder(); |
| 265 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 265 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 266 | 266 |
| 267 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "alwaysExposedAttribute"); | 267 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "alwaysExposedAttribute"); |
| 268 | 268 |
| 269 // Prepare the value to be set. | 269 // Prepare the value to be set. |
| 270 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); | 270 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); |
| 271 if (exceptionState.hadException()) | 271 if (exceptionState.hadException()) |
| 272 return; | 272 return; |
| 273 | 273 |
| 274 impl->setAlwaysExposedAttribute(cppValue); | 274 impl->setAlwaysExposedAttribute(cppValue); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 277 MODULES_EXPORT void alwaysExposedAttributeAttributeSetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 278 v8::Local<v8::Value> v8Value = info[0]; | 278 v8::Local<v8::Value> v8Value = info[0]; |
| 279 | 279 |
| 280 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(
v8Value, info); | 280 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(
v8Value, info); |
| 281 } | 281 } |
| 282 | 282 |
| 283 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 283 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 284 v8::Local<v8::Object> holder = info.Holder(); | 284 v8::Local<v8::Object> holder = info.Holder(); |
| 285 | 285 |
| 286 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 286 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 287 | 287 |
| 288 v8SetReturnValueInt(info, impl->workerExposedAttribute()); | 288 v8SetReturnValueInt(info, impl->workerExposedAttribute()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 291 MODULES_EXPORT void workerExposedAttributeAttributeGetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 292 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter(
info); | 292 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter(
info); |
| 293 } | 293 } |
| 294 | 294 |
| 295 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { | 295 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 296 v8::Local<v8::Object> holder = info.Holder(); | 296 v8::Local<v8::Object> holder = info.Holder(); |
| 297 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 297 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 298 | 298 |
| 299 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "workerExposedAttribute"); | 299 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "workerExposedAttribute"); |
| 300 | 300 |
| 301 // Prepare the value to be set. | 301 // Prepare the value to be set. |
| 302 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); | 302 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); |
| 303 if (exceptionState.hadException()) | 303 if (exceptionState.hadException()) |
| 304 return; | 304 return; |
| 305 | 305 |
| 306 impl->setWorkerExposedAttribute(cppValue); | 306 impl->setWorkerExposedAttribute(cppValue); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 309 MODULES_EXPORT void workerExposedAttributeAttributeSetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 310 v8::Local<v8::Value> v8Value = info[0]; | 310 v8::Local<v8::Value> v8Value = info[0]; |
| 311 | 311 |
| 312 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter(
v8Value, info); | 312 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter(
v8Value, info); |
| 313 } | 313 } |
| 314 | 314 |
| 315 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 315 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 316 v8::Local<v8::Object> holder = info.Holder(); | 316 v8::Local<v8::Object> holder = info.Holder(); |
| 317 | 317 |
| 318 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 318 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 319 | 319 |
| 320 v8SetReturnValueInt(info, impl->windowExposedAttribute()); | 320 v8SetReturnValueInt(info, impl->windowExposedAttribute()); |
| 321 } | 321 } |
| 322 | 322 |
| 323 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 323 MODULES_EXPORT void windowExposedAttributeAttributeGetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 324 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter(
info); | 324 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter(
info); |
| 325 } | 325 } |
| 326 | 326 |
| 327 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { | 327 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 328 v8::Local<v8::Object> holder = info.Holder(); | 328 v8::Local<v8::Object> holder = info.Holder(); |
| 329 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 329 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 330 | 330 |
| 331 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "windowExposedAttribute"); | 331 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "TestInterface5", "windowExposedAttribute"); |
| 332 | 332 |
| 333 // Prepare the value to be set. | 333 // Prepare the value to be set. |
| 334 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); | 334 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception
State); |
| 335 if (exceptionState.hadException()) | 335 if (exceptionState.hadException()) |
| 336 return; | 336 return; |
| 337 | 337 |
| 338 impl->setWindowExposedAttribute(cppValue); | 338 impl->setWindowExposedAttribute(cppValue); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 341 MODULES_EXPORT void windowExposedAttributeAttributeSetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 342 v8::Local<v8::Value> v8Value = info[0]; | 342 v8::Local<v8::Value> v8Value = info[0]; |
| 343 | 343 |
| 344 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter(
v8Value, info); | 344 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter(
v8Value, info); |
| 345 } | 345 } |
| 346 | 346 |
| 347 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 347 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 348 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 348 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 349 | 349 |
| 350 if (UNLIKELY(info.Length() < 1)) { | 350 if (UNLIKELY(info.Length() < 1)) { |
| 351 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage
s::notEnoughArguments(1, info.Length()))); | 351 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage
s::notEnoughArguments(1, info.Length()))); |
| 352 return; | 352 return; |
| 353 } | 353 } |
| 354 | 354 |
| 355 TestInterfaceEmpty* testInterfaceEmptyArg; | 355 TestInterfaceEmpty* testInterfaceEmptyArg; |
| 356 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsol
ate(), info[0]); | 356 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsol
ate(), info[0]); |
| 357 if (!testInterfaceEmptyArg) { | 357 if (!testInterfaceEmptyArg) { |
| 358 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is
not of type 'TestInterfaceEmpty'.")); | 358 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is
not of type 'TestInterfaceEmpty'.")); |
| 359 | 359 |
| 360 return; | 360 return; |
| 361 } | 361 } |
| 362 | 362 |
| 363 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); | 363 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 366 MODULES_EXPORT void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) { |
| 367 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(
info); | 367 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(
info); |
| 368 } | 368 } |
| 369 | 369 |
| 370 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) { | 370 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) { |
| 371 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodDoubleArgFloatArg"); | 371 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodDoubleArgFloatArg"); |
| 372 | 372 |
| 373 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 373 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 374 | 374 |
| 375 if (UNLIKELY(info.Length() < 2)) { | 375 if (UNLIKELY(info.Length() < 2)) { |
| 376 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.
Length())); | 376 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.
Length())); |
| 377 return; | 377 return; |
| 378 } | 378 } |
| 379 | 379 |
| 380 double doubleArg; | 380 double doubleArg; |
| 381 float floatArg; | 381 float floatArg; |
| 382 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); | 382 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
| 383 if (exceptionState.hadException()) | 383 if (exceptionState.hadException()) |
| 384 return; | 384 return; |
| 385 | 385 |
| 386 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); | 386 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); |
| 387 if (exceptionState.hadException()) | 387 if (exceptionState.hadException()) |
| 388 return; | 388 return; |
| 389 | 389 |
| 390 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); | 390 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) { | 393 MODULES_EXPORT void voidMethodDoubleArgFloatArgMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) { |
| 394 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info
); | 394 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info
); |
| 395 } | 395 } |
| 396 | 396 |
| 397 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
FunctionCallbackInfo<v8::Value>& info) { | 397 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
FunctionCallbackInfo<v8::Value>& info) { |
| 398 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); | 398 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); |
| 399 | 399 |
| 400 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 400 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 401 | 401 |
| 402 if (UNLIKELY(info.Length() < 2)) { | 402 if (UNLIKELY(info.Length() < 2)) { |
| 403 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.
Length())); | 403 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.
Length())); |
| 404 return; | 404 return; |
| 405 } | 405 } |
| 406 | 406 |
| 407 double unrestrictedDoubleArg; | 407 double unrestrictedDoubleArg; |
| 408 float unrestrictedFloatArg; | 408 float unrestrictedFloatArg; |
| 409 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState); | 409 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState); |
| 410 if (exceptionState.hadException()) | 410 if (exceptionState.hadException()) |
| 411 return; | 411 return; |
| 412 | 412 |
| 413 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); | 413 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); |
| 414 if (exceptionState.hadException()) | 414 if (exceptionState.hadException()) |
| 415 return; | 415 return; |
| 416 | 416 |
| 417 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleAr
g, unrestrictedFloatArg); | 417 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleAr
g, unrestrictedFloatArg); |
| 418 } | 418 } |
| 419 | 419 |
| 420 void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) { | 420 MODULES_EXPORT void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCa
llback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 421 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestr
ictedFloatArgMethod(info); | 421 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestr
ictedFloatArgMethod(info); |
| 422 } | 422 } |
| 423 | 423 |
| 424 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 424 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 425 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 425 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 426 | 426 |
| 427 impl->voidMethod(); | 427 impl->voidMethod(); |
| 428 } | 428 } |
| 429 | 429 |
| 430 void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 430 MODULES_EXPORT void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) { |
| 431 TestInterface5ImplementationV8Internal::voidMethodMethod(info); | 431 TestInterface5ImplementationV8Internal::voidMethodMethod(info); |
| 432 } | 432 } |
| 433 | 433 |
| 434 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) { | 434 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) { |
| 435 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 435 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 436 | 436 |
| 437 impl->voidMethod(); | 437 impl->voidMethod(); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { | 440 MODULES_EXPORT void voidMethodMethodCallbackForMainWorld(const v8::FunctionCall
backInfo<v8::Value>& info) { |
| 441 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); | 441 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); |
| 442 } | 442 } |
| 443 | 443 |
| 444 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { | 444 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { |
| 445 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 445 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 446 | 446 |
| 447 impl->alwaysExposedMethod(); | 447 impl->alwaysExposedMethod(); |
| 448 } | 448 } |
| 449 | 449 |
| 450 void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { | 450 MODULES_EXPORT void alwaysExposedMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 451 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); | 451 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); |
| 452 } | 452 } |
| 453 | 453 |
| 454 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { | 454 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { |
| 455 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 455 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 456 | 456 |
| 457 impl->workerExposedMethod(); | 457 impl->workerExposedMethod(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { | 460 MODULES_EXPORT void workerExposedMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 461 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); | 461 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); |
| 462 } | 462 } |
| 463 | 463 |
| 464 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { | 464 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) { |
| 465 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 465 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 466 | 466 |
| 467 impl->windowExposedMethod(); | 467 impl->windowExposedMethod(); |
| 468 } | 468 } |
| 469 | 469 |
| 470 void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { | 470 MODULES_EXPORT void windowExposedMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { |
| 471 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); | 471 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); |
| 472 } | 472 } |
| 473 | 473 |
| 474 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { | 474 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 475 TestInterface5Implementation::alwaysExposedStaticMethod(); | 475 TestInterface5Implementation::alwaysExposedStaticMethod(); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { | 478 MODULES_EXPORT void alwaysExposedStaticMethodMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) { |
| 479 TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info); | 479 TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info); |
| 480 } | 480 } |
| 481 | 481 |
| 482 static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { | 482 static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 483 TestInterface5Implementation::workerExposedStaticMethod(); | 483 TestInterface5Implementation::workerExposedStaticMethod(); |
| 484 } | 484 } |
| 485 | 485 |
| 486 void workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { | 486 MODULES_EXPORT void workerExposedStaticMethodMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) { |
| 487 TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info); | 487 TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info); |
| 488 } | 488 } |
| 489 | 489 |
| 490 static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { | 490 static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 491 TestInterface5Implementation::windowExposedStaticMethod(); | 491 TestInterface5Implementation::windowExposedStaticMethod(); |
| 492 } | 492 } |
| 493 | 493 |
| 494 void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { | 494 MODULES_EXPORT void windowExposedStaticMethodMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) { |
| 495 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info); | 495 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info); |
| 496 } | 496 } |
| 497 | 497 |
| 498 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) { | 498 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) { |
| 499 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 499 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 500 | 500 |
| 501 impl->windowAndServiceWorkerExposedMethod(); | 501 impl->windowAndServiceWorkerExposedMethod(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 void windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) { | 504 MODULES_EXPORT void windowAndServiceWorkerExposedMethodMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) { |
| 505 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMet
hod(info); | 505 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMet
hod(info); |
| 506 } | 506 } |
| 507 | 507 |
| 508 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 508 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 509 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodBooleanOrDOMStringArg"); | 509 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodBooleanOrDOMStringArg"); |
| 510 | 510 |
| 511 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 511 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 512 | 512 |
| 513 if (UNLIKELY(info.Length() < 1)) { | 513 if (UNLIKELY(info.Length() < 1)) { |
| 514 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); | 514 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); |
| 515 return; | 515 return; |
| 516 } | 516 } |
| 517 | 517 |
| 518 BooleanOrString arg; | 518 BooleanOrString arg; |
| 519 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversion
Mode::NotNullable, exceptionState); | 519 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversion
Mode::NotNullable, exceptionState); |
| 520 if (exceptionState.hadException()) | 520 if (exceptionState.hadException()) |
| 521 return; | 521 return; |
| 522 | 522 |
| 523 impl->voidMethodBooleanOrDOMStringArg(arg); | 523 impl->voidMethodBooleanOrDOMStringArg(arg); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) { | 526 MODULES_EXPORT void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) { |
| 527 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMethod(
info); | 527 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMethod(
info); |
| 528 } | 528 } |
| 529 | 529 |
| 530 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) { | 530 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) { |
| 531 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodDoubleOrDOMStringArg"); | 531 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "voidMethodDoubleOrDOMStringArg"); |
| 532 | 532 |
| 533 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 533 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 534 | 534 |
| 535 if (UNLIKELY(info.Length() < 1)) { | 535 if (UNLIKELY(info.Length() < 1)) { |
| 536 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); | 536 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); |
| 537 return; | 537 return; |
| 538 } | 538 } |
| 539 | 539 |
| 540 DoubleOrString arg; | 540 DoubleOrString arg; |
| 541 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionM
ode::NotNullable, exceptionState); | 541 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionM
ode::NotNullable, exceptionState); |
| 542 if (exceptionState.hadException()) | 542 if (exceptionState.hadException()) |
| 543 return; | 543 return; |
| 544 | 544 |
| 545 impl->voidMethodDoubleOrDOMStringArg(arg); | 545 impl->voidMethodDoubleOrDOMStringArg(arg); |
| 546 } | 546 } |
| 547 | 547 |
| 548 void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 548 MODULES_EXPORT void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) { |
| 549 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod(i
nfo); | 549 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod(i
nfo); |
| 550 } | 550 } |
| 551 | 551 |
| 552 static void voidMethodVoidExperimentalCallbackFunctionMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) { | 552 static void voidMethodVoidExperimentalCallbackFunctionMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) { |
| 553 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 553 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 554 | 554 |
| 555 if (UNLIKELY(info.Length() < 1)) { | 555 if (UNLIKELY(info.Length() < 1)) { |
| 556 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", Excep
tionMessages::notEnoughArguments(1, info.Length()))); | 556 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", Excep
tionMessages::notEnoughArguments(1, info.Length()))); |
| 557 return; | 557 return; |
| 558 } | 558 } |
| 559 | 559 |
| 560 VoidExperimentalCallbackFunction* arg; | 560 VoidExperimentalCallbackFunction* arg; |
| 561 arg = V8VoidExperimentalCallbackFunction::toImplWithTypeCheck(info.GetIsolate(
), info[0]); | 561 arg = V8VoidExperimentalCallbackFunction::toImplWithTypeCheck(info.GetIsolate(
), info[0]); |
| 562 if (!arg) { | 562 if (!arg) { |
| 563 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", "para
meter 1 is not of type 'VoidExperimentalCallbackFunction'.")); | 563 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", "para
meter 1 is not of type 'VoidExperimentalCallbackFunction'.")); |
| 564 | 564 |
| 565 return; | 565 return; |
| 566 } | 566 } |
| 567 | 567 |
| 568 impl->voidMethodVoidExperimentalCallbackFunction(arg); | 568 impl->voidMethodVoidExperimentalCallbackFunction(arg); |
| 569 } | 569 } |
| 570 | 570 |
| 571 void voidMethodVoidExperimentalCallbackFunctionMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) { | 571 MODULES_EXPORT void voidMethodVoidExperimentalCallbackFunctionMethodCallback(co
nst v8::FunctionCallbackInfo<v8::Value>& info) { |
| 572 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc
tionMethod(info); | 572 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc
tionMethod(info); |
| 573 } | 573 } |
| 574 | 574 |
| 575 static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) { | 575 static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) { |
| 576 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 576 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 577 | 577 |
| 578 if (UNLIKELY(info.Length() < 1)) { | 578 if (UNLIKELY(info.Length() < 1)) { |
| 579 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", Excepti
onMessages::notEnoughArguments(1, info.Length()))); | 579 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", Excepti
onMessages::notEnoughArguments(1, info.Length()))); |
| 580 return; | 580 return; |
| 581 } | 581 } |
| 582 | 582 |
| 583 VoidCallbackFunctionModules* arg; | 583 VoidCallbackFunctionModules* arg; |
| 584 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable(
))) { | 584 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable(
))) { |
| 585 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca
llback provided as parameter 1 is not a function.")); | 585 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca
llback provided as parameter 1 is not a function.")); |
| 586 | 586 |
| 587 return; | 587 return; |
| 588 } | 588 } |
| 589 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate
()), info[0]); | 589 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate
()), info[0]); |
| 590 | 590 |
| 591 impl->voidMethodVoidCallbackFunctionModulesArg(arg); | 591 impl->voidMethodVoidCallbackFunctionModulesArg(arg); |
| 592 } | 592 } |
| 593 | 593 |
| 594 void voidMethodVoidCallbackFunctionModulesArgMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) { | 594 MODULES_EXPORT void voidMethodVoidCallbackFunctionModulesArgMethodCallback(cons
t v8::FunctionCallbackInfo<v8::Value>& info) { |
| 595 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA
rgMethod(info); | 595 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA
rgMethod(info); |
| 596 } | 596 } |
| 597 | 597 |
| 598 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 598 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 599 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "keys"); | 599 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "keys"); |
| 600 | 600 |
| 601 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 601 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 602 | 602 |
| 603 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 603 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 604 | 604 |
| 605 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | 605 Iterator* result = impl->keysForBinding(scriptState, exceptionState); |
| 606 if (exceptionState.hadException()) { | 606 if (exceptionState.hadException()) { |
| 607 return; | 607 return; |
| 608 } | 608 } |
| 609 v8SetReturnValue(info, result); | 609 v8SetReturnValue(info, result); |
| 610 } | 610 } |
| 611 | 611 |
| 612 void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 612 MODULES_EXPORT void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) { |
| 613 TestInterface5ImplementationV8Internal::keysMethod(info); | 613 TestInterface5ImplementationV8Internal::keysMethod(info); |
| 614 } | 614 } |
| 615 | 615 |
| 616 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 616 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 617 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "values"); | 617 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "values"); |
| 618 | 618 |
| 619 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 619 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 620 | 620 |
| 621 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 621 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 622 | 622 |
| 623 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 623 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
| 624 if (exceptionState.hadException()) { | 624 if (exceptionState.hadException()) { |
| 625 return; | 625 return; |
| 626 } | 626 } |
| 627 v8SetReturnValue(info, result); | 627 v8SetReturnValue(info, result); |
| 628 } | 628 } |
| 629 | 629 |
| 630 void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 630 MODULES_EXPORT void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { |
| 631 TestInterface5ImplementationV8Internal::valuesMethod(info); | 631 TestInterface5ImplementationV8Internal::valuesMethod(info); |
| 632 } | 632 } |
| 633 | 633 |
| 634 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 634 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 635 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "entries"); | 635 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "entries"); |
| 636 | 636 |
| 637 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 637 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 638 | 638 |
| 639 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 639 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 640 | 640 |
| 641 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 641 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
| 642 if (exceptionState.hadException()) { | 642 if (exceptionState.hadException()) { |
| 643 return; | 643 return; |
| 644 } | 644 } |
| 645 v8SetReturnValue(info, result); | 645 v8SetReturnValue(info, result); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 648 MODULES_EXPORT void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { |
| 649 TestInterface5ImplementationV8Internal::entriesMethod(info); | 649 TestInterface5ImplementationV8Internal::entriesMethod(info); |
| 650 } | 650 } |
| 651 | 651 |
| 652 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 652 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 653 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "forEach"); | 653 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "forEach"); |
| 654 | 654 |
| 655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 656 | 656 |
| 657 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 657 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 658 | 658 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 671 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); | 671 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); |
| 672 | 672 |
| 673 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | 673 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
| 674 | 674 |
| 675 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()),
callback, thisArg, exceptionState); | 675 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()),
callback, thisArg, exceptionState); |
| 676 if (exceptionState.hadException()) { | 676 if (exceptionState.hadException()) { |
| 677 return; | 677 return; |
| 678 } | 678 } |
| 679 } | 679 } |
| 680 | 680 |
| 681 void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 681 MODULES_EXPORT void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) { |
| 682 TestInterface5ImplementationV8Internal::forEachMethod(info); | 682 TestInterface5ImplementationV8Internal::forEachMethod(info); |
| 683 } | 683 } |
| 684 | 684 |
| 685 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 685 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 687 | 687 |
| 688 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); | 688 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); |
| 689 } | 689 } |
| 690 | 690 |
| 691 void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 691 MODULES_EXPORT void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 692 TestInterface5ImplementationV8Internal::toStringMethod(info); | 692 TestInterface5ImplementationV8Internal::toStringMethod(info); |
| 693 } | 693 } |
| 694 | 694 |
| 695 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 695 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 696 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "iterator"); | 696 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "iterator"); |
| 697 | 697 |
| 698 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 698 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 699 | 699 |
| 700 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 700 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 701 | 701 |
| 702 Iterator* result = impl->iterator(scriptState, exceptionState); | 702 Iterator* result = impl->iterator(scriptState, exceptionState); |
| 703 if (exceptionState.hadException()) { | 703 if (exceptionState.hadException()) { |
| 704 return; | 704 return; |
| 705 } | 705 } |
| 706 v8SetReturnValue(info, result); | 706 v8SetReturnValue(info, result); |
| 707 } | 707 } |
| 708 | 708 |
| 709 void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 709 MODULES_EXPORT void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { |
| 710 TestInterface5ImplementationV8Internal::iteratorMethod(info); | 710 TestInterface5ImplementationV8Internal::iteratorMethod(info); |
| 711 } | 711 } |
| 712 | 712 |
| 713 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) { | 713 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) { |
| 714 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 714 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 715 String result = impl->anonymousNamedGetter(name); | 715 String result = impl->anonymousNamedGetter(name); |
| 716 if (result.isNull()) | 716 if (result.isNull()) |
| 717 return; | 717 return; |
| 718 v8SetReturnValueString(info, result, info.GetIsolate()); | 718 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 719 } | 719 } |
| 720 | 720 |
| 721 void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Value>& info) { | 721 MODULES_EXPORT void namedPropertyGetterCallback(v8::Local<v8::Name> name, const
v8::PropertyCallbackInfo<v8::Value>& info) { |
| 722 if (!name->IsString()) | 722 if (!name->IsString()) |
| 723 return; | 723 return; |
| 724 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 724 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 725 | 725 |
| 726 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info
); | 726 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info
); |
| 727 } | 727 } |
| 728 | 728 |
| 729 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { | 729 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 730 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 730 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 731 V8StringResource<> propertyValue = v8Value; | 731 V8StringResource<> propertyValue = v8Value; |
| 732 if (!propertyValue.prepare()) | 732 if (!propertyValue.prepare()) |
| 733 return; | 733 return; |
| 734 | 734 |
| 735 bool result = impl->anonymousNamedSetter(name, propertyValue); | 735 bool result = impl->anonymousNamedSetter(name, propertyValue); |
| 736 if (!result) | 736 if (!result) |
| 737 return; | 737 return; |
| 738 v8SetReturnValue(info, v8Value); | 738 v8SetReturnValue(info, v8Value); |
| 739 } | 739 } |
| 740 | 740 |
| 741 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { | 741 MODULES_EXPORT void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Lo
cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 742 if (!name->IsString()) | 742 if (!name->IsString()) |
| 743 return; | 743 return; |
| 744 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 744 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 745 | 745 |
| 746 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8Va
lue, info); | 746 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8Va
lue, info); |
| 747 } | 747 } |
| 748 | 748 |
| 749 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) { | 749 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) { |
| 750 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 750 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 751 | 751 |
| 752 DeleteResult result = impl->anonymousNamedDeleter(name); | 752 DeleteResult result = impl->anonymousNamedDeleter(name); |
| 753 if (result == DeleteUnknownProperty) | 753 if (result == DeleteUnknownProperty) |
| 754 return; | 754 return; |
| 755 v8SetReturnValue(info, result == DeleteSuccess); | 755 v8SetReturnValue(info, result == DeleteSuccess); |
| 756 } | 756 } |
| 757 | 757 |
| 758 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
llbackInfo<v8::Boolean>& info) { | 758 MODULES_EXPORT void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const
v8::PropertyCallbackInfo<v8::Boolean>& info) { |
| 759 if (!name->IsString()) | 759 if (!name->IsString()) |
| 760 return; | 760 return; |
| 761 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 761 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 762 | 762 |
| 763 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, inf
o); | 763 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, inf
o); |
| 764 } | 764 } |
| 765 | 765 |
| 766 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) { | 766 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) { |
| 767 const CString& nameInUtf8 = name.utf8(); | 767 const CString& nameInUtf8 = name.utf8(); |
| 768 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext
, "TestInterface5", nameInUtf8.data()); | 768 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext
, "TestInterface5", nameInUtf8.data()); |
| 769 | 769 |
| 770 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 770 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 771 | 771 |
| 772 bool result = impl->namedPropertyQuery(name, exceptionState); | 772 bool result = impl->namedPropertyQuery(name, exceptionState); |
| 773 if (!result) | 773 if (!result) |
| 774 return; | 774 return; |
| 775 v8SetReturnValueInt(info, v8::None); | 775 v8SetReturnValueInt(info, v8::None); |
| 776 } | 776 } |
| 777 | 777 |
| 778 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Integer>& info) { | 778 MODULES_EXPORT void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v
8::PropertyCallbackInfo<v8::Integer>& info) { |
| 779 if (!name->IsString()) | 779 if (!name->IsString()) |
| 780 return; | 780 return; |
| 781 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 781 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 782 | 782 |
| 783 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, info)
; | 783 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, info)
; |
| 784 } | 784 } |
| 785 | 785 |
| 786 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) { | 786 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) { |
| 787 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationCo
ntext, "TestInterface5"); | 787 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationCo
ntext, "TestInterface5"); |
| 788 | 788 |
| 789 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 789 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 790 | 790 |
| 791 Vector<String> names; | 791 Vector<String> names; |
| 792 impl->namedPropertyEnumerator(names, exceptionState); | 792 impl->namedPropertyEnumerator(names, exceptionState); |
| 793 if (exceptionState.hadException()) | 793 if (exceptionState.hadException()) |
| 794 return; | 794 return; |
| 795 v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Ar
ray>()); | 795 v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Ar
ray>()); |
| 796 } | 796 } |
| 797 | 797 |
| 798 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>&
info) { | 798 MODULES_EXPORT void namedPropertyEnumeratorCallback(const v8::PropertyCallbackIn
fo<v8::Array>& info) { |
| 799 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); | 799 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); |
| 800 } | 800 } |
| 801 | 801 |
| 802 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) { | 802 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) { |
| 803 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 803 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 804 | 804 |
| 805 // We assume that all the implementations support length() method, although | 805 // We assume that all the implementations support length() method, although |
| 806 // the spec doesn't require that length() must exist. It's okay that | 806 // the spec doesn't require that length() must exist. It's okay that |
| 807 // the interface does not have length attribute as long as the | 807 // the interface does not have length attribute as long as the |
| 808 // implementation supports length() member function. | 808 // implementation supports length() member function. |
| 809 if (index >= impl->length()) | 809 if (index >= impl->length()) |
| 810 return; // Returns undefined due to out-of-range. | 810 return; // Returns undefined due to out-of-range. |
| 811 | 811 |
| 812 String result = impl->anonymousIndexedGetter(index); | 812 String result = impl->anonymousIndexedGetter(index); |
| 813 v8SetReturnValueString(info, result, info.GetIsolate()); | 813 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 814 } | 814 } |
| 815 | 815 |
| 816 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) { | 816 MODULES_EXPORT void indexedPropertyGetterCallback(uint32_t index, const v8::Prop
ertyCallbackInfo<v8::Value>& info) { |
| 817 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); | 817 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); |
| 818 } | 818 } |
| 819 | 819 |
| 820 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) { | 820 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 821 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 821 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 822 V8StringResource<> propertyValue = v8Value; | 822 V8StringResource<> propertyValue = v8Value; |
| 823 if (!propertyValue.prepare()) | 823 if (!propertyValue.prepare()) |
| 824 return; | 824 return; |
| 825 | 825 |
| 826 bool result = impl->anonymousIndexedSetter(index, propertyValue); | 826 bool result = impl->anonymousIndexedSetter(index, propertyValue); |
| 827 if (!result) | 827 if (!result) |
| 828 return; | 828 return; |
| 829 v8SetReturnValue(info, v8Value); | 829 v8SetReturnValue(info, v8Value); |
| 830 } | 830 } |
| 831 | 831 |
| 832 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) { | 832 MODULES_EXPORT void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 833 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value,
info); | 833 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value,
info); |
| 834 } | 834 } |
| 835 | 835 |
| 836 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) { | 836 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) { |
| 837 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 837 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 838 | 838 |
| 839 DeleteResult result = impl->anonymousIndexedDeleter(index); | 839 DeleteResult result = impl->anonymousIndexedDeleter(index); |
| 840 if (result == DeleteUnknownProperty) | 840 if (result == DeleteUnknownProperty) |
| 841 return; | 841 return; |
| 842 v8SetReturnValue(info, result == DeleteSuccess); | 842 v8SetReturnValue(info, result == DeleteSuccess); |
| 843 } | 843 } |
| 844 | 844 |
| 845 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) { | 845 MODULES_EXPORT void indexedPropertyDeleterCallback(uint32_t index, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) { |
| 846 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); | 846 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); |
| 847 } | 847 } |
| 848 | 848 |
| 849 } // namespace TestInterface5ImplementationV8Internal | 849 } // namespace TestInterface5ImplementationV8Internal |
| 850 | 850 |
| 851 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) { | 851 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) { |
| 852 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5Imp
lementation>(); | 852 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5Imp
lementation>(); |
| 853 TestInterface5Implementation* referencedName = impl->referencedName(); | 853 TestInterface5Implementation* referencedName = impl->referencedName(); |
| 854 if (referencedName) { | 854 if (referencedName) { |
| 855 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName, is
olate); | 855 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName, is
olate); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMetho
dConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV8Int
ernal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigurati
on::OnInterface, V8DOMConfiguration::CheckHolder}; | 983 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMetho
dConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV8Int
ernal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigurati
on::OnInterface, V8DOMConfiguration::CheckHolder}; |
| 984 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodConfi
guration); | 984 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodConfi
guration); |
| 985 } | 985 } |
| 986 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { | 986 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { |
| 987 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM
ethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInterface
5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback, 0,
0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; | 987 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM
ethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInterface
5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback, 0,
0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
| 988 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodM
ethodConfiguration); | 988 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodM
ethodConfiguration); |
| 989 } | 989 } |
| 990 } | 990 } |
| 991 | 991 |
| 992 } // namespace blink | 992 } // namespace blink |
| OLD | NEW |