| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "V8TestInterfaceGarbageCollected.h" | 7 #include "V8TestInterfaceGarbageCollected.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/GeneratedCodeHelper.h" | 10 #include "bindings/core/v8/GeneratedCodeHelper.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 80 void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 81 { | 81 { |
| 82 v8::Local<v8::Value> v8Value = info[0]; | 82 v8::Local<v8::Value> v8Value = info[0]; |
| 83 TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info)
; | 83 TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info)
; |
| 84 } | 84 } |
| 85 | 85 |
| 86 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 86 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 87 { | 87 { |
| 88 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 89 |
| 88 if (UNLIKELY(info.Length() < 1)) { | 90 if (UNLIKELY(info.Length() < 1)) { |
| 89 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr
eateTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("func", "Tes
tInterfaceGarbageCollected", ExceptionMessages::notEnoughArguments(1, info.Lengt
h())))); | 91 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("func", "TestInterfaceGarbageCollected", ExceptionMessages::notEn
oughArguments(1, info.Length()))); |
| 90 return; | 92 return; |
| 91 } | 93 } |
| 92 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 94 |
| 93 TestInterfaceGarbageCollected* arg; | 95 TestInterfaceGarbageCollected* arg; |
| 94 { | 96 arg = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate()
, info[0]); |
| 95 arg = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsola
te(), info[0]); | 97 if (!arg) { |
| 96 if (!arg) { | 98 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("func", "TestInterfaceGarbageCollected", "parameter 1 is not of t
ype 'TestInterfaceGarbageCollected'.")); |
| 97 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("func", "TestInterfaceGarbageCollected", "parameter 1 is not
of type 'TestInterfaceGarbageCollected'.")); | 99 |
| 98 return; | 100 return; |
| 99 } | |
| 100 } | 101 } |
| 102 |
| 101 impl->func(arg); | 103 impl->func(arg); |
| 102 } | 104 } |
| 103 | 105 |
| 104 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 106 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 105 { | 107 { |
| 106 TestInterfaceGarbageCollectedV8Internal::funcMethod(info); | 108 TestInterfaceGarbageCollectedV8Internal::funcMethod(info); |
| 107 } | 109 } |
| 108 | 110 |
| 109 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 111 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 110 { | 112 { |
| 111 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 113 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "keys"); |
| 114 |
| 112 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 115 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 116 |
| 113 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 117 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 118 |
| 114 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | 119 Iterator* result = impl->keysForBinding(scriptState, exceptionState); |
| 115 if (exceptionState.hadException()) { | 120 if (exceptionState.hadException()) { |
| 116 return; | 121 return; |
| 117 } | 122 } |
| 118 v8SetReturnValue(info, result); | 123 v8SetReturnValue(info, result); |
| 119 } | 124 } |
| 120 | 125 |
| 121 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 126 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 122 { | 127 { |
| 123 TestInterfaceGarbageCollectedV8Internal::keysMethod(info); | 128 TestInterfaceGarbageCollectedV8Internal::keysMethod(info); |
| 124 } | 129 } |
| 125 | 130 |
| 126 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 131 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 127 { | 132 { |
| 128 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 133 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "values"); |
| 134 |
| 129 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 135 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 136 |
| 130 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 137 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 138 |
| 131 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 139 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
| 132 if (exceptionState.hadException()) { | 140 if (exceptionState.hadException()) { |
| 133 return; | 141 return; |
| 134 } | 142 } |
| 135 v8SetReturnValue(info, result); | 143 v8SetReturnValue(info, result); |
| 136 } | 144 } |
| 137 | 145 |
| 138 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 146 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 139 { | 147 { |
| 140 TestInterfaceGarbageCollectedV8Internal::valuesMethod(info); | 148 TestInterfaceGarbageCollectedV8Internal::valuesMethod(info); |
| 141 } | 149 } |
| 142 | 150 |
| 143 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 151 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 144 { | 152 { |
| 145 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 153 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "entries"); |
| 154 |
| 146 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 155 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 156 |
| 147 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 157 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 158 |
| 148 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 159 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
| 149 if (exceptionState.hadException()) { | 160 if (exceptionState.hadException()) { |
| 150 return; | 161 return; |
| 151 } | 162 } |
| 152 v8SetReturnValue(info, result); | 163 v8SetReturnValue(info, result); |
| 153 } | 164 } |
| 154 | 165 |
| 155 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 166 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 156 { | 167 { |
| 157 TestInterfaceGarbageCollectedV8Internal::entriesMethod(info); | 168 TestInterfaceGarbageCollectedV8Internal::entriesMethod(info); |
| 158 } | 169 } |
| 159 | 170 |
| 160 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 171 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 161 { | 172 { |
| 162 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "
TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 173 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "forEach"); |
| 174 |
| 175 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 176 |
| 177 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 178 |
| 163 if (UNLIKELY(info.Length() < 1)) { | 179 if (UNLIKELY(info.Length() < 1)) { |
| 164 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 180 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 165 return; | 181 return; |
| 166 } | 182 } |
| 167 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 183 |
| 168 ScriptValue callback; | 184 ScriptValue callback; |
| 169 ScriptValue thisArg; | 185 ScriptValue thisArg; |
| 170 { | 186 if (!info[0]->IsFunction()) { |
| 171 if (!info[0]->IsFunction()) { | 187 exceptionState.throwTypeError("The callback provided as parameter 1 is n
ot a function."); |
| 172 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); | 188 |
| 173 return; | 189 return; |
| 174 } | |
| 175 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; | |
| 176 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | |
| 177 } | 190 } |
| 178 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 191 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); |
| 192 |
| 193 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
| 194 |
| 179 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); | 195 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); |
| 180 if (exceptionState.hadException()) { | 196 if (exceptionState.hadException()) { |
| 181 return; | 197 return; |
| 182 } | 198 } |
| 183 } | 199 } |
| 184 | 200 |
| 185 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 201 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 186 { | 202 { |
| 187 TestInterfaceGarbageCollectedV8Internal::forEachMethod(info); | 203 TestInterfaceGarbageCollectedV8Internal::forEachMethod(info); |
| 188 } | 204 } |
| 189 | 205 |
| 190 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 206 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 191 { | 207 { |
| 192 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test
InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 208 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "has"); |
| 209 |
| 210 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 211 |
| 212 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 213 |
| 193 if (UNLIKELY(info.Length() < 1)) { | 214 if (UNLIKELY(info.Length() < 1)) { |
| 194 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 215 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 195 return; | 216 return; |
| 196 } | 217 } |
| 197 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 218 |
| 198 V8StringResource<> value; | 219 V8StringResource<> value; |
| 199 { | 220 value = info[0]; |
| 200 value = info[0]; | 221 if (!value.prepare()) |
| 201 if (!value.prepare()) | 222 return; |
| 202 return; | 223 |
| 203 } | |
| 204 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 205 bool result = impl->hasForBinding(scriptState, value, exceptionState); | 224 bool result = impl->hasForBinding(scriptState, value, exceptionState); |
| 206 if (exceptionState.hadException()) { | 225 if (exceptionState.hadException()) { |
| 207 return; | 226 return; |
| 208 } | 227 } |
| 209 v8SetReturnValueBool(info, result); | 228 v8SetReturnValueBool(info, result); |
| 210 } | 229 } |
| 211 | 230 |
| 212 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 231 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 213 { | 232 { |
| 214 TestInterfaceGarbageCollectedV8Internal::hasMethod(info); | 233 TestInterfaceGarbageCollectedV8Internal::hasMethod(info); |
| 215 } | 234 } |
| 216 | 235 |
| 217 static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 236 static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 218 { | 237 { |
| 219 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "Test
InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 238 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "add"); |
| 239 |
| 240 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 241 |
| 242 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 243 |
| 220 if (UNLIKELY(info.Length() < 1)) { | 244 if (UNLIKELY(info.Length() < 1)) { |
| 221 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 245 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 222 return; | 246 return; |
| 223 } | 247 } |
| 224 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 248 |
| 225 V8StringResource<> value; | 249 V8StringResource<> value; |
| 226 { | 250 value = info[0]; |
| 227 value = info[0]; | 251 if (!value.prepare()) |
| 228 if (!value.prepare()) | 252 return; |
| 229 return; | 253 |
| 230 } | |
| 231 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 232 TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, val
ue, exceptionState); | 254 TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, val
ue, exceptionState); |
| 233 if (exceptionState.hadException()) { | 255 if (exceptionState.hadException()) { |
| 234 return; | 256 return; |
| 235 } | 257 } |
| 236 v8SetReturnValue(info, result); | 258 v8SetReturnValue(info, result); |
| 237 } | 259 } |
| 238 | 260 |
| 239 static void addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 261 static void addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 240 { | 262 { |
| 241 TestInterfaceGarbageCollectedV8Internal::addMethod(info); | 263 TestInterfaceGarbageCollectedV8Internal::addMethod(info); |
| 242 } | 264 } |
| 243 | 265 |
| 244 static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 266 static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 245 { | 267 { |
| 246 ExceptionState exceptionState(ExceptionState::ExecutionContext, "clear", "Te
stInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 268 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "clear"); |
| 269 |
| 247 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 270 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 271 |
| 248 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 272 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 273 |
| 249 impl->clearForBinding(scriptState, exceptionState); | 274 impl->clearForBinding(scriptState, exceptionState); |
| 250 if (exceptionState.hadException()) { | 275 if (exceptionState.hadException()) { |
| 251 return; | 276 return; |
| 252 } | 277 } |
| 253 } | 278 } |
| 254 | 279 |
| 255 static void clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 280 static void clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 256 { | 281 { |
| 257 TestInterfaceGarbageCollectedV8Internal::clearMethod(info); | 282 TestInterfaceGarbageCollectedV8Internal::clearMethod(info); |
| 258 } | 283 } |
| 259 | 284 |
| 260 static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 285 static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 261 { | 286 { |
| 262 ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "T
estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 287 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "delete"); |
| 288 |
| 289 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 290 |
| 291 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 292 |
| 263 if (UNLIKELY(info.Length() < 1)) { | 293 if (UNLIKELY(info.Length() < 1)) { |
| 264 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 294 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 265 return; | 295 return; |
| 266 } | 296 } |
| 267 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 297 |
| 268 V8StringResource<> value; | 298 V8StringResource<> value; |
| 269 { | 299 value = info[0]; |
| 270 value = info[0]; | 300 if (!value.prepare()) |
| 271 if (!value.prepare()) | 301 return; |
| 272 return; | 302 |
| 273 } | |
| 274 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 275 bool result = impl->deleteForBinding(scriptState, value, exceptionState); | 303 bool result = impl->deleteForBinding(scriptState, value, exceptionState); |
| 276 if (exceptionState.hadException()) { | 304 if (exceptionState.hadException()) { |
| 277 return; | 305 return; |
| 278 } | 306 } |
| 279 v8SetReturnValueBool(info, result); | 307 v8SetReturnValueBool(info, result); |
| 280 } | 308 } |
| 281 | 309 |
| 282 static void deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 310 static void deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 283 { | 311 { |
| 284 TestInterfaceGarbageCollectedV8Internal::deleteMethod(info); | 312 TestInterfaceGarbageCollectedV8Internal::deleteMethod(info); |
| 285 } | 313 } |
| 286 | 314 |
| 287 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 315 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 288 { | 316 { |
| 289 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 317 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceGarbageCollected", "iterator"); |
| 318 |
| 290 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 319 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
| 320 |
| 291 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 321 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 322 |
| 292 Iterator* result = impl->iterator(scriptState, exceptionState); | 323 Iterator* result = impl->iterator(scriptState, exceptionState); |
| 293 if (exceptionState.hadException()) { | 324 if (exceptionState.hadException()) { |
| 294 return; | 325 return; |
| 295 } | 326 } |
| 296 v8SetReturnValue(info, result); | 327 v8SetReturnValue(info, result); |
| 297 } | 328 } |
| 298 | 329 |
| 299 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 330 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 300 { | 331 { |
| 301 TestInterfaceGarbageCollectedV8Internal::iteratorMethod(info); | 332 TestInterfaceGarbageCollectedV8Internal::iteratorMethod(info); |
| 302 } | 333 } |
| 303 | 334 |
| 304 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 335 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 305 { | 336 { |
| 306 if (UNLIKELY(info.Length() < 1)) { | 337 if (UNLIKELY(info.Length() < 1)) { |
| 307 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr
eateTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("TestInter
faceGarbageCollected", ExceptionMessages::notEnoughArguments(1, info.Length())))
); | 338 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToConstruct("TestInterfaceGarbageCollected", ExceptionMessages::notEnoughAr
guments(1, info.Length()))); |
| 308 return; | 339 return; |
| 309 } | 340 } |
| 341 |
| 310 V8StringResource<> str; | 342 V8StringResource<> str; |
| 311 { | 343 str = info[0]; |
| 312 str = info[0]; | 344 if (!str.prepare()) |
| 313 if (!str.prepare()) | 345 return; |
| 314 return; | 346 |
| 315 } | |
| 316 TestInterfaceGarbageCollected* impl = TestInterfaceGarbageCollected::create(
str); | 347 TestInterfaceGarbageCollected* impl = TestInterfaceGarbageCollected::create(
str); |
| 317 v8::Local<v8::Object> wrapper = info.Holder(); | 348 v8::Local<v8::Object> wrapper = info.Holder(); |
| 318 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceGarb
ageCollected::wrapperTypeInfo, wrapper); | 349 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceGarb
ageCollected::wrapperTypeInfo, wrapper); |
| 319 v8SetReturnValue(info, wrapper); | 350 v8SetReturnValue(info, wrapper); |
| 320 } | 351 } |
| 321 | 352 |
| 322 } // namespace TestInterfaceGarbageCollectedV8Internal | 353 } // namespace TestInterfaceGarbageCollectedV8Internal |
| 323 | 354 |
| 324 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceGarbageCollectedA
ccessors[] = { | 355 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceGarbageCollectedA
ccessors[] = { |
| 325 {"attr1", TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetterCallb
ack, TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetterCallback, 0, 0
, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigurati
on::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Ch
eckHolder}, | 356 {"attr1", TestInterfaceGarbageCollectedV8Internal::attr1AttributeGetterCallb
ack, TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetterCallback, 0, 0
, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigurati
on::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Ch
eckHolder}, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 { | 418 { |
| 388 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 419 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 389 } | 420 } |
| 390 | 421 |
| 391 TestInterfaceGarbageCollected* V8TestInterfaceGarbageCollected::toImplWithTypeCh
eck(v8::Isolate* isolate, v8::Local<v8::Value> value) | 422 TestInterfaceGarbageCollected* V8TestInterfaceGarbageCollected::toImplWithTypeCh
eck(v8::Isolate* isolate, v8::Local<v8::Value> value) |
| 392 { | 423 { |
| 393 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 424 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 394 } | 425 } |
| 395 | 426 |
| 396 } // namespace blink | 427 } // namespace blink |
| OLD | NEW |