Chromium Code Reviews| 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 "config.h" | 7 #include "config.h" |
| 8 #if ENABLE(CONDITION) | 8 #if ENABLE(CONDITION) |
| 9 #include "V8TestInterface.h" | 9 #include "V8TestInterface.h" |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 { | 65 { |
| 66 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 66 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 67 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeGetter (info); | 67 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeGetter (info); |
| 68 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 68 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 69 } | 69 } |
| 70 | 70 |
| 71 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 71 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 72 { | 72 { |
| 73 v8::Handle<v8::Object> holder = info.Holder(); | 73 v8::Handle<v8::Object> holder = info.Holder(); |
| 74 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA ttribute", "TestInterface", holder, info.GetIsolate()); | 74 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA ttribute", "TestInterface", holder, info.GetIsolate()); |
| 75 if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { | 75 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 76 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck (info.GetIsolate(), v8Value); | |
| 77 if (!cppValue) { | |
| 76 exceptionState.throwTypeError("The provided value is not of type 'TestIn terface'."); | 78 exceptionState.throwTypeError("The provided value is not of type 'TestIn terface'."); |
| 77 exceptionState.throwIfNeeded(); | 79 exceptionState.throwIfNeeded(); |
| 78 return; | 80 return; |
| 79 } | 81 } |
| 80 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | |
| 81 TestInterfaceImplementation* cppValue = V8TestInterface::toImpl(v8::Handle<v 8::Object>::Cast(v8Value)); | |
| 82 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); | 82 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 85 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 86 { | 86 { |
| 87 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 87 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 88 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter (v8Value, info); | 88 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter (v8Value, info); |
| 89 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 89 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 90 } | 90 } |
| 91 | 91 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 { | 425 { |
| 426 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 426 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 427 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeGette r(info); | 427 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeGette r(info); |
| 428 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 428 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 429 } | 429 } |
| 430 | 430 |
| 431 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 431 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 432 { | 432 { |
| 433 v8::Handle<v8::Object> holder = info.Holder(); | 433 v8::Handle<v8::Object> holder = info.Holder(); |
| 434 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode Attribute", "TestInterface", holder, info.GetIsolate()); | 434 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode Attribute", "TestInterface", holder, info.GetIsolate()); |
| 435 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) { | 435 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 436 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); | |
| 437 if (!cppValue) { | |
| 436 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); | 438 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); |
| 437 exceptionState.throwIfNeeded(); | 439 exceptionState.throwIfNeeded(); |
| 438 return; | 440 return; |
| 439 } | 441 } |
| 440 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | |
| 441 Node* cppValue = V8Node::toImpl(v8::Handle<v8::Object>::Cast(v8Value)); | |
| 442 impl->setImplementsNodeAttribute(WTF::getPtr(cppValue)); | 442 impl->setImplementsNodeAttribute(WTF::getPtr(cppValue)); |
| 443 } | 443 } |
| 444 | 444 |
| 445 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 445 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 446 { | 446 { |
| 447 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 447 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 448 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette r(v8Value, info); | 448 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette r(v8Value, info); |
| 449 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 449 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 450 } | 450 } |
| 451 | 451 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 { | 490 { |
| 491 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 491 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 492 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute AttributeGetter(info); | 492 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute AttributeGetter(info); |
| 493 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 493 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 494 } | 494 } |
| 495 | 495 |
| 496 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V alue> v8Value, const v8::PropertyCallbackInfo<void>& info) | 496 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V alue> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 497 { | 497 { |
| 498 v8::Handle<v8::Object> holder = info.Holder(); | 498 v8::Handle<v8::Object> holder = info.Holder(); |
| 499 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); | 499 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); |
| 500 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) { | 500 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 501 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); | |
| 502 if (!cppValue) { | |
| 501 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); | 503 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); |
| 502 exceptionState.throwIfNeeded(); | 504 exceptionState.throwIfNeeded(); |
| 503 return; | 505 return; |
| 504 } | 506 } |
| 505 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | |
| 506 Node* cppValue = V8Node::toImpl(v8::Handle<v8::Object>::Cast(v8Value)); | |
| 507 impl->setImplementsRuntimeEnabledNodeAttribute(WTF::getPtr(cppValue)); | 507 impl->setImplementsRuntimeEnabledNodeAttribute(WTF::getPtr(cppValue)); |
| 508 } | 508 } |
| 509 | 509 |
| 510 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc al<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info) | 510 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc al<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info) |
| 511 { | 511 { |
| 512 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 512 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 513 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute AttributeSetter(v8Value, info); | 513 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute AttributeSetter(v8Value, info); |
| 514 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 514 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 515 } | 515 } |
| 516 | 516 |
| 517 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::Pr opertyCallbackInfo<v8::Value>& info) | 517 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::Pr opertyCallbackInfo<v8::Value>& info) |
| 518 { | 518 { |
| 519 v8::Handle<v8::Object> holder = info.Holder(); | 519 v8::Handle<v8::Object> holder = info.Holder(); |
| 520 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | 520 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 521 v8SetReturnValueFast(info, WTF::getPtr(impl->implementsPerContextEnabledNode Attribute()), impl); | 521 v8SetReturnValueFast(info, WTF::getPtr(impl->implementsPerContextEnabledNode Attribute()), impl); |
| 522 } | 522 } |
| 523 | 523 |
| 524 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8:: Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 524 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8:: Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 525 { | 525 { |
| 526 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 526 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 527 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib uteAttributeGetter(info); | 527 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib uteAttributeGetter(info); |
| 528 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 528 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 529 } | 529 } |
| 530 | 530 |
| 531 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 531 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 532 { | 532 { |
| 533 v8::Handle<v8::Object> holder = info.Holder(); | 533 v8::Handle<v8::Object> holder = info.Holder(); |
| 534 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerC ontextEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); | 534 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerC ontextEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); |
| 535 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) { | 535 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 536 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); | |
| 537 if (!cppValue) { | |
| 536 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); | 538 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); |
| 537 exceptionState.throwIfNeeded(); | 539 exceptionState.throwIfNeeded(); |
| 538 return; | 540 return; |
| 539 } | 541 } |
| 540 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | |
| 541 Node* cppValue = V8Node::toImpl(v8::Handle<v8::Object>::Cast(v8Value)); | |
| 542 impl->setImplementsPerContextEnabledNodeAttribute(WTF::getPtr(cppValue)); | 542 impl->setImplementsPerContextEnabledNodeAttribute(WTF::getPtr(cppValue)); |
| 543 } | 543 } |
| 544 | 544 |
| 545 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8:: Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo< void>& info) | 545 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8:: Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo< void>& info) |
| 546 { | 546 { |
| 547 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 547 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 548 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib uteAttributeSetter(v8Value, info); | 548 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib uteAttributeSetter(v8Value, info); |
| 549 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 549 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 550 } | 550 } |
| 551 | 551 |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 | 928 |
| 929 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) | 929 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) |
| 930 { | 930 { |
| 931 if (UNLIKELY(info.Length() < 1)) { | 931 if (UNLIKELY(info.Length() < 1)) { |
| 932 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodTestInterfaceEmptyArg", "TestInterface", 1, info.Len gth()), info.GetIsolate()); | 932 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodTestInterfaceEmptyArg", "TestInterface", 1, info.Len gth()), info.GetIsolate()); |
| 933 return; | 933 return; |
| 934 } | 934 } |
| 935 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 935 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 936 TestInterfaceEmpty* testInterfaceEmptyArg; | 936 TestInterfaceEmpty* testInterfaceEmptyArg; |
| 937 { | 937 { |
| 938 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate())) { | 938 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]); |
| 939 if (!testInterfaceEmptyArg) { | |
| 939 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "paramete r 1 is not of type 'TestInterfaceEmpty'.")); | 940 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "paramete r 1 is not of type 'TestInterfaceEmpty'.")); |
| 940 return; | 941 return; |
| 941 } | 942 } |
| 942 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Obje ct>::Cast(info[0])); | |
| 943 } | 943 } |
| 944 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); | 944 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); |
| 945 } | 945 } |
| 946 | 946 |
| 947 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) | 947 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) |
| 948 { | 948 { |
| 949 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 949 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 950 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod (info); | 950 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod (info); |
| 951 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 951 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 952 } | 952 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1144 TOSTRING_VOID_INTERNAL(string, info[0]); | 1144 TOSTRING_VOID_INTERNAL(string, info[0]); |
| 1145 } | 1145 } |
| 1146 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(string); | 1146 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(string); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 static void overloadMethodWithExposedAndRuntimeEnabledFlag3Method(const v8::Func tionCallbackInfo<v8::Value>& info) | 1149 static void overloadMethodWithExposedAndRuntimeEnabledFlag3Method(const v8::Func tionCallbackInfo<v8::Value>& info) |
| 1150 { | 1150 { |
| 1151 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1151 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1152 DOMWindow* window; | 1152 DOMWindow* window; |
| 1153 { | 1153 { |
| 1154 if (info.Length() > 0 && !V8Window::hasInstance(info[0], info.GetIsolate ())) { | 1154 window = toDOMWindow(info.GetIsolate(), info[0]); |
|
Jens Widell
2014/12/18 13:47:05
This is a real change; toDOMWindow() does not just
haraken
2014/12/18 14:50:27
I'm pretty sure that the new code is more correct.
| |
| 1155 if (!window) { | |
| 1155 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("overloadMethodWithExposedAndRuntimeEnabledFlag", "TestInterf ace", "parameter 1 is not of type 'Window'.")); | 1156 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("overloadMethodWithExposedAndRuntimeEnabledFlag", "TestInterf ace", "parameter 1 is not of type 'Window'.")); |
| 1156 return; | 1157 return; |
| 1157 } | 1158 } |
| 1158 window = toDOMWindow(info.GetIsolate(), info[0]); | |
| 1159 } | 1159 } |
| 1160 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(window); | 1160 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(window); |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 static void overloadMethodWithExposedAndRuntimeEnabledFlagMethod(const v8::Funct ionCallbackInfo<v8::Value>& info) | 1163 static void overloadMethodWithExposedAndRuntimeEnabledFlagMethod(const v8::Funct ionCallbackInfo<v8::Value>& info) |
| 1164 { | 1164 { |
| 1165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadMet hodWithExposedAndRuntimeEnabledFlag", "TestInterface", info.Holder(), info.GetIs olate()); | 1165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadMet hodWithExposedAndRuntimeEnabledFlag", "TestInterface", info.Holder(), info.GetIs olate()); |
| 1166 switch (std::min(1, info.Length())) { | 1166 switch (std::min(1, info.Length())) { |
| 1167 case 1: | 1167 case 1: |
| 1168 if (RuntimeEnabledFeatures::featureName2Enabled()) { | 1168 if (RuntimeEnabledFeatures::featureName2Enabled()) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1262 { | 1262 { |
| 1263 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1263 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1264 v8SetReturnValue(info, impl->promiseMethodPartialOverload().v8Value()); | 1264 v8SetReturnValue(info, impl->promiseMethodPartialOverload().v8Value()); |
| 1265 } | 1265 } |
| 1266 | 1266 |
| 1267 static void promiseMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v 8::Value>& info) | 1267 static void promiseMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v 8::Value>& info) |
| 1268 { | 1268 { |
| 1269 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1269 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1270 DOMWindow* window; | 1270 DOMWindow* window; |
| 1271 { | 1271 { |
| 1272 if (info.Length() > 0 && !V8Window::hasInstance(info[0], info.GetIsolate ())) { | 1272 window = toDOMWindow(info.GetIsolate(), info[0]); |
| 1273 if (!window) { | |
| 1273 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), V 8ThrowException::createTypeError(info.GetIsolate(), ExceptionMessages::failedToE xecute("promiseMethodPartialOverload", "TestInterface", "parameter 1 is not of t ype 'Window'.")))); | 1274 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), V 8ThrowException::createTypeError(info.GetIsolate(), ExceptionMessages::failedToE xecute("promiseMethodPartialOverload", "TestInterface", "parameter 1 is not of t ype 'Window'.")))); |
| 1274 return; | 1275 return; |
| 1275 } | 1276 } |
| 1276 window = toDOMWindow(info.GetIsolate(), info[0]); | |
| 1277 } | 1277 } |
| 1278 v8SetReturnValue(info, impl->promiseMethodPartialOverload(window).v8Value()) ; | 1278 v8SetReturnValue(info, impl->promiseMethodPartialOverload(window).v8Value()) ; |
| 1279 } | 1279 } |
| 1280 | 1280 |
| 1281 static void staticPromiseMethodPartialOverload1Method(const v8::FunctionCallback Info<v8::Value>& info) | 1281 static void staticPromiseMethodPartialOverload1Method(const v8::FunctionCallback Info<v8::Value>& info) |
| 1282 { | 1282 { |
| 1283 v8SetReturnValue(info, TestInterfaceImplementation::staticPromiseMethodParti alOverload().v8Value()); | 1283 v8SetReturnValue(info, TestInterfaceImplementation::staticPromiseMethodParti alOverload().v8Value()); |
| 1284 } | 1284 } |
| 1285 | 1285 |
| 1286 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info) | 1286 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 1302 if (UNLIKELY(info.Length() < 2)) { | 1302 if (UNLIKELY(info.Length() < 2)) { |
| 1303 setMinimumArityTypeError(exceptionState, 2, info.Length()); | 1303 setMinimumArityTypeError(exceptionState, 2, info.Length()); |
| 1304 exceptionState.throwIfNeeded(); | 1304 exceptionState.throwIfNeeded(); |
| 1305 return; | 1305 return; |
| 1306 } | 1306 } |
| 1307 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1307 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1308 V8StringResource<> strArg; | 1308 V8StringResource<> strArg; |
| 1309 TestInterfaceEmpty* testInterfaceEmptyArg; | 1309 TestInterfaceEmpty* testInterfaceEmptyArg; |
| 1310 { | 1310 { |
| 1311 TOSTRING_VOID_INTERNAL(strArg, info[0]); | 1311 TOSTRING_VOID_INTERNAL(strArg, info[0]); |
| 1312 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], inf o.GetIsolate())) { | 1312 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[1]); |
| 1313 if (!testInterfaceEmptyArg) { | |
| 1313 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'."); | 1314 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'."); |
| 1314 exceptionState.throwIfNeeded(); | 1315 exceptionState.throwIfNeeded(); |
| 1315 return; | 1316 return; |
| 1316 } | 1317 } |
| 1317 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Obje ct>::Cast(info[1])); | |
| 1318 } | 1318 } |
| 1319 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); | 1319 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); |
| 1320 RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(executionC ontext, strArg, testInterfaceEmptyArg, exceptionState); | 1320 RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(executionC ontext, strArg, testInterfaceEmptyArg, exceptionState); |
| 1321 if (exceptionState.hadException()) { | 1321 if (exceptionState.hadException()) { |
| 1322 exceptionState.throwIfNeeded(); | 1322 exceptionState.throwIfNeeded(); |
| 1323 return; | 1323 return; |
| 1324 } | 1324 } |
| 1325 v8SetReturnValue(info, result.release()); | 1325 v8SetReturnValue(info, result.release()); |
| 1326 } | 1326 } |
| 1327 | 1327 |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2314 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 2314 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 2315 { | 2315 { |
| 2316 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; | 2316 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; |
| 2317 } | 2317 } |
| 2318 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 2318 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 2319 { | 2319 { |
| 2320 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; | 2320 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; |
| 2321 } | 2321 } |
| 2322 } // namespace blink | 2322 } // namespace blink |
| 2323 #endif // ENABLE(CONDITION) | 2323 #endif // ENABLE(CONDITION) |
| OLD | NEW |