| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 static void Node15AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 539 static void Node15AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 540 { | 540 { |
| 541 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 541 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 542 TestInterfaceV8Internal::Node15AttributeSetter(jsValue, info); | 542 TestInterfaceV8Internal::Node15AttributeSetter(jsValue, info); |
| 543 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 543 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 544 } | 544 } |
| 545 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 545 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| 546 | 546 |
| 547 static void implementsMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 547 static void implementsMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 548 { | 548 { |
| 549 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsM
ethod1", "TestInterface", info.Holder(), info.GetIsolate()); |
| 549 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 550 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 550 TestImplements::implementsMethod1(imp); | 551 TestImplements::implementsMethod1(imp); |
| 551 } | 552 } |
| 552 | 553 |
| 553 static void implementsMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 554 static void implementsMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 554 { | 555 { |
| 555 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 556 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 556 TestInterfaceV8Internal::implementsMethod1Method(info); | 557 TestInterfaceV8Internal::implementsMethod1Method(info); |
| 557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 558 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 558 } | 559 } |
| 559 | 560 |
| 560 static void implementsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 561 static void implementsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 561 { | 562 { |
| 563 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsM
ethod2", "TestInterface", info.Holder(), info.GetIsolate()); |
| 562 if (UNLIKELY(info.Length() < 2)) { | 564 if (UNLIKELY(info.Length() < 2)) { |
| 563 throwTypeError(ExceptionMessages::failedToExecute("implementsMethod2", "
TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); | 565 throwTypeError(ExceptionMessages::failedToExecute("implementsMethod2", "
TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
| 564 return; | 566 return; |
| 565 } | 567 } |
| 566 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 568 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 567 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
| 568 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 569 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 569 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 570 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); |
| 570 ExecutionContext* scriptContext = getExecutionContext(); | 571 ExecutionContext* scriptContext = getExecutionContext(); |
| 571 RefPtr<TestObj> result = TestImplements::implementsMethod2(scriptContext, im
p, strArg, objArg, exceptionState); | 572 RefPtr<TestObj> result = TestImplements::implementsMethod2(scriptContext, im
p, strArg, objArg, exceptionState); |
| 572 if (exceptionState.throwIfNeeded()) | 573 if (exceptionState.throwIfNeeded()) |
| 573 return; | 574 return; |
| 574 v8SetReturnValue(info, result.release()); | 575 v8SetReturnValue(info, result.release()); |
| 575 } | 576 } |
| 576 | 577 |
| 577 static void implementsMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 578 static void implementsMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 578 { | 579 { |
| 579 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 580 TestInterfaceV8Internal::implementsMethod2Method(info); | 581 TestInterfaceV8Internal::implementsMethod2Method(info); |
| 581 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 582 } | 583 } |
| 583 | 584 |
| 584 static void implementsMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 585 static void implementsMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 585 { | 586 { |
| 586 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 587 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 587 V8TestInterface::implementsMethod3MethodCustom(info); | 588 V8TestInterface::implementsMethod3MethodCustom(info); |
| 588 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 589 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 589 } | 590 } |
| 590 | 591 |
| 591 static void implementsMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 592 static void implementsMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 592 { | 593 { |
| 594 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsM
ethod4", "TestInterface", info.Holder(), info.GetIsolate()); |
| 593 TestImplements::implementsMethod4(); | 595 TestImplements::implementsMethod4(); |
| 594 } | 596 } |
| 595 | 597 |
| 596 static void implementsMethod4MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 598 static void implementsMethod4MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 597 { | 599 { |
| 598 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 600 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 599 TestInterfaceV8Internal::implementsMethod4Method(info); | 601 TestInterfaceV8Internal::implementsMethod4Method(info); |
| 600 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 602 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 601 } | 603 } |
| 602 | 604 |
| 603 #if ENABLE(Condition11) || ENABLE(Condition12) | 605 #if ENABLE(Condition11) || ENABLE(Condition12) |
| 604 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 606 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 605 { | 607 { |
| 608 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod1", "TestInterface", info.Holder(), info.GetIsolate()); |
| 606 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 609 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 607 TestPartialInterface::supplementalMethod1(imp); | 610 TestPartialInterface::supplementalMethod1(imp); |
| 608 } | 611 } |
| 609 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 612 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| 610 | 613 |
| 611 #if ENABLE(Condition11) || ENABLE(Condition12) | 614 #if ENABLE(Condition11) || ENABLE(Condition12) |
| 612 static void supplementalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 615 static void supplementalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 613 { | 616 { |
| 614 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 617 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 615 TestInterfaceV8Internal::supplementalMethod1Method(info); | 618 TestInterfaceV8Internal::supplementalMethod1Method(info); |
| 616 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 619 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 617 } | 620 } |
| 618 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 621 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| 619 | 622 |
| 620 #if ENABLE(Condition11) || ENABLE(Condition12) | 623 #if ENABLE(Condition11) || ENABLE(Condition12) |
| 621 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 624 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 622 { | 625 { |
| 626 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "TestInterface", info.Holder(), info.GetIsolate()); |
| 623 if (UNLIKELY(info.Length() < 2)) { | 627 if (UNLIKELY(info.Length() < 2)) { |
| 624 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2",
"TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info
.GetIsolate()); | 628 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2",
"TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info
.GetIsolate()); |
| 625 return; | 629 return; |
| 626 } | 630 } |
| 627 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 631 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 628 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
| 629 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 632 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 630 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 633 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); |
| 631 ExecutionContext* scriptContext = getExecutionContext(); | 634 ExecutionContext* scriptContext = getExecutionContext(); |
| 632 RefPtr<TestObj> result = TestPartialInterface::supplementalMethod2(scriptCon
text, imp, strArg, objArg, exceptionState); | 635 RefPtr<TestObj> result = TestPartialInterface::supplementalMethod2(scriptCon
text, imp, strArg, objArg, exceptionState); |
| 633 if (exceptionState.throwIfNeeded()) | 636 if (exceptionState.throwIfNeeded()) |
| 634 return; | 637 return; |
| 635 v8SetReturnValue(info, result.release()); | 638 v8SetReturnValue(info, result.release()); |
| 636 } | 639 } |
| 637 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 640 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| 638 | 641 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 650 { | 653 { |
| 651 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 654 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 652 V8TestInterface::supplementalMethod3MethodCustom(info); | 655 V8TestInterface::supplementalMethod3MethodCustom(info); |
| 653 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 656 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 654 } | 657 } |
| 655 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 658 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| 656 | 659 |
| 657 #if ENABLE(Condition11) || ENABLE(Condition12) | 660 #if ENABLE(Condition11) || ENABLE(Condition12) |
| 658 static void supplementalMethod4Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 661 static void supplementalMethod4Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 659 { | 662 { |
| 663 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod4", "TestInterface", info.Holder(), info.GetIsolate()); |
| 660 TestPartialInterface::supplementalMethod4(); | 664 TestPartialInterface::supplementalMethod4(); |
| 661 } | 665 } |
| 662 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 666 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| 663 | 667 |
| 664 #if ENABLE(Condition11) || ENABLE(Condition12) | 668 #if ENABLE(Condition11) || ENABLE(Condition12) |
| 665 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 669 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 666 { | 670 { |
| 667 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 671 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 668 TestInterfaceV8Internal::supplementalMethod4Method(info); | 672 TestInterfaceV8Internal::supplementalMethod4Method(info); |
| 669 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 673 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 993 } |
| 990 | 994 |
| 991 template<> | 995 template<> |
| 992 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 996 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 993 { | 997 { |
| 994 return toV8(impl, creationContext, isolate); | 998 return toV8(impl, creationContext, isolate); |
| 995 } | 999 } |
| 996 | 1000 |
| 997 } // namespace WebCore | 1001 } // namespace WebCore |
| 998 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 1002 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| OLD | NEW |