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 #include "V8TestObject.h" | 8 #include "V8TestObject.h" |
9 | 9 |
10 #include "bindings/core/v8/BindingSecurity.h" | 10 #include "bindings/core/v8/BindingSecurity.h" |
11 #include "bindings/core/v8/Dictionary.h" | 11 #include "bindings/core/v8/Dictionary.h" |
12 #include "bindings/core/v8/ExceptionState.h" | 12 #include "bindings/core/v8/ExceptionState.h" |
| 13 #include "bindings/core/v8/PrivateScriptRunner.h" |
13 #include "bindings/core/v8/ScriptCallStackFactory.h" | 14 #include "bindings/core/v8/ScriptCallStackFactory.h" |
14 #include "bindings/core/v8/ScriptPromise.h" | 15 #include "bindings/core/v8/ScriptPromise.h" |
15 #include "bindings/core/v8/ScriptState.h" | 16 #include "bindings/core/v8/ScriptState.h" |
16 #include "bindings/core/v8/ScriptValue.h" | 17 #include "bindings/core/v8/ScriptValue.h" |
17 #include "bindings/core/v8/SerializedScriptValue.h" | 18 #include "bindings/core/v8/SerializedScriptValue.h" |
18 #include "bindings/core/v8/V8AbstractEventListener.h" | 19 #include "bindings/core/v8/V8AbstractEventListener.h" |
19 #include "bindings/core/v8/V8DOMActivityLogger.h" | 20 #include "bindings/core/v8/V8DOMActivityLogger.h" |
20 #include "bindings/core/v8/V8DOMConfiguration.h" | 21 #include "bindings/core/v8/V8DOMConfiguration.h" |
21 #include "bindings/core/v8/V8EventListenerList.h" | 22 #include "bindings/core/v8/V8EventListenerList.h" |
22 #include "bindings/core/v8/V8HTMLCollection.h" | 23 #include "bindings/core/v8/V8HTMLCollection.h" |
(...skipping 23 matching lines...) Expand all Loading... |
46 #include "bindings/tests/v8/V8TestObject.h" | 47 #include "bindings/tests/v8/V8TestObject.h" |
47 #include "bindings/tests/v8/V8Window.h" | 48 #include "bindings/tests/v8/V8Window.h" |
48 #include "bindings/tests/v8/V8XPathNSResolver.h" | 49 #include "bindings/tests/v8/V8XPathNSResolver.h" |
49 #include "core/HTMLNames.h" | 50 #include "core/HTMLNames.h" |
50 #include "core/css/MediaQueryListListener.h" | 51 #include "core/css/MediaQueryListListener.h" |
51 #include "core/dom/ClassCollection.h" | 52 #include "core/dom/ClassCollection.h" |
52 #include "core/dom/ContextFeatures.h" | 53 #include "core/dom/ContextFeatures.h" |
53 #include "core/dom/Document.h" | 54 #include "core/dom/Document.h" |
54 #include "core/dom/TagCollection.h" | 55 #include "core/dom/TagCollection.h" |
55 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 56 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
| 57 #include "core/frame/LocalFrame.h" |
56 #include "core/frame/UseCounter.h" | 58 #include "core/frame/UseCounter.h" |
57 #include "core/html/HTMLCollection.h" | 59 #include "core/html/HTMLCollection.h" |
58 #include "core/html/HTMLFormControlsCollection.h" | 60 #include "core/html/HTMLFormControlsCollection.h" |
59 #include "core/html/HTMLTableRowsCollection.h" | 61 #include "core/html/HTMLTableRowsCollection.h" |
60 #include "core/inspector/ScriptArguments.h" | 62 #include "core/inspector/ScriptArguments.h" |
61 #include "platform/RuntimeEnabledFeatures.h" | 63 #include "platform/RuntimeEnabledFeatures.h" |
62 #include "platform/TraceEvent.h" | 64 #include "platform/TraceEvent.h" |
63 #include "wtf/GetPtr.h" | 65 #include "wtf/GetPtr.h" |
64 #include "wtf/RefPtr.h" | 66 #include "wtf/RefPtr.h" |
65 | 67 |
(...skipping 9553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9619 impl->voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(testInterfaceWil
lBeGarbageCollectedArrayArg); | 9621 impl->voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(testInterfaceWil
lBeGarbageCollectedArrayArg); |
9620 } | 9622 } |
9621 | 9623 |
9622 static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) | 9624 static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) |
9623 { | 9625 { |
9624 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 9626 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
9625 TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgM
ethod(info); | 9627 TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgM
ethod(info); |
9626 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 9628 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
9627 } | 9629 } |
9628 | 9630 |
| 9631 static bool voidMethodImplementedInPrivateScriptMethodImplementedInPrivateScript
(LocalFrame* frame, TestObject* holderImpl) |
| 9632 { |
| 9633 if (!frame) |
| 9634 return false; |
| 9635 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
| 9636 if (context.IsEmpty()) |
| 9637 return false; |
| 9638 ScriptState* scriptState = ScriptState::from(context); |
| 9639 if (!scriptState->executionContext()) |
| 9640 return false; |
| 9641 |
| 9642 ScriptState::Scope scope(scriptState); |
| 9643 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9644 |
| 9645 v8::Handle<v8::Value> *argv = 0; |
| 9646 // FIXME: Support exceptions thrown from Blink-in-JS. |
| 9647 v8::TryCatch block; |
| 9648 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl
ementedInPrivateScript", holder, 0, argv); |
| 9649 if (block.HasCaught()) |
| 9650 return false; |
| 9651 return true; |
| 9652 } |
| 9653 |
| 9654 static void voidMethodImplementedInPrivateScriptMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 9655 { |
| 9656 TestObject* impl = V8TestObject::toNative(info.Holder()); |
| 9657 voidMethodImplementedInPrivateScriptMethodImplementedInPrivateScript(toFrame
IfNotDetached(info.GetIsolate()->GetCurrentContext()), impl); |
| 9658 } |
| 9659 |
| 9660 static void voidMethodImplementedInPrivateScriptMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 9661 { |
| 9662 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 9663 TestObjectV8Internal::voidMethodImplementedInPrivateScriptMethod(info); |
| 9664 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 9665 } |
| 9666 |
| 9667 static bool shortMethodImplementedInPrivateScriptMethodImplementedInPrivateScrip
t(LocalFrame* frame, TestObject* holderImpl, int* result) |
| 9668 { |
| 9669 if (!frame) |
| 9670 return false; |
| 9671 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
| 9672 if (context.IsEmpty()) |
| 9673 return false; |
| 9674 ScriptState* scriptState = ScriptState::from(context); |
| 9675 if (!scriptState->executionContext()) |
| 9676 return false; |
| 9677 |
| 9678 ScriptState::Scope scope(scriptState); |
| 9679 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9680 |
| 9681 v8::Handle<v8::Value> *argv = 0; |
| 9682 // FIXME: Support exceptions thrown from Blink-in-JS. |
| 9683 v8::TryCatch block; |
| 9684 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); |
| 9685 if (block.HasCaught()) |
| 9686 return false; |
| 9687 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); |
| 9688 int cppValue = toInt16(v8Value, exceptionState); |
| 9689 if (block.HasCaught()) |
| 9690 return false; |
| 9691 *result = cppValue; |
| 9692 return true; |
| 9693 } |
| 9694 |
| 9695 static void shortMethodImplementedInPrivateScriptMethod(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 9696 { |
| 9697 TestObject* impl = V8TestObject::toNative(info.Holder()); |
| 9698 int result; |
| 9699 if (!shortMethodImplementedInPrivateScriptMethodImplementedInPrivateScript(t
oFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) |
| 9700 return; |
| 9701 v8SetReturnValueInt(info, result); |
| 9702 } |
| 9703 |
| 9704 static void shortMethodImplementedInPrivateScriptMethodCallback(const v8::Functi
onCallbackInfo<v8::Value>& info) |
| 9705 { |
| 9706 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 9707 TestObjectV8Internal::shortMethodImplementedInPrivateScriptMethod(info); |
| 9708 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 9709 } |
| 9710 |
| 9711 static bool shortMethodWithShortArgumentImplementedInPrivateScriptMethodImplemen
tedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, int value, int* re
sult) |
| 9712 { |
| 9713 if (!frame) |
| 9714 return false; |
| 9715 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
| 9716 if (context.IsEmpty()) |
| 9717 return false; |
| 9718 ScriptState* scriptState = ScriptState::from(context); |
| 9719 if (!scriptState->executionContext()) |
| 9720 return false; |
| 9721 |
| 9722 ScriptState::Scope scope(scriptState); |
| 9723 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9724 |
| 9725 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); |
| 9726 v8::Handle<v8::Value> argv[] = { valueHandle }; |
| 9727 // FIXME: Support exceptions thrown from Blink-in-JS. |
| 9728 v8::TryCatch block; |
| 9729 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde
r, 1, argv); |
| 9730 if (block.HasCaught()) |
| 9731 return false; |
| 9732 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); |
| 9733 int cppValue = toInt16(v8Value, exceptionState); |
| 9734 if (block.HasCaught()) |
| 9735 return false; |
| 9736 *result = cppValue; |
| 9737 return true; |
| 9738 } |
| 9739 |
| 9740 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v
8::FunctionCallbackInfo<v8::Value>& info) |
| 9741 { |
| 9742 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", info.Holder(), info.
GetIsolate()); |
| 9743 if (UNLIKELY(info.Length() < 1)) { |
| 9744 throwMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 9745 return; |
| 9746 } |
| 9747 TestObject* impl = V8TestObject::toNative(info.Holder()); |
| 9748 int value; |
| 9749 { |
| 9750 v8::TryCatch block; |
| 9751 V8RethrowTryCatchScope rethrow(block); |
| 9752 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value, toInt16(info[0], exceptionS
tate), exceptionState); |
| 9753 } |
| 9754 int result; |
| 9755 if (!shortMethodWithShortArgumentImplementedInPrivateScriptMethodImplemented
InPrivateScript(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), im
pl, value, &result)) |
| 9756 return; |
| 9757 v8SetReturnValueInt(info, result); |
| 9758 } |
| 9759 |
| 9760 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback
(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 9761 { |
| 9762 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 9763 TestObjectV8Internal::shortMethodWithShortArgumentImplementedInPrivateScript
Method(info); |
| 9764 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 9765 } |
| 9766 |
| 9767 static bool stringMethodWithStringArgumentImplementedInPrivateScriptMethodImplem
entedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, String value, St
ring* result) |
| 9768 { |
| 9769 if (!frame) |
| 9770 return false; |
| 9771 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
| 9772 if (context.IsEmpty()) |
| 9773 return false; |
| 9774 ScriptState* scriptState = ScriptState::from(context); |
| 9775 if (!scriptState->executionContext()) |
| 9776 return false; |
| 9777 |
| 9778 ScriptState::Scope scope(scriptState); |
| 9779 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9780 |
| 9781 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); |
| 9782 v8::Handle<v8::Value> argv[] = { valueHandle }; |
| 9783 // FIXME: Support exceptions thrown from Blink-in-JS. |
| 9784 v8::TryCatch block; |
| 9785 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol
der, 1, argv); |
| 9786 if (block.HasCaught()) |
| 9787 return false; |
| 9788 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
| 9789 V8StringResource<> cppValue = v8Value; |
| 9790 if (block.HasCaught()) |
| 9791 return false; |
| 9792 *result = cppValue; |
| 9793 return true; |
| 9794 } |
| 9795 |
| 9796 static void stringMethodWithStringArgumentImplementedInPrivateScriptMethod(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 9797 { |
| 9798 if (UNLIKELY(info.Length() < 1)) { |
| 9799 throwMinimumArityTypeErrorForMethod("stringMethodWithStringArgumentImple
mentedInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()); |
| 9800 return; |
| 9801 } |
| 9802 TestObject* impl = V8TestObject::toNative(info.Holder()); |
| 9803 V8StringResource<> value; |
| 9804 { |
| 9805 TOSTRING_VOID_INTERNAL(value, info[0]); |
| 9806 } |
| 9807 String result; |
| 9808 if (!stringMethodWithStringArgumentImplementedInPrivateScriptMethodImplement
edInPrivateScript(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()),
impl, value, &result)) |
| 9809 return; |
| 9810 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 9811 } |
| 9812 |
| 9813 static void stringMethodWithStringArgumentImplementedInPrivateScriptMethodCallba
ck(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 9814 { |
| 9815 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 9816 TestObjectV8Internal::stringMethodWithStringArgumentImplementedInPrivateScri
ptMethod(info); |
| 9817 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 9818 } |
| 9819 |
| 9820 static bool nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodImplemente
dInPrivateScript(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawP
tr<Node> value, RefPtrWillBeRawPtr<Node>* result) |
| 9821 { |
| 9822 if (!frame) |
| 9823 return false; |
| 9824 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
| 9825 if (context.IsEmpty()) |
| 9826 return false; |
| 9827 ScriptState* scriptState = ScriptState::from(context); |
| 9828 if (!scriptState->executionContext()) |
| 9829 return false; |
| 9830 |
| 9831 ScriptState::Scope scope(scriptState); |
| 9832 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9833 |
| 9834 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9835 v8::Handle<v8::Value> argv[] = { valueHandle }; |
| 9836 // FIXME: Support exceptions thrown from Blink-in-JS. |
| 9837 v8::TryCatch block; |
| 9838 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder,
1, argv); |
| 9839 if (block.HasCaught()) |
| 9840 return false; |
| 9841 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); |
| 9842 Node* cppValue = V8Node::toNativeWithTypeCheck(scriptState->isolate(), v8Val
ue); |
| 9843 if (block.HasCaught()) |
| 9844 return false; |
| 9845 *result = cppValue; |
| 9846 return true; |
| 9847 } |
| 9848 |
| 9849 static void nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 9850 { |
| 9851 if (UNLIKELY(info.Length() < 1)) { |
| 9852 throwMinimumArityTypeErrorForMethod("nodeMethodWithNodeArgumentImplement
edInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()); |
| 9853 return; |
| 9854 } |
| 9855 TestObject* impl = V8TestObject::toNative(info.Holder()); |
| 9856 Node* value; |
| 9857 { |
| 9858 v8::TryCatch block; |
| 9859 V8RethrowTryCatchScope rethrow(block); |
| 9860 TONATIVE_VOID_INTERNAL(value, V8Node::toNativeWithTypeCheck(info.GetIsol
ate(), info[0])); |
| 9861 } |
| 9862 RefPtrWillBeRawPtr<Node> result; |
| 9863 if (!nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodImplementedIn
PrivateScript(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl
, value, &result)) |
| 9864 return; |
| 9865 v8SetReturnValue(info, result.release()); |
| 9866 } |
| 9867 |
| 9868 static void nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodCallback(c
onst v8::FunctionCallbackInfo<v8::Value>& info) |
| 9869 { |
| 9870 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 9871 TestObjectV8Internal::nodeMethodWithNodeArgumentImplementedInPrivateScriptMe
thod(info); |
| 9872 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 9873 } |
| 9874 |
| 9875 static bool nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodImplem
entedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBe
RawPtr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1, double
value2, String string, RefPtrWillBeRawPtr<Node>* result) |
| 9876 { |
| 9877 if (!frame) |
| 9878 return false; |
| 9879 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
| 9880 if (context.IsEmpty()) |
| 9881 return false; |
| 9882 ScriptState* scriptState = ScriptState::from(context); |
| 9883 if (!scriptState->executionContext()) |
| 9884 return false; |
| 9885 |
| 9886 ScriptState::Scope scope(scriptState); |
| 9887 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 9888 |
| 9889 v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()
->Global(), scriptState->isolate()); |
| 9890 v8::Handle<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global
(), scriptState->isolate()); |
| 9891 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); |
| 9892 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); |
| 9893 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string
); |
| 9894 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v
alue2Handle, stringHandle }; |
| 9895 // FIXME: Support exceptions thrown from Blink-in-JS. |
| 9896 v8::TryCatch block; |
| 9897 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol
der, 5, argv); |
| 9898 if (block.HasCaught()) |
| 9899 return false; |
| 9900 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
| 9901 Node* cppValue = V8Node::toNativeWithTypeCheck(scriptState->isolate(), v8Val
ue); |
| 9902 if (block.HasCaught()) |
| 9903 return false; |
| 9904 *result = cppValue; |
| 9905 return true; |
| 9906 } |
| 9907 |
| 9908 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 9909 { |
| 9910 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", info.Holder(), inf
o.GetIsolate()); |
| 9911 if (UNLIKELY(info.Length() < 5)) { |
| 9912 throwMinimumArityTypeError(exceptionState, 5, info.Length()); |
| 9913 return; |
| 9914 } |
| 9915 TestObject* impl = V8TestObject::toNative(info.Holder()); |
| 9916 Document* document; |
| 9917 Node* node; |
| 9918 int value1; |
| 9919 double value2; |
| 9920 V8StringResource<> string; |
| 9921 { |
| 9922 v8::TryCatch block; |
| 9923 V8RethrowTryCatchScope rethrow(block); |
| 9924 TONATIVE_VOID_INTERNAL(document, V8Document::toNativeWithTypeCheck(info.
GetIsolate(), info[0])); |
| 9925 TONATIVE_VOID_INTERNAL(node, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), info[1])); |
| 9926 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value1, toInt16(info[2], exception
State), exceptionState); |
| 9927 TONATIVE_VOID_INTERNAL(value2, static_cast<double>(info[3]->NumberValue(
))); |
| 9928 TOSTRING_VOID_INTERNAL(string, info[4]); |
| 9929 } |
| 9930 RefPtrWillBeRawPtr<Node> result; |
| 9931 if (!nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodImplement
edInPrivateScript(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()),
impl, document, node, value1, value2, string, &result)) |
| 9932 return; |
| 9933 v8SetReturnValue(info, result.release()); |
| 9934 } |
| 9935 |
| 9936 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodCallba
ck(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 9937 { |
| 9938 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 9939 TestObjectV8Internal::nodeMethodWithVariousArgumentsImplementedInPrivateScri
ptMethod(info); |
| 9940 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 9941 } |
| 9942 |
9629 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 9943 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
9630 { | 9944 { |
9631 TestObject* impl = V8TestObject::toNative(info.Holder()); | 9945 TestObject* impl = V8TestObject::toNative(info.Holder()); |
9632 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate()
); | 9946 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate()
); |
9633 } | 9947 } |
9634 | 9948 |
9635 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 9949 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
9636 { | 9950 { |
9637 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 9951 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
9638 TestObjectV8Internal::toStringMethod(info); | 9952 TestObjectV8Internal::toStringMethod(info); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9990 {"treatReturnedNullStringAsUndefinedByteStringMethod", TestObjectV8Internal:
:treatReturnedNullStringAsUndefinedByteStringMethodMethodCallback, 0, 0}, | 10304 {"treatReturnedNullStringAsUndefinedByteStringMethod", TestObjectV8Internal:
:treatReturnedNullStringAsUndefinedByteStringMethodMethodCallback, 0, 0}, |
9991 {"treatReturnedNullStringAsNullScalarValueStringMethod", TestObjectV8Interna
l::treatReturnedNullStringAsNullScalarValueStringMethodMethodCallback, 0, 0}, | 10305 {"treatReturnedNullStringAsNullScalarValueStringMethod", TestObjectV8Interna
l::treatReturnedNullStringAsNullScalarValueStringMethodMethodCallback, 0, 0}, |
9992 {"treatReturnedNullStringAsUndefinedScalarValueStringMethod", TestObjectV8In
ternal::treatReturnedNullStringAsUndefinedScalarValueStringMethodMethodCallback,
0, 0}, | 10306 {"treatReturnedNullStringAsUndefinedScalarValueStringMethod", TestObjectV8In
ternal::treatReturnedNullStringAsUndefinedScalarValueStringMethodMethodCallback,
0, 0}, |
9993 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", TestObjectV8Interna
l::typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, | 10307 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", TestObjectV8Interna
l::typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, |
9994 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg", TestObjectV
8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethodCal
lback, 0, 0}, | 10308 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg", TestObjectV
8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethodCal
lback, 0, 0}, |
9995 {"typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", TestObjectV8Internal
::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback, 0, 2}, | 10309 {"typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", TestObjectV8Internal
::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback, 0, 2}, |
9996 {"voidMethodTestInterfaceGarbageCollectedSequenceArg", TestObjectV8Internal:
:voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback, 0, 1}, | 10310 {"voidMethodTestInterfaceGarbageCollectedSequenceArg", TestObjectV8Internal:
:voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback, 0, 1}, |
9997 {"voidMethodTestInterfaceGarbageCollectedArrayArg", TestObjectV8Internal::vo
idMethodTestInterfaceGarbageCollectedArrayArgMethodCallback, 0, 1}, | 10311 {"voidMethodTestInterfaceGarbageCollectedArrayArg", TestObjectV8Internal::vo
idMethodTestInterfaceGarbageCollectedArrayArgMethodCallback, 0, 1}, |
9998 {"voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", TestObjectV8Int
ernal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback, 0
, 1}, | 10312 {"voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", TestObjectV8Int
ernal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback, 0
, 1}, |
9999 {"voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", TestObjectV8Intern
al::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback, 0, 1}, | 10313 {"voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", TestObjectV8Intern
al::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback, 0, 1}, |
| 10314 {"voidMethodImplementedInPrivateScript", TestObjectV8Internal::voidMethodImp
lementedInPrivateScriptMethodCallback, 0, 0}, |
| 10315 {"shortMethodImplementedInPrivateScript", TestObjectV8Internal::shortMethodI
mplementedInPrivateScriptMethodCallback, 0, 0}, |
| 10316 {"shortMethodWithShortArgumentImplementedInPrivateScript", TestObjectV8Inter
nal::shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback, 0, 1}
, |
| 10317 {"stringMethodWithStringArgumentImplementedInPrivateScript", TestObjectV8Int
ernal::stringMethodWithStringArgumentImplementedInPrivateScriptMethodCallback, 0
, 1}, |
| 10318 {"nodeMethodWithNodeArgumentImplementedInPrivateScript", TestObjectV8Interna
l::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodCallback, 0, 1}, |
| 10319 {"nodeMethodWithVariousArgumentsImplementedInPrivateScript", TestObjectV8Int
ernal::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodCallback, 0
, 5}, |
10000 {"toString", TestObjectV8Internal::toStringMethodCallback, 0, 0}, | 10320 {"toString", TestObjectV8Internal::toStringMethodCallback, 0, 0}, |
10001 }; | 10321 }; |
10002 | 10322 |
10003 static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> funct
ionTemplate, v8::Isolate* isolate) | 10323 static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> funct
ionTemplate, v8::Isolate* isolate) |
10004 { | 10324 { |
10005 functionTemplate->ReadOnlyPrototype(); | 10325 functionTemplate->ReadOnlyPrototype(); |
10006 | 10326 |
10007 v8::Local<v8::Signature> defaultSignature; | 10327 v8::Local<v8::Signature> defaultSignature; |
10008 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestObject", v8::Local<v8::FunctionTemplate>(), V8TestObject::internalFiel
dCount, | 10328 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestObject", v8::Local<v8::FunctionTemplate>(), V8TestObject::internalFiel
dCount, |
10009 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), | 10329 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10193 fromInternalPointer(object)->deref(); | 10513 fromInternalPointer(object)->deref(); |
10194 } | 10514 } |
10195 | 10515 |
10196 template<> | 10516 template<> |
10197 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) | 10517 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) |
10198 { | 10518 { |
10199 return toV8(impl, creationContext, isolate); | 10519 return toV8(impl, creationContext, isolate); |
10200 } | 10520 } |
10201 | 10521 |
10202 } // namespace WebCore | 10522 } // namespace WebCore |
OLD | NEW |