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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 551 |
552 static void implementsMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 552 static void implementsMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
553 { | 553 { |
554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
555 TestInterfaceV8Internal::implementsMethod1Method(info); | 555 TestInterfaceV8Internal::implementsMethod1Method(info); |
556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
557 } | 557 } |
558 | 558 |
559 static void implementsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 559 static void implementsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
560 { | 560 { |
| 561 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsM
ethod2", "TestInterface", info.Holder(), info.GetIsolate()); |
561 if (UNLIKELY(info.Length() < 2)) { | 562 if (UNLIKELY(info.Length() < 2)) { |
562 throwTypeError(ExceptionMessages::failedToExecute("implementsMethod2", "
TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); | 563 throwTypeError(ExceptionMessages::failedToExecute("implementsMethod2", "
TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
563 return; | 564 return; |
564 } | 565 } |
565 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 566 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
566 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
567 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 567 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
568 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 568 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); |
569 ExecutionContext* scriptContext = getExecutionContext(); | 569 ExecutionContext* scriptContext = getExecutionContext(); |
570 RefPtr<TestObj> result = TestImplements::implementsMethod2(scriptContext, im
p, strArg, objArg, exceptionState); | 570 RefPtr<TestObj> result = TestImplements::implementsMethod2(scriptContext, im
p, strArg, objArg, exceptionState); |
571 if (exceptionState.throwIfNeeded()) | 571 if (exceptionState.throwIfNeeded()) |
572 return; | 572 return; |
573 v8SetReturnValue(info, result.release()); | 573 v8SetReturnValue(info, result.release()); |
574 } | 574 } |
575 | 575 |
576 static void implementsMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 576 static void implementsMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 { | 612 { |
613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
614 TestInterfaceV8Internal::supplementalMethod1Method(info); | 614 TestInterfaceV8Internal::supplementalMethod1Method(info); |
615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
616 } | 616 } |
617 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 617 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
618 | 618 |
619 #if ENABLE(Condition11) || ENABLE(Condition12) | 619 #if ENABLE(Condition11) || ENABLE(Condition12) |
620 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 620 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
621 { | 621 { |
| 622 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "TestInterface", info.Holder(), info.GetIsolate()); |
622 if (UNLIKELY(info.Length() < 2)) { | 623 if (UNLIKELY(info.Length() < 2)) { |
623 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2",
"TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info
.GetIsolate()); | 624 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2",
"TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info
.GetIsolate()); |
624 return; | 625 return; |
625 } | 626 } |
626 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 627 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
627 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
628 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 628 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
629 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 629 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); |
630 ExecutionContext* scriptContext = getExecutionContext(); | 630 ExecutionContext* scriptContext = getExecutionContext(); |
631 RefPtr<TestObj> result = TestPartialInterface::supplementalMethod2(scriptCon
text, imp, strArg, objArg, exceptionState); | 631 RefPtr<TestObj> result = TestPartialInterface::supplementalMethod2(scriptCon
text, imp, strArg, objArg, exceptionState); |
632 if (exceptionState.throwIfNeeded()) | 632 if (exceptionState.throwIfNeeded()) |
633 return; | 633 return; |
634 v8SetReturnValue(info, result.release()); | 634 v8SetReturnValue(info, result.release()); |
635 } | 635 } |
636 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 636 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
637 | 637 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 } | 988 } |
989 | 989 |
990 template<> | 990 template<> |
991 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 991 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
992 { | 992 { |
993 return toV8(impl, creationContext, isolate); | 993 return toV8(impl, creationContext, isolate); |
994 } | 994 } |
995 | 995 |
996 } // namespace WebCore | 996 } // namespace WebCore |
997 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 997 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
OLD | NEW |