| OLD | NEW |
| 1 /* | 1 /* |
| 2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| (...skipping 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 static void TestObjReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2761 static void TestObjReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 2762 { | 2762 { |
| 2763 info.This()->ForceSet(name, jsValue); | 2763 info.This()->ForceSet(name, jsValue); |
| 2764 } | 2764 } |
| 2765 | 2765 |
| 2766 static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2766 static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 2767 { | 2767 { |
| 2768 TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info); | 2768 TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info); |
| 2769 } | 2769 } |
| 2770 | 2770 |
| 2771 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 2771 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 2772 { | 2772 { |
| 2773 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2773 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2774 imp->voidMethod(); | 2774 imp->voidMethod(); |
| 2775 } | 2775 } |
| 2776 | 2776 |
| 2777 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
args) | 2777 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 2778 { | 2778 { |
| 2779 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2779 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2780 TestObjV8Internal::voidMethodMethod(args); | 2780 TestObjV8Internal::voidMethodMethod(info); |
| 2781 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2781 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2782 } | 2782 } |
| 2783 | 2783 |
| 2784 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 2784 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 2785 { | 2785 { |
| 2786 if (UNLIKELY(args.Length() < 3)) { | 2786 if (UNLIKELY(info.Length() < 3)) { |
| 2787 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, args.Length())), args.Get
Isolate()); | 2787 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); |
| 2788 return; | 2788 return; |
| 2789 } | 2789 } |
| 2790 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2790 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2791 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 2791 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 2792 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); | 2792 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 2793 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[2])) : 0); | 2793 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); |
| 2794 imp->voidMethodWithArgs(longArg, strArg, objArg); | 2794 imp->voidMethodWithArgs(longArg, strArg, objArg); |
| 2795 } | 2795 } |
| 2796 | 2796 |
| 2797 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 2797 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 2798 { | 2798 { |
| 2799 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2799 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2800 TestObjV8Internal::voidMethodWithArgsMethod(args); | 2800 TestObjV8Internal::voidMethodWithArgsMethod(info); |
| 2801 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2801 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2802 } | 2802 } |
| 2803 | 2803 |
| 2804 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 2804 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 2805 { | 2805 { |
| 2806 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2806 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2807 v8SetReturnValueInt(args, imp->longMethod()); | 2807 v8SetReturnValueInt(info, imp->longMethod()); |
| 2808 } | 2808 } |
| 2809 | 2809 |
| 2810 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
args) | 2810 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 2811 { | 2811 { |
| 2812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2813 TestObjV8Internal::longMethodMethod(args); | 2813 TestObjV8Internal::longMethodMethod(info); |
| 2814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2815 } | 2815 } |
| 2816 | 2816 |
| 2817 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 2817 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 2818 { | 2818 { |
| 2819 if (UNLIKELY(args.Length() < 3)) { | 2819 if (UNLIKELY(info.Length() < 3)) { |
| 2820 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, args.Length())), args.Get
Isolate()); | 2820 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); |
| 2821 return; | 2821 return; |
| 2822 } | 2822 } |
| 2823 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2823 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2824 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 2824 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 2825 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); | 2825 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 2826 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[2])) : 0); | 2826 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); |
| 2827 v8SetReturnValueInt(args, imp->longMethodWithArgs(longArg, strArg, objArg)); | 2827 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg)); |
| 2828 } | 2828 } |
| 2829 | 2829 |
| 2830 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 2830 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 2831 { | 2831 { |
| 2832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2833 TestObjV8Internal::longMethodWithArgsMethod(args); | 2833 TestObjV8Internal::longMethodWithArgsMethod(info); |
| 2834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2835 } | 2835 } |
| 2836 | 2836 |
| 2837 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 2837 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 2838 { | 2838 { |
| 2839 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2839 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2840 v8SetReturnValue(args, imp->objMethod()); | 2840 v8SetReturnValue(info, imp->objMethod()); |
| 2841 } | 2841 } |
| 2842 | 2842 |
| 2843 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 2843 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 2844 { | 2844 { |
| 2845 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2845 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2846 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | 2846 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); |
| 2847 TestObjV8Internal::objMethodMethod(args); | 2847 TestObjV8Internal::objMethodMethod(info); |
| 2848 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2848 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2849 } | 2849 } |
| 2850 | 2850 |
| 2851 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 2851 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 2852 { | 2852 { |
| 2853 if (UNLIKELY(args.Length() < 3)) { | 2853 if (UNLIKELY(info.Length() < 3)) { |
| 2854 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetI
solate()); | 2854 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI
solate()); |
| 2855 return; | 2855 return; |
| 2856 } | 2856 } |
| 2857 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2857 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2858 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 2858 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 2859 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); | 2859 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 2860 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[2])) : 0); | 2860 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); |
| 2861 v8SetReturnValue(args, imp->objMethodWithArgs(longArg, strArg, objArg)); | 2861 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg)); |
| 2862 } | 2862 } |
| 2863 | 2863 |
| 2864 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& args) | 2864 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 2865 { | 2865 { |
| 2866 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2866 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2867 TestObjV8Internal::objMethodWithArgsMethod(args); | 2867 TestObjV8Internal::objMethodWithArgsMethod(info); |
| 2868 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2868 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2869 } | 2869 } |
| 2870 | 2870 |
| 2871 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& args) | 2871 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 2872 { | 2872 { |
| 2873 if (UNLIKELY(args.Length() < 1)) { | 2873 if (UNLIKELY(info.Length() < 1)) { |
| 2874 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.
GetIsolate()); | 2874 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
| 2875 return; | 2875 return; |
| 2876 } | 2876 } |
| 2877 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2877 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2878 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(args[0], 1, args.GetIsolate()))); | 2878 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); |
| 2879 imp->methodWithSequenceArg(sequenceArg); | 2879 imp->methodWithSequenceArg(sequenceArg); |
| 2880 } | 2880 } |
| 2881 | 2881 |
| 2882 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& args) | 2882 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 2883 { | 2883 { |
| 2884 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2884 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2885 TestObjV8Internal::methodWithSequenceArgMethod(args); | 2885 TestObjV8Internal::methodWithSequenceArgMethod(info); |
| 2886 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2886 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2887 } | 2887 } |
| 2888 | 2888 |
| 2889 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& args) | 2889 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 2890 { | 2890 { |
| 2891 if (UNLIKELY(args.Length() < 1)) { | 2891 if (UNLIKELY(info.Length() < 1)) { |
| 2892 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen
ce", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), arg
s.GetIsolate()); | 2892 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen
ce", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
| 2893 return; | 2893 return; |
| 2894 } | 2894 } |
| 2895 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2895 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2896 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 2896 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 2897 v8SetReturnValue(args, v8Array(imp->methodReturningSequence(longArg), args.G
etIsolate())); | 2897 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); |
| 2898 } | 2898 } |
| 2899 | 2899 |
| 2900 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& args) | 2900 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 2901 { | 2901 { |
| 2902 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2902 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2903 TestObjV8Internal::methodReturningSequenceMethod(args); | 2903 TestObjV8Internal::methodReturningSequenceMethod(info); |
| 2904 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2904 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2905 } | 2905 } |
| 2906 | 2906 |
| 2907 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 2907 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 2908 { | 2908 { |
| 2909 if (UNLIKELY(args.Length() < 1)) { | 2909 if (UNLIKELY(info.Length() < 1)) { |
| 2910 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetI
solate()); | 2910 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
| 2911 return; | 2911 return; |
| 2912 } | 2912 } |
| 2913 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2913 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2914 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, args[0]); | 2914 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); |
| 2915 String string = enumArg; | 2915 String string = enumArg; |
| 2916 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { | 2916 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { |
| 2917 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), args.
GetIsolate()); | 2917 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); |
| 2918 return; | 2918 return; |
| 2919 } | 2919 } |
| 2920 imp->methodWithEnumArg(enumArg); | 2920 imp->methodWithEnumArg(enumArg); |
| 2921 } | 2921 } |
| 2922 | 2922 |
| 2923 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& args) | 2923 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 2924 { | 2924 { |
| 2925 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2925 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2926 TestObjV8Internal::methodWithEnumArgMethod(args); | 2926 TestObjV8Internal::methodWithEnumArgMethod(info); |
| 2927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2928 } | 2928 } |
| 2929 | 2929 |
| 2930 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& args) | 2930 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 2931 { | 2931 { |
| 2932 if (UNLIKELY(args.Length() < 2)) { | 2932 if (UNLIKELY(info.Length() < 2)) { |
| 2933 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll
ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, args.Leng
th())), args.GetIsolate()); | 2933 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll
ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng
th())), info.GetIsolate()); |
| 2934 return; | 2934 return; |
| 2935 } | 2935 } |
| 2936 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2936 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2937 ExceptionState es(args.GetIsolate()); | 2937 ExceptionState es(info.GetIsolate()); |
| 2938 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 2938 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 2939 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[1], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[1])) : 0); | 2939 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); |
| 2940 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, es); | 2940 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, es); |
| 2941 if (es.throwIfNeeded()) | 2941 if (es.throwIfNeeded()) |
| 2942 return; | 2942 return; |
| 2943 v8SetReturnValue(args, result.release()); | 2943 v8SetReturnValue(info, result.release()); |
| 2944 } | 2944 } |
| 2945 | 2945 |
| 2946 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& args) | 2946 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 2947 { | 2947 { |
| 2948 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2948 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2949 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(args); | 2949 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
| 2950 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2950 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2951 } | 2951 } |
| 2952 | 2952 |
| 2953 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& arg
s) | 2953 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 2954 { | 2954 { |
| 2955 if (UNLIKELY(args.Length() < 1)) { | 2955 if (UNLIKELY(info.Length() < 1)) { |
| 2956 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te
stObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIso
late()); | 2956 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te
stObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIso
late()); |
| 2957 return; | 2957 return; |
| 2958 } | 2958 } |
| 2959 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2959 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2960 bool serializedArgDidThrow = false; | 2960 bool serializedArgDidThrow = false; |
| 2961 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
args[0], 0, 0, serializedArgDidThrow, args.GetIsolate()); | 2961 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, serializedArgDidThrow, info.GetIsolate()); |
| 2962 if (serializedArgDidThrow) | 2962 if (serializedArgDidThrow) |
| 2963 return; | 2963 return; |
| 2964 imp->serializedValue(serializedArg); | 2964 imp->serializedValue(serializedArg); |
| 2965 } | 2965 } |
| 2966 | 2966 |
| 2967 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& args) | 2967 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 2968 { | 2968 { |
| 2969 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2969 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2970 TestObjV8Internal::serializedValueMethod(args); | 2970 TestObjV8Internal::serializedValueMethod(info); |
| 2971 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2971 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2972 } | 2972 } |
| 2973 | 2973 |
| 2974 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 2974 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 2975 { | 2975 { |
| 2976 if (UNLIKELY(args.Length() < 1)) { | 2976 if (UNLIKELY(info.Length() < 1)) { |
| 2977 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola
te()); | 2977 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); |
| 2978 return; | 2978 return; |
| 2979 } | 2979 } |
| 2980 TestObj* imp = V8TestObject::toNative(args.Holder()); | 2980 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2981 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(args[0], args.GetIsolate())); | 2981 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); |
| 2982 if (!oo.isUndefinedOrNull() && !oo.isObject()) { | 2982 if (!oo.isUndefinedOrNull() && !oo.isObject()) { |
| 2983 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), args.GetIsolate()); | 2983 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); |
| 2984 return; | 2984 return; |
| 2985 } | 2985 } |
| 2986 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(args[1], args.GetIsolate())); | 2986 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); |
| 2987 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { | 2987 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { |
| 2988 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), args.GetIsolate()); | 2988 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); |
| 2989 return; | 2989 return; |
| 2990 } | 2990 } |
| 2991 imp->optionsObject(oo, ooo); | 2991 imp->optionsObject(oo, ooo); |
| 2992 } | 2992 } |
| 2993 | 2993 |
| 2994 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& args) | 2994 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 2995 { | 2995 { |
| 2996 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2996 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 2997 TestObjV8Internal::optionsObjectMethod(args); | 2997 TestObjV8Internal::optionsObjectMethod(info); |
| 2998 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2998 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 2999 } | 2999 } |
| 3000 | 3000 |
| 3001 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3001 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3002 { | 3002 { |
| 3003 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3003 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3004 ExceptionState es(args.GetIsolate()); | 3004 ExceptionState es(info.GetIsolate()); |
| 3005 imp->methodWithException(es); | 3005 imp->methodWithException(es); |
| 3006 if (es.throwIfNeeded()) | 3006 if (es.throwIfNeeded()) |
| 3007 return; | 3007 return; |
| 3008 } | 3008 } |
| 3009 | 3009 |
| 3010 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3010 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3011 { | 3011 { |
| 3012 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3012 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3013 TestObjV8Internal::methodWithExceptionMethod(args); | 3013 TestObjV8Internal::methodWithExceptionMethod(info); |
| 3014 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3014 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3015 } | 3015 } |
| 3016 | 3016 |
| 3017 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& args) | 3017 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 3018 { | 3018 { |
| 3019 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3019 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3020 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); | 3020 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); |
| 3021 V8TestObject::customMethodMethodCustom(args); | 3021 V8TestObject::customMethodMethodCustom(info); |
| 3022 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3022 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3023 } | 3023 } |
| 3024 | 3024 |
| 3025 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 3025 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 3026 { | 3026 { |
| 3027 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3027 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3028 V8TestObject::customMethodWithArgsMethodCustom(args); | 3028 V8TestObject::customMethodWithArgsMethodCustom(info); |
| 3029 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3029 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3030 } | 3030 } |
| 3031 | 3031 |
| 3032 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 3032 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 3033 { | 3033 { |
| 3034 EventTarget* impl = V8TestObject::toNative(args.Holder()); | 3034 EventTarget* impl = V8TestObject::toNative(info.Holder()); |
| 3035 if (DOMWindow* window = impl->toDOMWindow()) { | 3035 if (DOMWindow* window = impl->toDOMWindow()) { |
| 3036 ExceptionState es(args.GetIsolate()); | 3036 ExceptionState es(info.GetIsolate()); |
| 3037 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { | 3037 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { |
| 3038 es.throwIfNeeded(); | 3038 es.throwIfNeeded(); |
| 3039 return; | 3039 return; |
| 3040 } | 3040 } |
| 3041 | 3041 |
| 3042 if (!window->document()) | 3042 if (!window->document()) |
| 3043 return; | 3043 return; |
| 3044 } | 3044 } |
| 3045 | 3045 |
| 3046 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOrCreate); | 3046 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); |
| 3047 if (listener) { | 3047 if (listener) { |
| 3048 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st
ringResource, args[0]); | 3048 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st
ringResource, info[0]); |
| 3049 impl->addEventListener(stringResource, listener, args[2]->BooleanValue()
); | 3049 impl->addEventListener(stringResource, listener, info[2]->BooleanValue()
); |
| 3050 if (!impl->toNode()) | 3050 if (!impl->toNode()) |
| 3051 createHiddenDependency(args.Holder(), args[1], V8TestObject::eventLi
stenerCacheIndex, args.GetIsolate()); | 3051 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); |
| 3052 } | 3052 } |
| 3053 } | 3053 } |
| 3054 | 3054 |
| 3055 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& args) | 3055 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 3056 { | 3056 { |
| 3057 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3057 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3058 TestObjV8Internal::addEventListenerMethod(args); | 3058 TestObjV8Internal::addEventListenerMethod(info); |
| 3059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3060 } | 3060 } |
| 3061 | 3061 |
| 3062 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3062 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3063 { | 3063 { |
| 3064 EventTarget* impl = V8TestObject::toNative(args.Holder()); | 3064 EventTarget* impl = V8TestObject::toNative(info.Holder()); |
| 3065 if (DOMWindow* window = impl->toDOMWindow()) { | 3065 if (DOMWindow* window = impl->toDOMWindow()) { |
| 3066 ExceptionState es(args.GetIsolate()); | 3066 ExceptionState es(info.GetIsolate()); |
| 3067 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { | 3067 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { |
| 3068 es.throwIfNeeded(); | 3068 es.throwIfNeeded(); |
| 3069 return; | 3069 return; |
| 3070 } | 3070 } |
| 3071 | 3071 |
| 3072 if (!window->document()) | 3072 if (!window->document()) |
| 3073 return; | 3073 return; |
| 3074 } | 3074 } |
| 3075 | 3075 |
| 3076 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOnly); | 3076 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); |
| 3077 if (listener) { | 3077 if (listener) { |
| 3078 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st
ringResource, args[0]); | 3078 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st
ringResource, info[0]); |
| 3079 impl->removeEventListener(stringResource, listener.get(), args[2]->Boole
anValue()); | 3079 impl->removeEventListener(stringResource, listener.get(), info[2]->Boole
anValue()); |
| 3080 if (!impl->toNode()) | 3080 if (!impl->toNode()) |
| 3081 removeHiddenDependency(args.Holder(), args[1], V8TestObject::eventLi
stenerCacheIndex, args.GetIsolate()); | 3081 removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); |
| 3082 } | 3082 } |
| 3083 } | 3083 } |
| 3084 | 3084 |
| 3085 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3085 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3086 { | 3086 { |
| 3087 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3087 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3088 TestObjV8Internal::removeEventListenerMethod(args); | 3088 TestObjV8Internal::removeEventListenerMethod(info); |
| 3089 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3089 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3090 } | 3090 } |
| 3091 | 3091 |
| 3092 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3092 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3093 { | 3093 { |
| 3094 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3094 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3095 ScriptState* currentState = ScriptState::current(); | 3095 ScriptState* currentState = ScriptState::current(); |
| 3096 if (!currentState) | 3096 if (!currentState) |
| 3097 return; | 3097 return; |
| 3098 ScriptState& state = *currentState; | 3098 ScriptState& state = *currentState; |
| 3099 imp->withScriptStateVoid(&state); | 3099 imp->withScriptStateVoid(&state); |
| 3100 if (state.hadException()) { | 3100 if (state.hadException()) { |
| 3101 v8::Local<v8::Value> exception = state.exception(); | 3101 v8::Local<v8::Value> exception = state.exception(); |
| 3102 state.clearException(); | 3102 state.clearException(); |
| 3103 throwError(exception, args.GetIsolate()); | 3103 throwError(exception, info.GetIsolate()); |
| 3104 return; | 3104 return; |
| 3105 } | 3105 } |
| 3106 } | 3106 } |
| 3107 | 3107 |
| 3108 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3108 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3109 { | 3109 { |
| 3110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3111 TestObjV8Internal::withScriptStateVoidMethod(args); | 3111 TestObjV8Internal::withScriptStateVoidMethod(info); |
| 3112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3113 } | 3113 } |
| 3114 | 3114 |
| 3115 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3115 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3116 { | 3116 { |
| 3117 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3117 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3118 ScriptState* currentState = ScriptState::current(); | 3118 ScriptState* currentState = ScriptState::current(); |
| 3119 if (!currentState) | 3119 if (!currentState) |
| 3120 return; | 3120 return; |
| 3121 ScriptState& state = *currentState; | 3121 ScriptState& state = *currentState; |
| 3122 RefPtr<TestObj> result = imp->withScriptStateObj(&state); | 3122 RefPtr<TestObj> result = imp->withScriptStateObj(&state); |
| 3123 if (state.hadException()) { | 3123 if (state.hadException()) { |
| 3124 v8::Local<v8::Value> exception = state.exception(); | 3124 v8::Local<v8::Value> exception = state.exception(); |
| 3125 state.clearException(); | 3125 state.clearException(); |
| 3126 throwError(exception, args.GetIsolate()); | 3126 throwError(exception, info.GetIsolate()); |
| 3127 return; | 3127 return; |
| 3128 } | 3128 } |
| 3129 v8SetReturnValue(args, result.release()); | 3129 v8SetReturnValue(info, result.release()); |
| 3130 } | 3130 } |
| 3131 | 3131 |
| 3132 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 3132 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3133 { | 3133 { |
| 3134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3135 TestObjV8Internal::withScriptStateObjMethod(args); | 3135 TestObjV8Internal::withScriptStateObjMethod(info); |
| 3136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3137 } | 3137 } |
| 3138 | 3138 |
| 3139 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8
::Value>& args) | 3139 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 3140 { | 3140 { |
| 3141 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3141 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3142 ExceptionState es(args.GetIsolate()); | 3142 ExceptionState es(info.GetIsolate()); |
| 3143 ScriptState* currentState = ScriptState::current(); | 3143 ScriptState* currentState = ScriptState::current(); |
| 3144 if (!currentState) | 3144 if (!currentState) |
| 3145 return; | 3145 return; |
| 3146 ScriptState& state = *currentState; | 3146 ScriptState& state = *currentState; |
| 3147 imp->withScriptStateVoidException(&state, es); | 3147 imp->withScriptStateVoidException(&state, es); |
| 3148 if (es.throwIfNeeded()) | 3148 if (es.throwIfNeeded()) |
| 3149 return; | 3149 return; |
| 3150 if (state.hadException()) { | 3150 if (state.hadException()) { |
| 3151 v8::Local<v8::Value> exception = state.exception(); | 3151 v8::Local<v8::Value> exception = state.exception(); |
| 3152 state.clearException(); | 3152 state.clearException(); |
| 3153 throwError(exception, args.GetIsolate()); | 3153 throwError(exception, info.GetIsolate()); |
| 3154 return; | 3154 return; |
| 3155 } | 3155 } |
| 3156 } | 3156 } |
| 3157 | 3157 |
| 3158 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& args) | 3158 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 3159 { | 3159 { |
| 3160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3161 TestObjV8Internal::withScriptStateVoidExceptionMethod(args); | 3161 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); |
| 3162 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3162 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3163 } | 3163 } |
| 3164 | 3164 |
| 3165 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3165 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3166 { | 3166 { |
| 3167 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3167 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3168 ExceptionState es(args.GetIsolate()); | 3168 ExceptionState es(info.GetIsolate()); |
| 3169 ScriptState* currentState = ScriptState::current(); | 3169 ScriptState* currentState = ScriptState::current(); |
| 3170 if (!currentState) | 3170 if (!currentState) |
| 3171 return; | 3171 return; |
| 3172 ScriptState& state = *currentState; | 3172 ScriptState& state = *currentState; |
| 3173 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, es); | 3173 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, es); |
| 3174 if (es.throwIfNeeded()) | 3174 if (es.throwIfNeeded()) |
| 3175 return; | 3175 return; |
| 3176 if (state.hadException()) { | 3176 if (state.hadException()) { |
| 3177 v8::Local<v8::Value> exception = state.exception(); | 3177 v8::Local<v8::Value> exception = state.exception(); |
| 3178 state.clearException(); | 3178 state.clearException(); |
| 3179 throwError(exception, args.GetIsolate()); | 3179 throwError(exception, info.GetIsolate()); |
| 3180 return; | 3180 return; |
| 3181 } | 3181 } |
| 3182 v8SetReturnValue(args, result.release()); | 3182 v8SetReturnValue(info, result.release()); |
| 3183 } | 3183 } |
| 3184 | 3184 |
| 3185 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 3185 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3186 { | 3186 { |
| 3187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3188 TestObjV8Internal::withScriptStateObjExceptionMethod(args); | 3188 TestObjV8Internal::withScriptStateObjExceptionMethod(info); |
| 3189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3190 } | 3190 } |
| 3191 | 3191 |
| 3192 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>
& args) | 3192 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 3193 { | 3193 { |
| 3194 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3194 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3195 ExecutionContext* scriptContext = getExecutionContext(); | 3195 ExecutionContext* scriptContext = getExecutionContext(); |
| 3196 imp->withExecutionContext(scriptContext); | 3196 imp->withExecutionContext(scriptContext); |
| 3197 } | 3197 } |
| 3198 | 3198 |
| 3199 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 3199 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 3200 { | 3200 { |
| 3201 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3201 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3202 TestObjV8Internal::withExecutionContextMethod(args); | 3202 TestObjV8Internal::withExecutionContextMethod(info); |
| 3203 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3203 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3204 } | 3204 } |
| 3205 | 3205 |
| 3206 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackI
nfo<v8::Value>& args) | 3206 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 3207 { | 3207 { |
| 3208 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3208 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3209 ScriptState* currentState = ScriptState::current(); | 3209 ScriptState* currentState = ScriptState::current(); |
| 3210 if (!currentState) | 3210 if (!currentState) |
| 3211 return; | 3211 return; |
| 3212 ScriptState& state = *currentState; | 3212 ScriptState& state = *currentState; |
| 3213 ExecutionContext* scriptContext = getExecutionContext(); | 3213 ExecutionContext* scriptContext = getExecutionContext(); |
| 3214 imp->withExecutionContextAndScriptState(&state, scriptContext); | 3214 imp->withExecutionContextAndScriptState(&state, scriptContext); |
| 3215 if (state.hadException()) { | 3215 if (state.hadException()) { |
| 3216 v8::Local<v8::Value> exception = state.exception(); | 3216 v8::Local<v8::Value> exception = state.exception(); |
| 3217 state.clearException(); | 3217 state.clearException(); |
| 3218 throwError(exception, args.GetIsolate()); | 3218 throwError(exception, info.GetIsolate()); |
| 3219 return; | 3219 return; |
| 3220 } | 3220 } |
| 3221 } | 3221 } |
| 3222 | 3222 |
| 3223 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& args) | 3223 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 3224 { | 3224 { |
| 3225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3226 TestObjV8Internal::withExecutionContextAndScriptStateMethod(args); | 3226 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); |
| 3227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3228 } | 3228 } |
| 3229 | 3229 |
| 3230 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct
ionCallbackInfo<v8::Value>& args) | 3230 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
| 3231 { | 3231 { |
| 3232 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3232 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3233 ExceptionState es(args.GetIsolate()); | 3233 ExceptionState es(info.GetIsolate()); |
| 3234 ScriptState* currentState = ScriptState::current(); | 3234 ScriptState* currentState = ScriptState::current(); |
| 3235 if (!currentState) | 3235 if (!currentState) |
| 3236 return; | 3236 return; |
| 3237 ScriptState& state = *currentState; | 3237 ScriptState& state = *currentState; |
| 3238 ExecutionContext* scriptContext = getExecutionContext(); | 3238 ExecutionContext* scriptContext = getExecutionContext(); |
| 3239 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException
(&state, scriptContext, es); | 3239 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException
(&state, scriptContext, es); |
| 3240 if (es.throwIfNeeded()) | 3240 if (es.throwIfNeeded()) |
| 3241 return; | 3241 return; |
| 3242 if (state.hadException()) { | 3242 if (state.hadException()) { |
| 3243 v8::Local<v8::Value> exception = state.exception(); | 3243 v8::Local<v8::Value> exception = state.exception(); |
| 3244 state.clearException(); | 3244 state.clearException(); |
| 3245 throwError(exception, args.GetIsolate()); | 3245 throwError(exception, info.GetIsolate()); |
| 3246 return; | 3246 return; |
| 3247 } | 3247 } |
| 3248 v8SetReturnValue(args, result.release()); | 3248 v8SetReturnValue(info, result.release()); |
| 3249 } | 3249 } |
| 3250 | 3250 |
| 3251 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& args) | 3251 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
| 3252 { | 3252 { |
| 3253 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3253 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3254 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(args
); | 3254 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info
); |
| 3255 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3255 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3256 } | 3256 } |
| 3257 | 3257 |
| 3258 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::Functio
nCallbackInfo<v8::Value>& args) | 3258 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 3259 { | 3259 { |
| 3260 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3260 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3261 ScriptState* currentState = ScriptState::current(); | 3261 ScriptState* currentState = ScriptState::current(); |
| 3262 if (!currentState) | 3262 if (!currentState) |
| 3263 return; | 3263 return; |
| 3264 ScriptState& state = *currentState; | 3264 ScriptState& state = *currentState; |
| 3265 ExecutionContext* scriptContext = getExecutionContext(); | 3265 ExecutionContext* scriptContext = getExecutionContext(); |
| 3266 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&
state, scriptContext); | 3266 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&
state, scriptContext); |
| 3267 if (state.hadException()) { | 3267 if (state.hadException()) { |
| 3268 v8::Local<v8::Value> exception = state.exception(); | 3268 v8::Local<v8::Value> exception = state.exception(); |
| 3269 state.clearException(); | 3269 state.clearException(); |
| 3270 throwError(exception, args.GetIsolate()); | 3270 throwError(exception, info.GetIsolate()); |
| 3271 return; | 3271 return; |
| 3272 } | 3272 } |
| 3273 v8SetReturnValue(args, result.release()); | 3273 v8SetReturnValue(info, result.release()); |
| 3274 } | 3274 } |
| 3275 | 3275 |
| 3276 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& args) | 3276 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 3277 { | 3277 { |
| 3278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3279 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(args); | 3279 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); |
| 3280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3281 } | 3281 } |
| 3282 | 3282 |
| 3283 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<
v8::Value>& args) | 3283 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 3284 { | 3284 { |
| 3285 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3285 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3286 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); | 3286 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); |
| 3287 } | 3287 } |
| 3288 | 3288 |
| 3289 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& args) | 3289 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 3290 { | 3290 { |
| 3291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3292 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(args); | 3292 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info); |
| 3293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3294 } | 3294 } |
| 3295 | 3295 |
| 3296 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& args) | 3296 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 3297 { | 3297 { |
| 3298 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3298 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3299 if (UNLIKELY(args.Length() <= 0)) { | 3299 if (UNLIKELY(info.Length() <= 0)) { |
| 3300 imp->methodWithOptionalArg(); | 3300 imp->methodWithOptionalArg(); |
| 3301 return; | 3301 return; |
| 3302 } | 3302 } |
| 3303 V8TRYCATCH_VOID(int, opt, toInt32(args[0])); | 3303 V8TRYCATCH_VOID(int, opt, toInt32(info[0])); |
| 3304 imp->methodWithOptionalArg(opt); | 3304 imp->methodWithOptionalArg(opt); |
| 3305 } | 3305 } |
| 3306 | 3306 |
| 3307 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& args) | 3307 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 3308 { | 3308 { |
| 3309 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3309 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3310 TestObjV8Internal::methodWithOptionalArgMethod(args); | 3310 TestObjV8Internal::methodWithOptionalArgMethod(info); |
| 3311 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3311 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3312 } | 3312 } |
| 3313 | 3313 |
| 3314 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& args) | 3314 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 3315 { | 3315 { |
| 3316 if (UNLIKELY(args.Length() < 1)) { | 3316 if (UNLIKELY(info.Length() < 1)) { |
| 3317 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, args.
Length())), args.GetIsolate()); | 3317 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); |
| 3318 return; | 3318 return; |
| 3319 } | 3319 } |
| 3320 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3320 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3321 V8TRYCATCH_VOID(int, nonOpt, toInt32(args[0])); | 3321 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
| 3322 if (UNLIKELY(args.Length() <= 1)) { | 3322 if (UNLIKELY(info.Length() <= 1)) { |
| 3323 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | 3323 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
| 3324 return; | 3324 return; |
| 3325 } | 3325 } |
| 3326 V8TRYCATCH_VOID(int, opt, toInt32(args[1])); | 3326 V8TRYCATCH_VOID(int, opt, toInt32(info[1])); |
| 3327 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | 3327 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
| 3328 } | 3328 } |
| 3329 | 3329 |
| 3330 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& args) | 3330 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
| 3331 { | 3331 { |
| 3332 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3332 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3333 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(args); | 3333 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); |
| 3334 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3334 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3335 } | 3335 } |
| 3336 | 3336 |
| 3337 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& args) | 3337 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 3338 { | 3338 { |
| 3339 if (UNLIKELY(args.Length() < 1)) { | 3339 if (UNLIKELY(info.Length() < 1)) { |
| 3340 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, a
rgs.Length())), args.GetIsolate()); | 3340 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, i
nfo.Length())), info.GetIsolate()); |
| 3341 return; | 3341 return; |
| 3342 } | 3342 } |
| 3343 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3343 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3344 V8TRYCATCH_VOID(int, nonOpt, toInt32(args[0])); | 3344 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
| 3345 if (UNLIKELY(args.Length() <= 1)) { | 3345 if (UNLIKELY(info.Length() <= 1)) { |
| 3346 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | 3346 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
| 3347 return; | 3347 return; |
| 3348 } | 3348 } |
| 3349 V8TRYCATCH_VOID(int, opt1, toInt32(args[1])); | 3349 V8TRYCATCH_VOID(int, opt1, toInt32(info[1])); |
| 3350 if (UNLIKELY(args.Length() <= 2)) { | 3350 if (UNLIKELY(info.Length() <= 2)) { |
| 3351 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); | 3351 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); |
| 3352 return; | 3352 return; |
| 3353 } | 3353 } |
| 3354 V8TRYCATCH_VOID(int, opt2, toInt32(args[2])); | 3354 V8TRYCATCH_VOID(int, opt2, toInt32(info[2])); |
| 3355 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); | 3355 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); |
| 3356 } | 3356 } |
| 3357 | 3357 |
| 3358 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::F
unctionCallbackInfo<v8::Value>& args) | 3358 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) |
| 3359 { | 3359 { |
| 3360 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3360 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3361 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(args); | 3361 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); |
| 3362 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3362 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3363 } | 3363 } |
| 3364 | 3364 |
| 3365 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& args) | 3365 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 3366 { | 3366 { |
| 3367 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3367 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3368 if (UNLIKELY(args.Length() <= 0)) { | 3368 if (UNLIKELY(info.Length() <= 0)) { |
| 3369 imp->methodWithOptionalString(); | 3369 imp->methodWithOptionalString(); |
| 3370 return; | 3370 return; |
| 3371 } | 3371 } |
| 3372 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, args[0]); | 3372 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| 3373 imp->methodWithOptionalString(str); | 3373 imp->methodWithOptionalString(str); |
| 3374 } | 3374 } |
| 3375 | 3375 |
| 3376 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& args) | 3376 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 3377 { | 3377 { |
| 3378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3379 TestObjV8Internal::methodWithOptionalStringMethod(args); | 3379 TestObjV8Internal::methodWithOptionalStringMethod(info); |
| 3380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3381 } | 3381 } |
| 3382 | 3382 |
| 3383 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallback
Info<v8::Value>& args) | 3383 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3384 { | 3384 { |
| 3385 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3385 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3386 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, args[0]); | 3386 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| 3387 imp->methodWithOptionalStringIsUndefined(str); | 3387 imp->methodWithOptionalStringIsUndefined(str); |
| 3388 } | 3388 } |
| 3389 | 3389 |
| 3390 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::Function
CallbackInfo<v8::Value>& args) | 3390 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
| 3391 { | 3391 { |
| 3392 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3392 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3393 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(args); | 3393 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info); |
| 3394 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3394 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3395 } | 3395 } |
| 3396 | 3396 |
| 3397 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbac
kInfo<v8::Value>& args) | 3397 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 3398 { | 3398 { |
| 3399 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3399 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3400 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull
(args, 0)); | 3400 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull
(info, 0)); |
| 3401 imp->methodWithOptionalStringIsNullString(str); | 3401 imp->methodWithOptionalStringIsNullString(str); |
| 3402 } | 3402 } |
| 3403 | 3403 |
| 3404 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& args) | 3404 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 3405 { | 3405 { |
| 3406 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3406 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3407 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(args); | 3407 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); |
| 3408 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3408 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3409 } | 3409 } |
| 3410 | 3410 |
| 3411 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& args) | 3411 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 3412 { | 3412 { |
| 3413 if (UNLIKELY(args.Length() < 1)) { | 3413 if (UNLIKELY(info.Length() < 1)) { |
| 3414 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.
GetIsolate()); | 3414 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
| 3415 return; | 3415 return; |
| 3416 } | 3416 } |
| 3417 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3417 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3418 if (args.Length() <= 0 || !args[0]->IsFunction()) { | 3418 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| 3419 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", "The callback provided as parameter 1 is not a function."), arg
s.GetIsolate()); | 3419 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", "The callback provided as parameter 1 is not a function."), inf
o.GetIsolate()); |
| 3420 return; | 3420 return; |
| 3421 } | 3421 } |
| 3422 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getExecution
Context()); | 3422 RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); |
| 3423 imp->methodWithCallbackArg(callback); | 3423 imp->methodWithCallbackArg(callback); |
| 3424 } | 3424 } |
| 3425 | 3425 |
| 3426 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& args) | 3426 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 3427 { | 3427 { |
| 3428 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3428 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3429 TestObjV8Internal::methodWithCallbackArgMethod(args); | 3429 TestObjV8Internal::methodWithCallbackArgMethod(info); |
| 3430 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3430 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3431 } | 3431 } |
| 3432 | 3432 |
| 3433 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& args) | 3433 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 3434 { | 3434 { |
| 3435 if (UNLIKELY(args.Length() < 2)) { | 3435 if (UNLIKELY(info.Length() < 2)) { |
| 3436 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, args.
Length())), args.GetIsolate()); | 3436 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info.
Length())), info.GetIsolate()); |
| 3437 return; | 3437 return; |
| 3438 } | 3438 } |
| 3439 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3439 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3440 V8TRYCATCH_VOID(int, nonCallback, toInt32(args[0])); | 3440 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); |
| 3441 if (args.Length() <= 1 || !args[1]->IsFunction()) { | 3441 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
| 3442 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a
function."), args.GetIsolate()); | 3442 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a
function."), info.GetIsolate()); |
| 3443 return; | 3443 return; |
| 3444 } | 3444 } |
| 3445 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getExecution
Context()); | 3445 RefPtr<TestCallback> callback = V8TestCallback::create(info[1], getExecution
Context()); |
| 3446 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); | 3446 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); |
| 3447 } | 3447 } |
| 3448 | 3448 |
| 3449 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& args) | 3449 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
| 3450 { | 3450 { |
| 3451 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3451 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3452 TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(args); | 3452 TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(info); |
| 3453 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3453 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3454 } | 3454 } |
| 3455 | 3455 |
| 3456 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInf
o<v8::Value>& args) | 3456 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 3457 { | 3457 { |
| 3458 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3458 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3459 RefPtr<TestCallback> callback; | 3459 RefPtr<TestCallback> callback; |
| 3460 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | 3460 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { |
| 3461 if (!args[0]->IsFunction()) { | 3461 if (!info[0]->IsFunction()) { |
| 3462 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac
kAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a f
unction."), args.GetIsolate()); | 3462 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac
kAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a f
unction."), info.GetIsolate()); |
| 3463 return; | 3463 return; |
| 3464 } | 3464 } |
| 3465 callback = V8TestCallback::create(args[0], getExecutionContext()); | 3465 callback = V8TestCallback::create(info[0], getExecutionContext()); |
| 3466 } | 3466 } |
| 3467 imp->methodWithCallbackAndOptionalArg(callback); | 3467 imp->methodWithCallbackAndOptionalArg(callback); |
| 3468 } | 3468 } |
| 3469 | 3469 |
| 3470 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& args) | 3470 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 3471 { | 3471 { |
| 3472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3473 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(args); | 3473 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(info); |
| 3474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3475 } | 3475 } |
| 3476 | 3476 |
| 3477 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v
8::Value>& args) | 3477 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 3478 { | 3478 { |
| 3479 if (UNLIKELY(args.Length() < 1)) { | 3479 if (UNLIKELY(info.Length() < 1)) { |
| 3480 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())
), args.GetIsolate()); | 3480 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())
), info.GetIsolate()); |
| 3481 return; | 3481 return; |
| 3482 } | 3482 } |
| 3483 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3483 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3484 if (args.Length() <= 0 || !(args[0]->IsFunction() || args[0]->IsNull())) { | 3484 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
| 3485 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", "The callback provided as parameter 1 is not a function
."), args.GetIsolate()); | 3485 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", "The callback provided as parameter 1 is not a function
."), info.GetIsolate()); |
| 3486 return; | 3486 return; |
| 3487 } | 3487 } |
| 3488 RefPtr<TestCallback> callback = args[0]->IsNull() ? 0 : V8TestCallback::crea
te(args[0], getExecutionContext()); | 3488 RefPtr<TestCallback> callback = info[0]->IsNull() ? 0 : V8TestCallback::crea
te(info[0], getExecutionContext()); |
| 3489 imp->methodWithNullableCallbackArg(callback); | 3489 imp->methodWithNullableCallbackArg(callback); |
| 3490 } | 3490 } |
| 3491 | 3491 |
| 3492 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallba
ckInfo<v8::Value>& args) | 3492 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 3493 { | 3493 { |
| 3494 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3494 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3495 TestObjV8Internal::methodWithNullableCallbackArgMethod(args); | 3495 TestObjV8Internal::methodWithNullableCallbackArgMethod(info); |
| 3496 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3496 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3497 } | 3497 } |
| 3498 | 3498 |
| 3499 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& args) | 3499 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 3500 { | 3500 { |
| 3501 RefPtr<TestCallback> callback; | 3501 RefPtr<TestCallback> callback; |
| 3502 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | 3502 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { |
| 3503 if (!args[0]->IsFunction()) { | 3503 if (!info[0]->IsFunction()) { |
| 3504 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC
allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n
ot a function."), args.GetIsolate()); | 3504 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC
allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n
ot a function."), info.GetIsolate()); |
| 3505 return; | 3505 return; |
| 3506 } | 3506 } |
| 3507 callback = V8TestCallback::create(args[0], getExecutionContext()); | 3507 callback = V8TestCallback::create(info[0], getExecutionContext()); |
| 3508 } | 3508 } |
| 3509 TestObj::staticMethodWithCallbackAndOptionalArg(callback); | 3509 TestObj::staticMethodWithCallbackAndOptionalArg(callback); |
| 3510 } | 3510 } |
| 3511 | 3511 |
| 3512 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& args) | 3512 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
| 3513 { | 3513 { |
| 3514 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3514 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3515 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(args); | 3515 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); |
| 3516 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3516 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3517 } | 3517 } |
| 3518 | 3518 |
| 3519 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3519 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3520 { | 3520 { |
| 3521 if (UNLIKELY(args.Length() < 1)) { | 3521 if (UNLIKELY(info.Length() < 1)) { |
| 3522 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())),
args.GetIsolate()); | 3522 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 3523 return; | 3523 return; |
| 3524 } | 3524 } |
| 3525 if (args.Length() <= 0 || !args[0]->IsFunction()) { | 3525 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| 3526 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), args.GetIsolate()); | 3526 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); |
| 3527 return; | 3527 return; |
| 3528 } | 3528 } |
| 3529 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getExecution
Context()); | 3529 RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); |
| 3530 TestObj::staticMethodWithCallbackArg(callback); | 3530 TestObj::staticMethodWithCallbackArg(callback); |
| 3531 } | 3531 } |
| 3532 | 3532 |
| 3533 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 3533 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3534 { | 3534 { |
| 3535 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3535 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3536 TestObjV8Internal::staticMethodWithCallbackArgMethod(args); | 3536 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); |
| 3537 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3537 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3538 } | 3538 } |
| 3539 | 3539 |
| 3540 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& args) | 3540 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3541 { | 3541 { |
| 3542 if (UNLIKELY(args.Length() < 1)) { | 3542 if (UNLIKELY(info.Length() < 1)) { |
| 3543 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())),
args.GetIsolate()); | 3543 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 3544 return; | 3544 return; |
| 3545 } | 3545 } |
| 3546 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3546 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3547 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(args[0], EnforceRange, ok)
, args.GetIsolate()); | 3547 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok)
, info.GetIsolate()); |
| 3548 imp->methodWithEnforceRangeInt8(value); | 3548 imp->methodWithEnforceRangeInt8(value); |
| 3549 } | 3549 } |
| 3550 | 3550 |
| 3551 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& args) | 3551 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 3552 { | 3552 { |
| 3553 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3553 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3554 TestObjV8Internal::methodWithEnforceRangeInt8Method(args); | 3554 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); |
| 3555 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3555 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3556 } | 3556 } |
| 3557 | 3557 |
| 3558 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3558 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3559 { | 3559 { |
| 3560 if (UNLIKELY(args.Length() < 1)) { | 3560 if (UNLIKELY(info.Length() < 1)) { |
| 3561 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())),
args.GetIsolate()); | 3561 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 3562 return; | 3562 return; |
| 3563 } | 3563 } |
| 3564 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3564 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3565 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(args[0], EnforceRang
e, ok), args.GetIsolate()); | 3565 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRang
e, ok), info.GetIsolate()); |
| 3566 imp->methodWithEnforceRangeUInt8(value); | 3566 imp->methodWithEnforceRangeUInt8(value); |
| 3567 } | 3567 } |
| 3568 | 3568 |
| 3569 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 3569 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3570 { | 3570 { |
| 3571 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3571 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3572 TestObjV8Internal::methodWithEnforceRangeUInt8Method(args); | 3572 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); |
| 3573 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3573 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3574 } | 3574 } |
| 3575 | 3575 |
| 3576 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3576 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3577 { | 3577 { |
| 3578 if (UNLIKELY(args.Length() < 1)) { | 3578 if (UNLIKELY(info.Length() < 1)) { |
| 3579 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())),
args.GetIsolate()); | 3579 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 3580 return; | 3580 return; |
| 3581 } | 3581 } |
| 3582 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3582 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3583 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(args[0], EnforceRange, ok
), args.GetIsolate()); | 3583 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok
), info.GetIsolate()); |
| 3584 imp->methodWithEnforceRangeInt32(value); | 3584 imp->methodWithEnforceRangeInt32(value); |
| 3585 } | 3585 } |
| 3586 | 3586 |
| 3587 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 3587 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3588 { | 3588 { |
| 3589 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3589 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3590 TestObjV8Internal::methodWithEnforceRangeInt32Method(args); | 3590 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); |
| 3591 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3591 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3592 } | 3592 } |
| 3593 | 3593 |
| 3594 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& args) | 3594 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 3595 { | 3595 { |
| 3596 if (UNLIKELY(args.Length() < 1)) { | 3596 if (UNLIKELY(info.Length() < 1)) { |
| 3597 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()))
, args.GetIsolate()); | 3597 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
| 3598 return; | 3598 return; |
| 3599 } | 3599 } |
| 3600 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3600 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3601 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(args[0], EnforceRan
ge, ok), args.GetIsolate()); | 3601 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
| 3602 imp->methodWithEnforceRangeUInt32(value); | 3602 imp->methodWithEnforceRangeUInt32(value); |
| 3603 } | 3603 } |
| 3604 | 3604 |
| 3605 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& args) | 3605 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 3606 { | 3606 { |
| 3607 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3607 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3608 TestObjV8Internal::methodWithEnforceRangeUInt32Method(args); | 3608 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); |
| 3609 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3609 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3610 } | 3610 } |
| 3611 | 3611 |
| 3612 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3612 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3613 { | 3613 { |
| 3614 if (UNLIKELY(args.Length() < 1)) { | 3614 if (UNLIKELY(info.Length() < 1)) { |
| 3615 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())),
args.GetIsolate()); | 3615 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 3616 return; | 3616 return; |
| 3617 } | 3617 } |
| 3618 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3618 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3619 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(args[0], EnforceRan
ge, ok), args.GetIsolate()); | 3619 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
| 3620 imp->methodWithEnforceRangeInt64(value); | 3620 imp->methodWithEnforceRangeInt64(value); |
| 3621 } | 3621 } |
| 3622 | 3622 |
| 3623 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 3623 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3624 { | 3624 { |
| 3625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3626 TestObjV8Internal::methodWithEnforceRangeInt64Method(args); | 3626 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); |
| 3627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3628 } | 3628 } |
| 3629 | 3629 |
| 3630 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& args) | 3630 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 3631 { | 3631 { |
| 3632 if (UNLIKELY(args.Length() < 1)) { | 3632 if (UNLIKELY(info.Length() < 1)) { |
| 3633 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()))
, args.GetIsolate()); | 3633 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
| 3634 return; | 3634 return; |
| 3635 } | 3635 } |
| 3636 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3636 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3637 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(args[0],
EnforceRange, ok), args.GetIsolate()); | 3637 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0],
EnforceRange, ok), info.GetIsolate()); |
| 3638 imp->methodWithEnforceRangeUInt64(value); | 3638 imp->methodWithEnforceRangeUInt64(value); |
| 3639 } | 3639 } |
| 3640 | 3640 |
| 3641 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& args) | 3641 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 3642 { | 3642 { |
| 3643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3644 TestObjV8Internal::methodWithEnforceRangeUInt64Method(args); | 3644 TestObjV8Internal::methodWithEnforceRangeUInt64Method(info); |
| 3645 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3645 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3646 } | 3646 } |
| 3647 | 3647 |
| 3648 #if ENABLE(Condition1) | 3648 #if ENABLE(Condition1) |
| 3649 | 3649 |
| 3650 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3650 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3651 { | 3651 { |
| 3652 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3652 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3653 v8SetReturnValueString(args, imp->conditionalMethod1(), args.GetIsolate()); | 3653 v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate()); |
| 3654 } | 3654 } |
| 3655 | 3655 |
| 3656 #endif // ENABLE(Condition1) | 3656 #endif // ENABLE(Condition1) |
| 3657 | 3657 |
| 3658 #if ENABLE(Condition1) | 3658 #if ENABLE(Condition1) |
| 3659 | 3659 |
| 3660 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 3660 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3661 { | 3661 { |
| 3662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3663 TestObjV8Internal::conditionalMethod1Method(args); | 3663 TestObjV8Internal::conditionalMethod1Method(info); |
| 3664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3665 } | 3665 } |
| 3666 | 3666 |
| 3667 #endif // ENABLE(Condition1) | 3667 #endif // ENABLE(Condition1) |
| 3668 | 3668 |
| 3669 #if ENABLE(Condition1) && ENABLE(Condition2) | 3669 #if ENABLE(Condition1) && ENABLE(Condition2) |
| 3670 | 3670 |
| 3671 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3671 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3672 { | 3672 { |
| 3673 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3673 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3674 imp->conditionalMethod2(); | 3674 imp->conditionalMethod2(); |
| 3675 } | 3675 } |
| 3676 | 3676 |
| 3677 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 3677 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| 3678 | 3678 |
| 3679 #if ENABLE(Condition1) && ENABLE(Condition2) | 3679 #if ENABLE(Condition1) && ENABLE(Condition2) |
| 3680 | 3680 |
| 3681 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 3681 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3682 { | 3682 { |
| 3683 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3683 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3684 TestObjV8Internal::conditionalMethod2Method(args); | 3684 TestObjV8Internal::conditionalMethod2Method(info); |
| 3685 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3685 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3686 } | 3686 } |
| 3687 | 3687 |
| 3688 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 3688 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| 3689 | 3689 |
| 3690 #if ENABLE(Condition1) || ENABLE(Condition2) | 3690 #if ENABLE(Condition1) || ENABLE(Condition2) |
| 3691 | 3691 |
| 3692 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3692 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3693 { | 3693 { |
| 3694 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3694 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3695 imp->conditionalMethod3(); | 3695 imp->conditionalMethod3(); |
| 3696 } | 3696 } |
| 3697 | 3697 |
| 3698 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 3698 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| 3699 | 3699 |
| 3700 #if ENABLE(Condition1) || ENABLE(Condition2) | 3700 #if ENABLE(Condition1) || ENABLE(Condition2) |
| 3701 | 3701 |
| 3702 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 3702 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3703 { | 3703 { |
| 3704 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3704 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3705 TestObjV8Internal::conditionalMethod3Method(args); | 3705 TestObjV8Internal::conditionalMethod3Method(info); |
| 3706 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3706 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3707 } | 3707 } |
| 3708 | 3708 |
| 3709 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 3709 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| 3710 | 3710 |
| 3711 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 3711 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 3712 { | 3712 { |
| 3713 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3713 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3714 v8SetReturnValue(args, imp->callbackFunctionReturnValue().v8Value()); | 3714 v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value()); |
| 3715 } | 3715 } |
| 3716 | 3716 |
| 3717 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 3717 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 3718 { | 3718 { |
| 3719 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3719 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3720 TestObjV8Internal::callbackFunctionReturnValueMethod(args); | 3720 TestObjV8Internal::callbackFunctionReturnValueMethod(info); |
| 3721 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3721 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3722 } | 3722 } |
| 3723 | 3723 |
| 3724 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& args) | 3724 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 3725 { | 3725 { |
| 3726 if (UNLIKELY(args.Length() < 1)) { | 3726 if (UNLIKELY(info.Length() < 1)) { |
| 3727 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); | 3727 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
| 3728 return; | 3728 return; |
| 3729 } | 3729 } |
| 3730 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3730 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3731 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(args[0], args.GetIsolate(
))); | 3731 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); |
| 3732 imp->callbackFunctionArgument(function); | 3732 imp->callbackFunctionArgument(function); |
| 3733 } | 3733 } |
| 3734 | 3734 |
| 3735 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& args) | 3735 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 3736 { | 3736 { |
| 3737 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3737 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3738 TestObjV8Internal::callbackFunctionArgumentMethod(args); | 3738 TestObjV8Internal::callbackFunctionArgumentMethod(info); |
| 3739 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3739 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3740 } | 3740 } |
| 3741 | 3741 |
| 3742 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3742 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3743 { | 3743 { |
| 3744 if (UNLIKELY(args.Length() < 2)) { | 3744 if (UNLIKELY(info.Length() < 2)) { |
| 3745 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIs
olate()); | 3745 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIs
olate()); |
| 3746 return; | 3746 return; |
| 3747 } | 3747 } |
| 3748 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3748 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3749 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[0])) : 0); | 3749 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); |
| 3750 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); | 3750 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 3751 imp->overloadedMethod(objArg, strArg); | 3751 imp->overloadedMethod(objArg, strArg); |
| 3752 } | 3752 } |
| 3753 | 3753 |
| 3754 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3754 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3755 { | 3755 { |
| 3756 if (UNLIKELY(args.Length() < 1)) { | 3756 if (UNLIKELY(info.Length() < 1)) { |
| 3757 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3757 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3758 return; | 3758 return; |
| 3759 } | 3759 } |
| 3760 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3760 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3761 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[0])) : 0); | 3761 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); |
| 3762 if (UNLIKELY(args.Length() <= 1)) { | 3762 if (UNLIKELY(info.Length() <= 1)) { |
| 3763 imp->overloadedMethod(objArg); | 3763 imp->overloadedMethod(objArg); |
| 3764 return; | 3764 return; |
| 3765 } | 3765 } |
| 3766 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); | 3766 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| 3767 imp->overloadedMethod(objArg, longArg); | 3767 imp->overloadedMethod(objArg, longArg); |
| 3768 } | 3768 } |
| 3769 | 3769 |
| 3770 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3770 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3771 { | 3771 { |
| 3772 if (UNLIKELY(args.Length() < 1)) { | 3772 if (UNLIKELY(info.Length() < 1)) { |
| 3773 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3773 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3774 return; | 3774 return; |
| 3775 } | 3775 } |
| 3776 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3776 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3777 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 3777 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 3778 imp->overloadedMethod(strArg); | 3778 imp->overloadedMethod(strArg); |
| 3779 } | 3779 } |
| 3780 | 3780 |
| 3781 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3781 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3782 { | 3782 { |
| 3783 if (UNLIKELY(args.Length() < 1)) { | 3783 if (UNLIKELY(info.Length() < 1)) { |
| 3784 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3784 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3785 return; | 3785 return; |
| 3786 } | 3786 } |
| 3787 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3787 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3788 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 3788 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 3789 imp->overloadedMethod(longArg); | 3789 imp->overloadedMethod(longArg); |
| 3790 } | 3790 } |
| 3791 | 3791 |
| 3792 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3792 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3793 { | 3793 { |
| 3794 if (UNLIKELY(args.Length() < 1)) { | 3794 if (UNLIKELY(info.Length() < 1)) { |
| 3795 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3795 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3796 return; | 3796 return; |
| 3797 } | 3797 } |
| 3798 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3798 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3799 if (args.Length() <= 0 || !args[0]->IsFunction()) { | 3799 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| 3800 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), args.Get
Isolate()); | 3800 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); |
| 3801 return; | 3801 return; |
| 3802 } | 3802 } |
| 3803 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getExecution
Context()); | 3803 RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); |
| 3804 imp->overloadedMethod(callback); | 3804 imp->overloadedMethod(callback); |
| 3805 } | 3805 } |
| 3806 | 3806 |
| 3807 static void overloadedMethod6Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3807 static void overloadedMethod6Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3808 { | 3808 { |
| 3809 if (UNLIKELY(args.Length() < 1)) { | 3809 if (UNLIKELY(info.Length() < 1)) { |
| 3810 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3810 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3811 return; | 3811 return; |
| 3812 } | 3812 } |
| 3813 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3813 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3814 V8TRYCATCH_VOID(RefPtr<DOMStringList>, listArg, toDOMStringList(args[0], arg
s.GetIsolate())); | 3814 V8TRYCATCH_VOID(RefPtr<DOMStringList>, listArg, toDOMStringList(info[0], inf
o.GetIsolate())); |
| 3815 imp->overloadedMethod(listArg); | 3815 imp->overloadedMethod(listArg); |
| 3816 } | 3816 } |
| 3817 | 3817 |
| 3818 static void overloadedMethod7Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3818 static void overloadedMethod7Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3819 { | 3819 { |
| 3820 if (UNLIKELY(args.Length() < 1)) { | 3820 if (UNLIKELY(info.Length() < 1)) { |
| 3821 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3821 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3822 return; | 3822 return; |
| 3823 } | 3823 } |
| 3824 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3824 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3825 bool arrayArgIsNull = args[0]->IsNull(); | 3825 bool arrayArgIsNull = info[0]->IsNull(); |
| 3826 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], 1,
args.GetIsolate())); | 3826 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1,
info.GetIsolate())); |
| 3827 imp->overloadedMethod(arrayArgIsNull ? 0 : &arrayArg); | 3827 imp->overloadedMethod(arrayArgIsNull ? 0 : &arrayArg); |
| 3828 } | 3828 } |
| 3829 | 3829 |
| 3830 static void overloadedMethod8Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3830 static void overloadedMethod8Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3831 { | 3831 { |
| 3832 if (UNLIKELY(args.Length() < 1)) { | 3832 if (UNLIKELY(info.Length() < 1)) { |
| 3833 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3833 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3834 return; | 3834 return; |
| 3835 } | 3835 } |
| 3836 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3836 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3837 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge
tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(args[0])) : 0); | 3837 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); |
| 3838 imp->overloadedMethod(objArg); | 3838 imp->overloadedMethod(objArg); |
| 3839 } | 3839 } |
| 3840 | 3840 |
| 3841 static void overloadedMethod9Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 3841 static void overloadedMethod9Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3842 { | 3842 { |
| 3843 if (UNLIKELY(args.Length() < 1)) { | 3843 if (UNLIKELY(info.Length() < 1)) { |
| 3844 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3844 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3845 return; | 3845 return; |
| 3846 } | 3846 } |
| 3847 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3847 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3848 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], 1,
args.GetIsolate())); | 3848 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1,
info.GetIsolate())); |
| 3849 imp->overloadedMethod(arrayArg); | 3849 imp->overloadedMethod(arrayArg); |
| 3850 } | 3850 } |
| 3851 | 3851 |
| 3852 static void overloadedMethod10Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3852 static void overloadedMethod10Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3853 { | 3853 { |
| 3854 if (UNLIKELY(args.Length() < 1)) { | 3854 if (UNLIKELY(info.Length() < 1)) { |
| 3855 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3855 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3856 return; | 3856 return; |
| 3857 } | 3857 } |
| 3858 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3858 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3859 V8TRYCATCH_VOID(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(args[0],
1, args.GetIsolate())); | 3859 V8TRYCATCH_VOID(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(info[0],
1, info.GetIsolate())); |
| 3860 imp->overloadedMethod(arrayArg); | 3860 imp->overloadedMethod(arrayArg); |
| 3861 } | 3861 } |
| 3862 | 3862 |
| 3863 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3863 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3864 { | 3864 { |
| 3865 if (UNLIKELY(args.Length() < 1)) { | 3865 if (UNLIKELY(info.Length() < 1)) { |
| 3866 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3866 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3867 return; | 3867 return; |
| 3868 } | 3868 } |
| 3869 TestObj* imp = V8TestObject::toNative(args.Holder()); | 3869 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3870 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 3870 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 3871 imp->overloadedMethod(strArg); | 3871 imp->overloadedMethod(strArg); |
| 3872 } | 3872 } |
| 3873 | 3873 |
| 3874 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 3874 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 3875 { | 3875 { |
| 3876 if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObject::HasInstance(a
rgs[0], args.GetIsolate(), worldType(args.GetIsolate()))) && (args[1]->IsNull()
|| args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject()))) { | 3876 if ((info.Length() == 2 && (info[0]->IsNull() || V8TestObject::HasInstance(i
nfo[0], info.GetIsolate(), worldType(info.GetIsolate()))) && (info[1]->IsNull()
|| info[1]->IsUndefined() || info[1]->IsString() || info[1]->IsObject()))) { |
| 3877 overloadedMethod1Method(args); | 3877 overloadedMethod1Method(info); |
| 3878 return; | 3878 return; |
| 3879 } | 3879 } |
| 3880 if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObject::HasInstance(a
rgs[0], args.GetIsolate(), worldType(args.GetIsolate())))) || (args.Length() ==
2 && (args[0]->IsNull() || V8TestObject::HasInstance(args[0], args.GetIsolate(),
worldType(args.GetIsolate()))))) { | 3880 if ((info.Length() == 1 && (info[0]->IsNull() || V8TestObject::HasInstance(i
nfo[0], info.GetIsolate(), worldType(info.GetIsolate())))) || (info.Length() ==
2 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate()))))) { |
| 3881 overloadedMethod2Method(args); | 3881 overloadedMethod2Method(info); |
| 3882 return; | 3882 return; |
| 3883 } | 3883 } |
| 3884 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) { | 3884 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsUndefined() || i
nfo[0]->IsString() || info[0]->IsObject()))) { |
| 3885 overloadedMethod3Method(args); | 3885 overloadedMethod3Method(info); |
| 3886 return; | 3886 return; |
| 3887 } | 3887 } |
| 3888 if (args.Length() == 1) { | 3888 if (info.Length() == 1) { |
| 3889 overloadedMethod4Method(args); | 3889 overloadedMethod4Method(info); |
| 3890 return; | 3890 return; |
| 3891 } | 3891 } |
| 3892 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction()))) { | 3892 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsFunction()))) { |
| 3893 overloadedMethod5Method(args); | 3893 overloadedMethod5Method(info); |
| 3894 return; | 3894 return; |
| 3895 } | 3895 } |
| 3896 if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstanc
e(args[0], args.GetIsolate(), worldType(args.GetIsolate()))))) { | 3896 if ((info.Length() == 1 && (info[0]->IsNull() || V8DOMStringList::HasInstanc
e(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) { |
| 3897 overloadedMethod6Method(args); | 3897 overloadedMethod6Method(info); |
| 3898 return; | 3898 return; |
| 3899 } | 3899 } |
| 3900 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray()))) { | 3900 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsArray()))) { |
| 3901 overloadedMethod7Method(args); | 3901 overloadedMethod7Method(info); |
| 3902 return; | 3902 return; |
| 3903 } | 3903 } |
| 3904 if ((args.Length() == 1 && (V8TestObject::HasInstance(args[0], args.GetIsola
te(), worldType(args.GetIsolate()))))) { | 3904 if ((info.Length() == 1 && (V8TestObject::HasInstance(info[0], info.GetIsola
te(), worldType(info.GetIsolate()))))) { |
| 3905 overloadedMethod8Method(args); | 3905 overloadedMethod8Method(info); |
| 3906 return; | 3906 return; |
| 3907 } | 3907 } |
| 3908 if ((args.Length() == 1 && (args[0]->IsArray()))) { | 3908 if ((info.Length() == 1 && (info[0]->IsArray()))) { |
| 3909 overloadedMethod9Method(args); | 3909 overloadedMethod9Method(info); |
| 3910 return; | 3910 return; |
| 3911 } | 3911 } |
| 3912 if ((args.Length() == 1 && (args[0]->IsArray()))) { | 3912 if ((info.Length() == 1 && (info[0]->IsArray()))) { |
| 3913 overloadedMethod10Method(args); | 3913 overloadedMethod10Method(info); |
| 3914 return; | 3914 return; |
| 3915 } | 3915 } |
| 3916 if (args.Length() == 1) { | 3916 if (info.Length() == 1) { |
| 3917 overloadedMethod11Method(args); | 3917 overloadedMethod11Method(info); |
| 3918 return; | 3918 return; |
| 3919 } | 3919 } |
| 3920 if (UNLIKELY(args.Length() < 1)) { | 3920 if (UNLIKELY(info.Length() < 1)) { |
| 3921 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs
olate()); | 3921 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 3922 return; | 3922 return; |
| 3923 } | 3923 } |
| 3924 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 3924 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 3925 } | 3925 } |
| 3926 | 3926 |
| 3927 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& args) | 3927 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 3928 { | 3928 { |
| 3929 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3929 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3930 TestObjV8Internal::overloadedMethodMethod(args); | 3930 TestObjV8Internal::overloadedMethodMethod(info); |
| 3931 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3931 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3932 } | 3932 } |
| 3933 | 3933 |
| 3934 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 3934 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 3935 { | 3935 { |
| 3936 TestObj::classMethod(); | 3936 TestObj::classMethod(); |
| 3937 } | 3937 } |
| 3938 | 3938 |
| 3939 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3939 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3940 { | 3940 { |
| 3941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3942 TestObjV8Internal::classMethodMethod(args); | 3942 TestObjV8Internal::classMethodMethod(info); |
| 3943 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3943 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3944 } | 3944 } |
| 3945 | 3945 |
| 3946 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& args) | 3946 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 3947 { | 3947 { |
| 3948 if (UNLIKELY(args.Length() <= 0)) { | 3948 if (UNLIKELY(info.Length() <= 0)) { |
| 3949 v8SetReturnValueInt(args, TestObj::classMethodWithOptional()); | 3949 v8SetReturnValueInt(info, TestObj::classMethodWithOptional()); |
| 3950 return; | 3950 return; |
| 3951 } | 3951 } |
| 3952 V8TRYCATCH_VOID(int, arg, toInt32(args[0])); | 3952 V8TRYCATCH_VOID(int, arg, toInt32(info[0])); |
| 3953 v8SetReturnValueInt(args, TestObj::classMethodWithOptional(arg)); | 3953 v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg)); |
| 3954 } | 3954 } |
| 3955 | 3955 |
| 3956 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& args) | 3956 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 3957 { | 3957 { |
| 3958 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3958 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3959 TestObjV8Internal::classMethodWithOptionalMethod(args); | 3959 TestObjV8Internal::classMethodWithOptionalMethod(info); |
| 3960 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3960 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3961 } | 3961 } |
| 3962 | 3962 |
| 3963 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& args) | 3963 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 3964 { | 3964 { |
| 3965 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3965 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3966 V8TestObject::classMethod2MethodCustom(args); | 3966 V8TestObject::classMethod2MethodCustom(info); |
| 3967 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3967 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3968 } | 3968 } |
| 3969 | 3969 |
| 3970 #if ENABLE(Condition1) | 3970 #if ENABLE(Condition1) |
| 3971 | 3971 |
| 3972 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3972 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3973 { | 3973 { |
| 3974 if (UNLIKELY(args.Length() < 1)) { | 3974 if (UNLIKELY(info.Length() < 1)) { |
| 3975 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "
TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetI
solate()); | 3975 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
| 3976 return; | 3976 return; |
| 3977 } | 3977 } |
| 3978 V8TRYCATCH_VOID(int, arg, toInt32(args[0])); | 3978 V8TRYCATCH_VOID(int, arg, toInt32(info[0])); |
| 3979 TestObj::overloadedMethod1(arg); | 3979 TestObj::overloadedMethod1(arg); |
| 3980 } | 3980 } |
| 3981 | 3981 |
| 3982 #endif // ENABLE(Condition1) | 3982 #endif // ENABLE(Condition1) |
| 3983 | 3983 |
| 3984 #if ENABLE(Condition1) | 3984 #if ENABLE(Condition1) |
| 3985 | 3985 |
| 3986 static void overloadedMethod12Method(const v8::FunctionCallbackInfo<v8::Value>&
args) | 3986 static void overloadedMethod12Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3987 { | 3987 { |
| 3988 if (UNLIKELY(args.Length() < 1)) { | 3988 if (UNLIKELY(info.Length() < 1)) { |
| 3989 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "
TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetI
solate()); | 3989 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
| 3990 return; | 3990 return; |
| 3991 } | 3991 } |
| 3992 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); | 3992 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); |
| 3993 TestObj::overloadedMethod1(type); | 3993 TestObj::overloadedMethod1(type); |
| 3994 } | 3994 } |
| 3995 | 3995 |
| 3996 #endif // ENABLE(Condition1) | 3996 #endif // ENABLE(Condition1) |
| 3997 | 3997 |
| 3998 #if ENABLE(Condition1) | 3998 #if ENABLE(Condition1) |
| 3999 | 3999 |
| 4000 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a
rgs) | 4000 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 4001 { | 4001 { |
| 4002 if (args.Length() == 1) { | 4002 if (info.Length() == 1) { |
| 4003 overloadedMethod11Method(args); | 4003 overloadedMethod11Method(info); |
| 4004 return; | 4004 return; |
| 4005 } | 4005 } |
| 4006 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) { | 4006 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsUndefined() || i
nfo[0]->IsString() || info[0]->IsObject()))) { |
| 4007 overloadedMethod12Method(args); | 4007 overloadedMethod12Method(info); |
| 4008 return; | 4008 return; |
| 4009 } | 4009 } |
| 4010 if (UNLIKELY(args.Length() < 1)) { | 4010 if (UNLIKELY(info.Length() < 1)) { |
| 4011 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "
TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetI
solate()); | 4011 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
| 4012 return; | 4012 return; |
| 4013 } | 4013 } |
| 4014 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4014 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4015 } | 4015 } |
| 4016 | 4016 |
| 4017 #endif // ENABLE(Condition1) | 4017 #endif // ENABLE(Condition1) |
| 4018 | 4018 |
| 4019 #if ENABLE(Condition1) | 4019 #if ENABLE(Condition1) |
| 4020 | 4020 |
| 4021 static void overloadedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& args) | 4021 static void overloadedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 4022 { | 4022 { |
| 4023 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4023 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4024 TestObjV8Internal::overloadedMethod1Method(args); | 4024 TestObjV8Internal::overloadedMethod1Method(info); |
| 4025 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4025 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4026 } | 4026 } |
| 4027 | 4027 |
| 4028 #endif // ENABLE(Condition1) | 4028 #endif // ENABLE(Condition1) |
| 4029 | 4029 |
| 4030 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& args) | 4030 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 4031 { | 4031 { |
| 4032 if (UNLIKELY(args.Length() < 2)) { | 4032 if (UNLIKELY(info.Length() < 2)) { |
| 4033 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp"
, "TestObject", ExceptionMessages::notEnoughArguments(2, args.Length())), args.G
etIsolate()); | 4033 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
| 4034 return; | 4034 return; |
| 4035 } | 4035 } |
| 4036 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4036 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4037 unsigned objArgsShort = 0; | 4037 unsigned objArgsShort = 0; |
| 4038 V8TRYCATCH_VOID(double, objArgsShortNativeValue, args[0]->NumberValue()); | 4038 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); |
| 4039 if (!std::isnan(objArgsShortNativeValue)) | 4039 if (!std::isnan(objArgsShortNativeValue)) |
| 4040 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | 4040 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); |
| 4041 unsigned objArgsLong = 0; | 4041 unsigned objArgsLong = 0; |
| 4042 V8TRYCATCH_VOID(double, objArgsLongNativeValue, args[1]->NumberValue()); | 4042 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); |
| 4043 if (!std::isnan(objArgsLongNativeValue)) | 4043 if (!std::isnan(objArgsLongNativeValue)) |
| 4044 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | 4044 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); |
| 4045 imp->classMethodWithClamp(objArgsShort, objArgsLong); | 4045 imp->classMethodWithClamp(objArgsShort, objArgsLong); |
| 4046 } | 4046 } |
| 4047 | 4047 |
| 4048 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 4048 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 4049 { | 4049 { |
| 4050 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4050 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4051 TestObjV8Internal::classMethodWithClampMethod(args); | 4051 TestObjV8Internal::classMethodWithClampMethod(info); |
| 4052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4053 } | 4053 } |
| 4054 | 4054 |
| 4055 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4055 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4056 { | 4056 { |
| 4057 if (UNLIKELY(args.Length() < 1)) { | 4057 if (UNLIKELY(info.Length() < 1)) { |
| 4058 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho
d", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args
.GetIsolate()); | 4058 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho
d", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info
.GetIsolate()); |
| 4059 return; | 4059 return; |
| 4060 } | 4060 } |
| 4061 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4061 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4062 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4062 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4063 imp->enabledAtRuntimeMethod(longArg); | 4063 imp->enabledAtRuntimeMethod(longArg); |
| 4064 } | 4064 } |
| 4065 | 4065 |
| 4066 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& args) | 4066 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 4067 { | 4067 { |
| 4068 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4068 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4069 TestObjV8Internal::enabledAtRuntimeMethodMethod(args); | 4069 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); |
| 4070 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4070 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4071 } | 4071 } |
| 4072 | 4072 |
| 4073 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& args) | 4073 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 4074 { | 4074 { |
| 4075 if (UNLIKELY(args.Length() < 1)) { | 4075 if (UNLIKELY(info.Length() < 1)) { |
| 4076 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth
od", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), arg
s.GetIsolate()); | 4076 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth
od", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
| 4077 return; | 4077 return; |
| 4078 } | 4078 } |
| 4079 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4079 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4080 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4080 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4081 imp->enabledPerContextMethod(longArg); | 4081 imp->enabledPerContextMethod(longArg); |
| 4082 } | 4082 } |
| 4083 | 4083 |
| 4084 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& args) | 4084 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 4085 { | 4085 { |
| 4086 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4086 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4087 TestObjV8Internal::enabledPerContextMethodMethod(args); | 4087 TestObjV8Internal::enabledPerContextMethodMethod(info); |
| 4088 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4088 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4089 } | 4089 } |
| 4090 | 4090 |
| 4091 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& args) | 4091 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 4092 { | 4092 { |
| 4093 if (UNLIKELY(args.Length() < 1)) { | 4093 if (UNLIKELY(info.Length() < 1)) { |
| 4094 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()
)), args.GetIsolate()); | 4094 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
| 4095 return; | 4095 return; |
| 4096 } | 4096 } |
| 4097 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4097 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4098 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(args[0], 1, args.GetIsolate())); | 4098 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); |
| 4099 imp->methodWithUnsignedLongSequence(unsignedLongSequence); | 4099 imp->methodWithUnsignedLongSequence(unsignedLongSequence); |
| 4100 } | 4100 } |
| 4101 | 4101 |
| 4102 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& args) | 4102 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 4103 { | 4103 { |
| 4104 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4104 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4105 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(args); | 4105 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); |
| 4106 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4106 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4107 } | 4107 } |
| 4108 | 4108 |
| 4109 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 4109 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 4110 { | 4110 { |
| 4111 if (UNLIKELY(args.Length() < 1)) { | 4111 if (UNLIKELY(info.Length() < 1)) { |
| 4112 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction",
"TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Ge
tIsolate()); | 4112 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge
tIsolate()); |
| 4113 return; | 4113 return; |
| 4114 } | 4114 } |
| 4115 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4115 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4116 ExceptionState es(args.GetIsolate()); | 4116 ExceptionState es(info.GetIsolate()); |
| 4117 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], 1, ar
gs.GetIsolate())); | 4117 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); |
| 4118 Vector<String> result = imp->stringArrayFunction(values, es); | 4118 Vector<String> result = imp->stringArrayFunction(values, es); |
| 4119 if (es.throwIfNeeded()) | 4119 if (es.throwIfNeeded()) |
| 4120 return; | 4120 return; |
| 4121 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); | 4121 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
| 4122 } | 4122 } |
| 4123 | 4123 |
| 4124 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 4124 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 4125 { | 4125 { |
| 4126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4127 TestObjV8Internal::stringArrayFunctionMethod(args); | 4127 TestObjV8Internal::stringArrayFunctionMethod(info); |
| 4128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4129 } | 4129 } |
| 4130 | 4130 |
| 4131 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& args) | 4131 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 4132 { | 4132 { |
| 4133 if (UNLIKELY(args.Length() < 1)) { | 4133 if (UNLIKELY(info.Length() < 1)) { |
| 4134 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction
", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.
GetIsolate()); | 4134 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
| 4135 return; | 4135 return; |
| 4136 } | 4136 } |
| 4137 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4137 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4138 ExceptionState es(args.GetIsolate()); | 4138 ExceptionState es(info.GetIsolate()); |
| 4139 V8TRYCATCH_VOID(RefPtr<DOMStringList>, values, toDOMStringList(args[0], args
.GetIsolate())); | 4139 V8TRYCATCH_VOID(RefPtr<DOMStringList>, values, toDOMStringList(info[0], info
.GetIsolate())); |
| 4140 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es); | 4140 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es); |
| 4141 if (es.throwIfNeeded()) | 4141 if (es.throwIfNeeded()) |
| 4142 return; | 4142 return; |
| 4143 v8SetReturnValue(args, result.release()); | 4143 v8SetReturnValue(info, result.release()); |
| 4144 } | 4144 } |
| 4145 | 4145 |
| 4146 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& args) | 4146 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 4147 { | 4147 { |
| 4148 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4148 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4149 TestObjV8Internal::domStringListFunctionMethod(args); | 4149 TestObjV8Internal::domStringListFunctionMethod(info); |
| 4150 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4150 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4151 } | 4151 } |
| 4152 | 4152 |
| 4153 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& args
) | 4153 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 4154 { | 4154 { |
| 4155 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4155 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4156 ExceptionState es(args.GetIsolate()); | 4156 ExceptionState es(info.GetIsolate()); |
| 4157 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es))
{ | 4157 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es))
{ |
| 4158 v8SetReturnValueNull(args); | 4158 v8SetReturnValueNull(info); |
| 4159 es.throwIfNeeded(); | 4159 es.throwIfNeeded(); |
| 4160 return; | 4160 return; |
| 4161 } | 4161 } |
| 4162 RefPtr<SVGDocument> result = imp->getSVGDocument(es); | 4162 RefPtr<SVGDocument> result = imp->getSVGDocument(es); |
| 4163 if (es.throwIfNeeded()) | 4163 if (es.throwIfNeeded()) |
| 4164 return; | 4164 return; |
| 4165 v8SetReturnValue(args, result.release()); | 4165 v8SetReturnValue(info, result.release()); |
| 4166 } | 4166 } |
| 4167 | 4167 |
| 4168 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4168 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4169 { | 4169 { |
| 4170 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4170 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4171 TestObjV8Internal::getSVGDocumentMethod(args); | 4171 TestObjV8Internal::getSVGDocumentMethod(info); |
| 4172 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4172 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4173 } | 4173 } |
| 4174 | 4174 |
| 4175 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& args) | 4175 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4176 { | 4176 { |
| 4177 if (UNLIKELY(args.Length() < 1)) { | 4177 if (UNLIKELY(info.Length() < 1)) { |
| 4178 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate())
; | 4178 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
| 4179 return; | 4179 return; |
| 4180 } | 4180 } |
| 4181 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4181 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4182 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetI
solate(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(args[0])) : 0); | 4182 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
| 4183 imp->convert1(value); | 4183 imp->convert1(value); |
| 4184 } | 4184 } |
| 4185 | 4185 |
| 4186 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 4186 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4187 { | 4187 { |
| 4188 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4188 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4189 TestObjV8Internal::convert1Method(args); | 4189 TestObjV8Internal::convert1Method(info); |
| 4190 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4190 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4191 } | 4191 } |
| 4192 | 4192 |
| 4193 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& args) | 4193 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4194 { | 4194 { |
| 4195 if (UNLIKELY(args.Length() < 1)) { | 4195 if (UNLIKELY(info.Length() < 1)) { |
| 4196 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate())
; | 4196 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
| 4197 return; | 4197 return; |
| 4198 } | 4198 } |
| 4199 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4199 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4200 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetI
solate(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(args[0])) : 0); | 4200 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
| 4201 imp->convert2(value); | 4201 imp->convert2(value); |
| 4202 } | 4202 } |
| 4203 | 4203 |
| 4204 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 4204 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4205 { | 4205 { |
| 4206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4207 TestObjV8Internal::convert2Method(args); | 4207 TestObjV8Internal::convert2Method(info); |
| 4208 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4208 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4209 } | 4209 } |
| 4210 | 4210 |
| 4211 static void convert4Method(const v8::FunctionCallbackInfo<v8::Value>& args) | 4211 static void convert4Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4212 { | 4212 { |
| 4213 if (UNLIKELY(args.Length() < 1)) { | 4213 if (UNLIKELY(info.Length() < 1)) { |
| 4214 throwTypeError(ExceptionMessages::failedToExecute("convert4", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate())
; | 4214 throwTypeError(ExceptionMessages::failedToExecute("convert4", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
| 4215 return; | 4215 return; |
| 4216 } | 4216 } |
| 4217 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4217 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4218 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetI
solate(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(args[0])) : 0); | 4218 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
| 4219 imp->convert4(value); | 4219 imp->convert4(value); |
| 4220 } | 4220 } |
| 4221 | 4221 |
| 4222 static void convert4MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 4222 static void convert4MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4223 { | 4223 { |
| 4224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4225 TestObjV8Internal::convert4Method(args); | 4225 TestObjV8Internal::convert4Method(info); |
| 4226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4227 } | 4227 } |
| 4228 | 4228 |
| 4229 static void convert5Method(const v8::FunctionCallbackInfo<v8::Value>& args) | 4229 static void convert5Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4230 { | 4230 { |
| 4231 if (UNLIKELY(args.Length() < 1)) { | 4231 if (UNLIKELY(info.Length() < 1)) { |
| 4232 throwTypeError(ExceptionMessages::failedToExecute("convert5", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate())
; | 4232 throwTypeError(ExceptionMessages::failedToExecute("convert5", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
| 4233 return; | 4233 return; |
| 4234 } | 4234 } |
| 4235 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4235 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4236 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetI
solate(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(args[0])) : 0); | 4236 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
| 4237 imp->convert5(value); | 4237 imp->convert5(value); |
| 4238 } | 4238 } |
| 4239 | 4239 |
| 4240 static void convert5MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 4240 static void convert5MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4241 { | 4241 { |
| 4242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4243 TestObjV8Internal::convert5Method(args); | 4243 TestObjV8Internal::convert5Method(info); |
| 4244 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4244 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4245 } | 4245 } |
| 4246 | 4246 |
| 4247 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>
& args) | 4247 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 4248 { | 4248 { |
| 4249 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4249 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4250 v8SetReturnValue(args, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>mutablePointFunction()))); | 4250 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>mutablePointFunction()))); |
| 4251 } | 4251 } |
| 4252 | 4252 |
| 4253 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 4253 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 4254 { | 4254 { |
| 4255 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4255 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4256 TestObjV8Internal::mutablePointFunctionMethod(args); | 4256 TestObjV8Internal::mutablePointFunctionMethod(info); |
| 4257 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4257 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4258 } | 4258 } |
| 4259 | 4259 |
| 4260 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4260 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4261 { | 4261 { |
| 4262 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4262 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4263 v8SetReturnValue(args, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunction()))); | 4263 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunction()))); |
| 4264 } | 4264 } |
| 4265 | 4265 |
| 4266 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& args) | 4266 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 4267 { | 4267 { |
| 4268 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4268 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4269 TestObjV8Internal::immutablePointFunctionMethod(args); | 4269 TestObjV8Internal::immutablePointFunctionMethod(info); |
| 4270 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4270 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4271 } | 4271 } |
| 4272 | 4272 |
| 4273 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args
) | 4273 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 4274 { | 4274 { |
| 4275 if (UNLIKELY(args.Length() < 2)) { | 4275 if (UNLIKELY(info.Length() < 2)) { |
| 4276 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsol
ate()); | 4276 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol
ate()); |
| 4277 return; | 4277 return; |
| 4278 } | 4278 } |
| 4279 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4279 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4280 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::Has
Instance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0); | 4280 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::Has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 4281 V8TRYCATCH_VOID(unsigned, index, toUInt32(args[1])); | 4281 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
| 4282 if (!item) { | 4282 if (!item) { |
| 4283 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4283 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4284 return; | 4284 return; |
| 4285 } | 4285 } |
| 4286 v8SetReturnValue(args, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); | 4286 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); |
| 4287 } | 4287 } |
| 4288 | 4288 |
| 4289 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4289 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4290 { | 4290 { |
| 4291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4292 TestObjV8Internal::svgPointMethodMethod(args); | 4292 TestObjV8Internal::svgPointMethodMethod(info); |
| 4293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4294 } | 4294 } |
| 4295 | 4295 |
| 4296 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& args) | 4296 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 4297 { | 4297 { |
| 4298 if (UNLIKELY(args.Length() < 2)) { | 4298 if (UNLIKELY(info.Length() < 2)) { |
| 4299 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(2, args.Length())), args.G
etIsolate()); | 4299 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
| 4300 return; | 4300 return; |
| 4301 } | 4301 } |
| 4302 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4302 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4303 ExceptionState es(args.GetIsolate()); | 4303 ExceptionState es(info.GetIsolate()); |
| 4304 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8SVGPoint::HasInst
ance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) { | 4304 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::HasInst
ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { |
| 4305 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), args.GetIsolate()); | 4305 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
| 4306 return; | 4306 return; |
| 4307 } | 4307 } |
| 4308 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::Has
Instance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0); | 4308 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::Has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 4309 V8TRYCATCH_VOID(unsigned, index, toUInt32(args[1])); | 4309 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
| 4310 if (!item) { | 4310 if (!item) { |
| 4311 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4311 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4312 return; | 4312 return; |
| 4313 } | 4313 } |
| 4314 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index
, es); | 4314 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index
, es); |
| 4315 if (es.throwIfNeeded()) | 4315 if (es.throwIfNeeded()) |
| 4316 return; | 4316 return; |
| 4317 v8SetReturnValue(args, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu
lt))); | 4317 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu
lt))); |
| 4318 } | 4318 } |
| 4319 | 4319 |
| 4320 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 4320 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 4321 { | 4321 { |
| 4322 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4322 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4323 TestObjV8Internal::strictSVGPointMethodMethod(args); | 4323 TestObjV8Internal::strictSVGPointMethodMethod(info); |
| 4324 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4324 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4325 } | 4325 } |
| 4326 | 4326 |
| 4327 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 4327 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4328 { | 4328 { |
| 4329 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4329 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4330 imp->banana(); | 4330 imp->banana(); |
| 4331 } | 4331 } |
| 4332 | 4332 |
| 4333 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args
) | 4333 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 4334 { | 4334 { |
| 4335 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4335 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4336 TestObjV8Internal::orangeMethod(args); | 4336 TestObjV8Internal::orangeMethod(info); |
| 4337 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4337 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4338 } | 4338 } |
| 4339 | 4339 |
| 4340 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args
) | 4340 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 4341 { | 4341 { |
| 4342 if (UNLIKELY(args.Length() < 3)) { | 4342 if (UNLIKELY(info.Length() < 3)) { |
| 4343 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes
tObject", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIsol
ate()); | 4343 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes
tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol
ate()); |
| 4344 return; | 4344 return; |
| 4345 } | 4345 } |
| 4346 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4346 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4347 ExceptionState es(args.GetIsolate()); | 4347 ExceptionState es(info.GetIsolate()); |
| 4348 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, args[0]); | 4348 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| 4349 V8TRYCATCH_VOID(float, a, static_cast<float>(args[1]->NumberValue())); | 4349 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); |
| 4350 V8TRYCATCH_VOID(int, b, toInt32(args[2])); | 4350 V8TRYCATCH_VOID(int, b, toInt32(info[2])); |
| 4351 bool result = imp->strictFunction(str, a, b, es); | 4351 bool result = imp->strictFunction(str, a, b, es); |
| 4352 if (es.throwIfNeeded()) | 4352 if (es.throwIfNeeded()) |
| 4353 return; | 4353 return; |
| 4354 v8SetReturnValueBool(args, result); | 4354 v8SetReturnValueBool(info, result); |
| 4355 } | 4355 } |
| 4356 | 4356 |
| 4357 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4357 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4358 { | 4358 { |
| 4359 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4359 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4360 TestObjV8Internal::strictFunctionMethod(args); | 4360 TestObjV8Internal::strictFunctionMethod(info); |
| 4361 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4361 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4362 } | 4362 } |
| 4363 | 4363 |
| 4364 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& args) | 4364 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 4365 { | 4365 { |
| 4366 if (UNLIKELY(args.Length() < 1)) { | 4366 if (UNLIKELY(info.Length() < 1)) { |
| 4367 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.G
etIsolate()); | 4367 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
| 4368 return; | 4368 return; |
| 4369 } | 4369 } |
| 4370 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4370 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4371 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, args[0]); | 4371 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); |
| 4372 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(args, 1)); | 4372 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); |
| 4373 imp->variadicStringMethod(head, tail); | 4373 imp->variadicStringMethod(head, tail); |
| 4374 } | 4374 } |
| 4375 | 4375 |
| 4376 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 4376 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 4377 { | 4377 { |
| 4378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4379 TestObjV8Internal::variadicStringMethodMethod(args); | 4379 TestObjV8Internal::variadicStringMethodMethod(info); |
| 4380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4381 } | 4381 } |
| 4382 | 4382 |
| 4383 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& args) | 4383 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 4384 { | 4384 { |
| 4385 if (UNLIKELY(args.Length() < 1)) { | 4385 if (UNLIKELY(info.Length() < 1)) { |
| 4386 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.G
etIsolate()); | 4386 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
| 4387 return; | 4387 return; |
| 4388 } | 4388 } |
| 4389 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4389 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4390 V8TRYCATCH_VOID(double, head, static_cast<double>(args[0]->NumberValue())); | 4390 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); |
| 4391 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(args, 1)); | 4391 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); |
| 4392 imp->variadicDoubleMethod(head, tail); | 4392 imp->variadicDoubleMethod(head, tail); |
| 4393 } | 4393 } |
| 4394 | 4394 |
| 4395 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 4395 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 4396 { | 4396 { |
| 4397 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4397 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4398 TestObjV8Internal::variadicDoubleMethodMethod(args); | 4398 TestObjV8Internal::variadicDoubleMethodMethod(info); |
| 4399 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4399 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4400 } | 4400 } |
| 4401 | 4401 |
| 4402 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 4402 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 4403 { | 4403 { |
| 4404 if (UNLIKELY(args.Length() < 1)) { | 4404 if (UNLIKELY(info.Length() < 1)) { |
| 4405 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get
Isolate()); | 4405 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); |
| 4406 return; | 4406 return; |
| 4407 } | 4407 } |
| 4408 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4408 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4409 V8TRYCATCH_VOID(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(),
worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(a
rgs[0])) : 0); | 4409 V8TRYCATCH_VOID(Node*, head, V8Node::HasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); |
| 4410 Vector<RefPtr<Node> > tail; | 4410 Vector<RefPtr<Node> > tail; |
| 4411 for (int i = 1; i < args.Length(); ++i) { | 4411 for (int i = 1; i < info.Length(); ++i) { |
| 4412 if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetI
solate()))) { | 4412 if (!V8Node::HasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { |
| 4413 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), args.GetIsolate()); | 4413 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); |
| 4414 return; | 4414 return; |
| 4415 } | 4415 } |
| 4416 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(args[i]))); | 4416 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); |
| 4417 } | 4417 } |
| 4418 imp->variadicNodeMethod(head, tail); | 4418 imp->variadicNodeMethod(head, tail); |
| 4419 } | 4419 } |
| 4420 | 4420 |
| 4421 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& args) | 4421 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 4422 { | 4422 { |
| 4423 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4423 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4424 TestObjV8Internal::variadicNodeMethodMethod(args); | 4424 TestObjV8Internal::variadicNodeMethodMethod(info); |
| 4425 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4425 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4426 } | 4426 } |
| 4427 | 4427 |
| 4428 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 4428 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 4429 { | 4429 { |
| 4430 if (UNLIKELY(args.Length() < 3)) { | 4430 if (UNLIKELY(info.Length() < 3)) { |
| 4431 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg
uments", "TestObject", ExceptionMessages::notEnoughArguments(3, args.Length())),
args.GetIsolate()); | 4431 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg
uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())),
info.GetIsolate()); |
| 4432 return; | 4432 return; |
| 4433 } | 4433 } |
| 4434 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4434 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4435 bool strIsNull = args[0]->IsNull(); | 4435 bool strIsNull = info[0]->IsNull(); |
| 4436 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
args[0]); | 4436 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); |
| 4437 String str = strStringResource; | 4437 String str = strStringResource; |
| 4438 bool lIsNull = args[1]->IsNull(); | 4438 bool lIsNull = info[1]->IsNull(); |
| 4439 V8TRYCATCH_VOID(int, l, toInt32(args[1])); | 4439 V8TRYCATCH_VOID(int, l, toInt32(info[1])); |
| 4440 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::HasInstance(args[2], args.GetIs
olate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::O
bject>::Cast(args[2])) : 0); | 4440 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::HasInstance(info[2], info.GetIs
olate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::O
bject>::Cast(info[2])) : 0); |
| 4441 if (UNLIKELY(args.Length() <= 3)) { | 4441 if (UNLIKELY(info.Length() <= 3)) { |
| 4442 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l,
obj); | 4442 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l,
obj); |
| 4443 return; | 4443 return; |
| 4444 } | 4444 } |
| 4445 bool dIsNull = args[3]->IsNull(); | 4445 bool dIsNull = info[3]->IsNull(); |
| 4446 V8TRYCATCH_VOID(double, d, static_cast<double>(args[3]->NumberValue())); | 4446 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); |
| 4447 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
, dIsNull ? 0 : &d); | 4447 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
, dIsNull ? 0 : &d); |
| 4448 } | 4448 } |
| 4449 | 4449 |
| 4450 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& args) | 4450 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 4451 { | 4451 { |
| 4452 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4452 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4453 TestObjV8Internal::methodWithNullableArgumentsMethod(args); | 4453 TestObjV8Internal::methodWithNullableArgumentsMethod(info); |
| 4454 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4454 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4455 } | 4455 } |
| 4456 | 4456 |
| 4457 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args
) | 4457 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 4458 { | 4458 { |
| 4459 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4459 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4460 imp->perWorldMethod(); | 4460 imp->perWorldMethod(); |
| 4461 } | 4461 } |
| 4462 | 4462 |
| 4463 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::
Value>& args) | 4463 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 4464 { | 4464 { |
| 4465 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4465 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4466 imp->perWorldMethod(); | 4466 imp->perWorldMethod(); |
| 4467 } | 4467 } |
| 4468 | 4468 |
| 4469 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4469 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4470 { | 4470 { |
| 4471 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4471 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4472 TestObjV8Internal::perWorldMethodMethod(args); | 4472 TestObjV8Internal::perWorldMethodMethod(info); |
| 4473 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4473 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4474 } | 4474 } |
| 4475 | 4475 |
| 4476 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& args) | 4476 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 4477 { | 4477 { |
| 4478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4479 TestObjV8Internal::perWorldMethodMethodForMainWorld(args); | 4479 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); |
| 4480 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4480 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4481 } | 4481 } |
| 4482 | 4482 |
| 4483 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& args) | 4483 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 4484 { | 4484 { |
| 4485 if (UNLIKELY(args.Length() < 1)) { | 4485 if (UNLIKELY(info.Length() < 1)) { |
| 4486 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); | 4486 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
| 4487 return; | 4487 return; |
| 4488 } | 4488 } |
| 4489 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4489 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4490 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4490 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4491 imp->overloadedPerWorldMethod(longArg); | 4491 imp->overloadedPerWorldMethod(longArg); |
| 4492 } | 4492 } |
| 4493 | 4493 |
| 4494 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& args) | 4494 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 4495 { | 4495 { |
| 4496 if (UNLIKELY(args.Length() < 1)) { | 4496 if (UNLIKELY(info.Length() < 1)) { |
| 4497 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); | 4497 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
| 4498 return; | 4498 return; |
| 4499 } | 4499 } |
| 4500 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4500 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4501 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4501 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4502 imp->overloadedPerWorldMethod(longArg); | 4502 imp->overloadedPerWorldMethod(longArg); |
| 4503 } | 4503 } |
| 4504 | 4504 |
| 4505 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& args) | 4505 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 4506 { | 4506 { |
| 4507 if (UNLIKELY(args.Length() < 2)) { | 4507 if (UNLIKELY(info.Length() < 2)) { |
| 4508 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, args.Length())), ar
gs.GetIsolate()); | 4508 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); |
| 4509 return; | 4509 return; |
| 4510 } | 4510 } |
| 4511 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4511 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4512 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 4512 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 4513 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); | 4513 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| 4514 imp->overloadedPerWorldMethod(strArg, longArg); | 4514 imp->overloadedPerWorldMethod(strArg, longArg); |
| 4515 } | 4515 } |
| 4516 | 4516 |
| 4517 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& args) | 4517 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 4518 { | 4518 { |
| 4519 if (UNLIKELY(args.Length() < 2)) { | 4519 if (UNLIKELY(info.Length() < 2)) { |
| 4520 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, args.Length())), ar
gs.GetIsolate()); | 4520 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); |
| 4521 return; | 4521 return; |
| 4522 } | 4522 } |
| 4523 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4523 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4524 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 4524 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 4525 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); | 4525 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| 4526 imp->overloadedPerWorldMethod(strArg, longArg); | 4526 imp->overloadedPerWorldMethod(strArg, longArg); |
| 4527 } | 4527 } |
| 4528 | 4528 |
| 4529 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& args) | 4529 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 4530 { | 4530 { |
| 4531 if (args.Length() == 1) { | 4531 if (info.Length() == 1) { |
| 4532 overloadedPerWorldMethod1Method(args); | 4532 overloadedPerWorldMethod1Method(info); |
| 4533 return; | 4533 return; |
| 4534 } | 4534 } |
| 4535 if (args.Length() == 2) { | 4535 if (info.Length() == 2) { |
| 4536 overloadedPerWorldMethod2Method(args); | 4536 overloadedPerWorldMethod2Method(info); |
| 4537 return; | 4537 return; |
| 4538 } | 4538 } |
| 4539 if (UNLIKELY(args.Length() < 1)) { | 4539 if (UNLIKELY(info.Length() < 1)) { |
| 4540 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); | 4540 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
| 4541 return; | 4541 return; |
| 4542 } | 4542 } |
| 4543 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4543 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4544 } | 4544 } |
| 4545 | 4545 |
| 4546 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac
kInfo<v8::Value>& args) | 4546 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 4547 { | 4547 { |
| 4548 if (args.Length() == 1) { | 4548 if (info.Length() == 1) { |
| 4549 overloadedPerWorldMethod1MethodForMainWorld(args); | 4549 overloadedPerWorldMethod1MethodForMainWorld(info); |
| 4550 return; | 4550 return; |
| 4551 } | 4551 } |
| 4552 if (args.Length() == 2) { | 4552 if (info.Length() == 2) { |
| 4553 overloadedPerWorldMethod2MethodForMainWorld(args); | 4553 overloadedPerWorldMethod2MethodForMainWorld(info); |
| 4554 return; | 4554 return; |
| 4555 } | 4555 } |
| 4556 if (UNLIKELY(args.Length() < 1)) { | 4556 if (UNLIKELY(info.Length() < 1)) { |
| 4557 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); | 4557 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
| 4558 return; | 4558 return; |
| 4559 } | 4559 } |
| 4560 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4560 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4561 } | 4561 } |
| 4562 | 4562 |
| 4563 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& args) | 4563 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 4564 { | 4564 { |
| 4565 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4565 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4566 TestObjV8Internal::overloadedPerWorldMethodMethod(args); | 4566 TestObjV8Internal::overloadedPerWorldMethodMethod(info); |
| 4567 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4567 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4568 } | 4568 } |
| 4569 | 4569 |
| 4570 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& args) | 4570 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 4571 { | 4571 { |
| 4572 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4572 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4573 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(args); | 4573 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); |
| 4574 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4574 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4575 } | 4575 } |
| 4576 | 4576 |
| 4577 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& args) | 4577 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 4578 { | 4578 { |
| 4579 if (UNLIKELY(args.Length() < 1)) { | 4579 if (UNLIKELY(info.Length() < 1)) { |
| 4580 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1
", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.
GetIsolate()); | 4580 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
| 4581 return; | 4581 return; |
| 4582 } | 4582 } |
| 4583 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4583 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4584 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4584 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4585 imp->activityLoggedMethod1(longArg); | 4585 imp->activityLoggedMethod1(longArg); |
| 4586 } | 4586 } |
| 4587 | 4587 |
| 4588 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& args) | 4588 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 4589 { | 4589 { |
| 4590 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4590 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4591 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 4591 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
| 4592 if (contextData && contextData->activityLogger()) { | 4592 if (contextData && contextData->activityLogger()) { |
| 4593 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 4593 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info); |
| 4594 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", a
rgs.Length(), loggerArgs.data(), "Method"); | 4594 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); |
| 4595 } | 4595 } |
| 4596 TestObjV8Internal::activityLoggedMethod1Method(args); | 4596 TestObjV8Internal::activityLoggedMethod1Method(info); |
| 4597 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4597 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4598 } | 4598 } |
| 4599 | 4599 |
| 4600 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& args) | 4600 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 4601 { | 4601 { |
| 4602 if (UNLIKELY(args.Length() < 1)) { | 4602 if (UNLIKELY(info.Length() < 1)) { |
| 4603 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.
GetIsolate()); | 4603 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
| 4604 return; | 4604 return; |
| 4605 } | 4605 } |
| 4606 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4606 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4607 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4607 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4608 imp->activityLoggedMethod2(longArg); | 4608 imp->activityLoggedMethod2(longArg); |
| 4609 } | 4609 } |
| 4610 | 4610 |
| 4611 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& args) | 4611 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
| 4612 { | 4612 { |
| 4613 if (UNLIKELY(args.Length() < 1)) { | 4613 if (UNLIKELY(info.Length() < 1)) { |
| 4614 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.
GetIsolate()); | 4614 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
| 4615 return; | 4615 return; |
| 4616 } | 4616 } |
| 4617 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4617 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4618 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4618 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4619 imp->activityLoggedMethod2(longArg); | 4619 imp->activityLoggedMethod2(longArg); |
| 4620 } | 4620 } |
| 4621 | 4621 |
| 4622 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& args) | 4622 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 4623 { | 4623 { |
| 4624 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4624 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4625 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 4625 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
| 4626 if (contextData && contextData->activityLogger()) { | 4626 if (contextData && contextData->activityLogger()) { |
| 4627 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 4627 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info); |
| 4628 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a
rgs.Length(), loggerArgs.data(), "Method"); | 4628 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
| 4629 } | 4629 } |
| 4630 TestObjV8Internal::activityLoggedMethod2Method(args); | 4630 TestObjV8Internal::activityLoggedMethod2Method(info); |
| 4631 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4631 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4632 } | 4632 } |
| 4633 | 4633 |
| 4634 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& args) | 4634 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
| 4635 { | 4635 { |
| 4636 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4636 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4637 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 4637 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
| 4638 if (contextData && contextData->activityLogger()) { | 4638 if (contextData && contextData->activityLogger()) { |
| 4639 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 4639 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info); |
| 4640 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a
rgs.Length(), loggerArgs.data(), "Method"); | 4640 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
| 4641 } | 4641 } |
| 4642 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(args); | 4642 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); |
| 4643 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4643 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4644 } | 4644 } |
| 4645 | 4645 |
| 4646 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& args) | 4646 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
| 4647 { | 4647 { |
| 4648 if (UNLIKELY(args.Length() < 1)) { | 4648 if (UNLIKELY(info.Length() < 1)) { |
| 4649 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Len
gth())), args.GetIsolate()); | 4649 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); |
| 4650 return; | 4650 return; |
| 4651 } | 4651 } |
| 4652 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4652 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4653 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4653 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4654 imp->activityLoggedInIsolatedWorldMethod(longArg); | 4654 imp->activityLoggedInIsolatedWorldMethod(longArg); |
| 4655 } | 4655 } |
| 4656 | 4656 |
| 4657 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& args) | 4657 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) |
| 4658 { | 4658 { |
| 4659 if (UNLIKELY(args.Length() < 1)) { | 4659 if (UNLIKELY(info.Length() < 1)) { |
| 4660 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Len
gth())), args.GetIsolate()); | 4660 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); |
| 4661 return; | 4661 return; |
| 4662 } | 4662 } |
| 4663 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4663 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4664 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4664 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4665 imp->activityLoggedInIsolatedWorldMethod(longArg); | 4665 imp->activityLoggedInIsolatedWorldMethod(longArg); |
| 4666 } | 4666 } |
| 4667 | 4667 |
| 4668 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& args) | 4668 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
| 4669 { | 4669 { |
| 4670 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4670 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4671 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 4671 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
| 4672 if (contextData && contextData->activityLogger()) { | 4672 if (contextData && contextData->activityLogger()) { |
| 4673 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 4673 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info); |
| 4674 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", args.Length(), loggerArgs.data(), "Method"); | 4674 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); |
| 4675 } | 4675 } |
| 4676 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(args); | 4676 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); |
| 4677 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4677 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4678 } | 4678 } |
| 4679 | 4679 |
| 4680 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& args) | 4680 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 4681 { | 4681 { |
| 4682 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4682 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4683 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(arg
s); | 4683 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); |
| 4684 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4684 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4685 } | 4685 } |
| 4686 | 4686 |
| 4687 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& args) | 4687 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 4688 { | 4688 { |
| 4689 if (UNLIKELY(args.Length() < 1)) { | 4689 if (UNLIKELY(info.Length() < 1)) { |
| 4690 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()
)), args.GetIsolate()); | 4690 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
| 4691 return; | 4691 return; |
| 4692 } | 4692 } |
| 4693 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4693 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4694 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4694 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4695 imp->overloadedActivityLoggedMethod(longArg); | 4695 imp->overloadedActivityLoggedMethod(longArg); |
| 4696 } | 4696 } |
| 4697 | 4697 |
| 4698 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& args) | 4698 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
| 4699 { | 4699 { |
| 4700 if (UNLIKELY(args.Length() < 1)) { | 4700 if (UNLIKELY(info.Length() < 1)) { |
| 4701 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()
)), args.GetIsolate()); | 4701 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
| 4702 return; | 4702 return; |
| 4703 } | 4703 } |
| 4704 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4704 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4705 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); | 4705 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| 4706 imp->overloadedActivityLoggedMethod(longArg); | 4706 imp->overloadedActivityLoggedMethod(longArg); |
| 4707 } | 4707 } |
| 4708 | 4708 |
| 4709 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
<v8::Value>& args) | 4709 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 4710 { | 4710 { |
| 4711 if (UNLIKELY(args.Length() < 2)) { | 4711 if (UNLIKELY(info.Length() < 2)) { |
| 4712 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, args.Length()
)), args.GetIsolate()); | 4712 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); |
| 4713 return; | 4713 return; |
| 4714 } | 4714 } |
| 4715 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4715 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4716 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 4716 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 4717 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); | 4717 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| 4718 imp->overloadedActivityLoggedMethod(strArg, longArg); | 4718 imp->overloadedActivityLoggedMethod(strArg, longArg); |
| 4719 } | 4719 } |
| 4720 | 4720 |
| 4721 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& args) | 4721 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
| 4722 { | 4722 { |
| 4723 if (UNLIKELY(args.Length() < 2)) { | 4723 if (UNLIKELY(info.Length() < 2)) { |
| 4724 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, args.Length()
)), args.GetIsolate()); | 4724 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); |
| 4725 return; | 4725 return; |
| 4726 } | 4726 } |
| 4727 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4727 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4728 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); | 4728 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 4729 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); | 4729 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| 4730 imp->overloadedActivityLoggedMethod(strArg, longArg); | 4730 imp->overloadedActivityLoggedMethod(strArg, longArg); |
| 4731 } | 4731 } |
| 4732 | 4732 |
| 4733 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<
v8::Value>& args) | 4733 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 4734 { | 4734 { |
| 4735 if (args.Length() == 1) { | 4735 if (info.Length() == 1) { |
| 4736 overloadedActivityLoggedMethod1Method(args); | 4736 overloadedActivityLoggedMethod1Method(info); |
| 4737 return; | 4737 return; |
| 4738 } | 4738 } |
| 4739 if (args.Length() == 2) { | 4739 if (info.Length() == 2) { |
| 4740 overloadedActivityLoggedMethod2Method(args); | 4740 overloadedActivityLoggedMethod2Method(info); |
| 4741 return; | 4741 return; |
| 4742 } | 4742 } |
| 4743 if (UNLIKELY(args.Length() < 1)) { | 4743 if (UNLIKELY(info.Length() < 1)) { |
| 4744 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()
)), args.GetIsolate()); | 4744 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
| 4745 return; | 4745 return; |
| 4746 } | 4746 } |
| 4747 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4747 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4748 } | 4748 } |
| 4749 | 4749 |
| 4750 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC
allbackInfo<v8::Value>& args) | 4750 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 4751 { | 4751 { |
| 4752 if (args.Length() == 1) { | 4752 if (info.Length() == 1) { |
| 4753 overloadedActivityLoggedMethod1MethodForMainWorld(args); | 4753 overloadedActivityLoggedMethod1MethodForMainWorld(info); |
| 4754 return; | 4754 return; |
| 4755 } | 4755 } |
| 4756 if (args.Length() == 2) { | 4756 if (info.Length() == 2) { |
| 4757 overloadedActivityLoggedMethod2MethodForMainWorld(args); | 4757 overloadedActivityLoggedMethod2MethodForMainWorld(info); |
| 4758 return; | 4758 return; |
| 4759 } | 4759 } |
| 4760 if (UNLIKELY(args.Length() < 1)) { | 4760 if (UNLIKELY(info.Length() < 1)) { |
| 4761 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, args.Length()
)), args.GetIsolate()); | 4761 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
| 4762 return; | 4762 return; |
| 4763 } | 4763 } |
| 4764 throwUninformativeAndGenericTypeError(args.GetIsolate()); | 4764 throwUninformativeAndGenericTypeError(info.GetIsolate()); |
| 4765 } | 4765 } |
| 4766 | 4766 |
| 4767 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& args) | 4767 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 4768 { | 4768 { |
| 4769 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4769 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4770 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 4770 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
| 4771 if (contextData && contextData->activityLogger()) { | 4771 if (contextData && contextData->activityLogger()) { |
| 4772 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 4772 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info); |
| 4773 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", args.Length(), loggerArgs.data(), "Method"); | 4773 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
| 4774 } | 4774 } |
| 4775 TestObjV8Internal::overloadedActivityLoggedMethodMethod(args); | 4775 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); |
| 4776 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4776 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4777 } | 4777 } |
| 4778 | 4778 |
| 4779 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::F
unctionCallbackInfo<v8::Value>& args) | 4779 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::F
unctionCallbackInfo<v8::Value>& info) |
| 4780 { | 4780 { |
| 4781 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4781 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4782 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 4782 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
| 4783 if (contextData && contextData->activityLogger()) { | 4783 if (contextData && contextData->activityLogger()) { |
| 4784 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 4784 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info); |
| 4785 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", args.Length(), loggerArgs.data(), "Method"); | 4785 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
| 4786 } | 4786 } |
| 4787 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(args); | 4787 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); |
| 4788 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4788 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4789 } | 4789 } |
| 4790 | 4790 |
| 4791 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& ar
gs) | 4791 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4792 { | 4792 { |
| 4793 TestObj* imp = V8TestObject::toNative(args.Holder()); | 4793 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4794 imp->deprecatedMethod(); | 4794 imp->deprecatedMethod(); |
| 4795 } | 4795 } |
| 4796 | 4796 |
| 4797 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& args) | 4797 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 4798 { | 4798 { |
| 4799 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4799 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4800 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); | 4800 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); |
| 4801 TestObjV8Internal::deprecatedMethodMethod(args); | 4801 TestObjV8Internal::deprecatedMethodMethod(info); |
| 4802 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4802 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4803 } | 4803 } |
| 4804 | 4804 |
| 4805 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& args) | 4805 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 4806 { | 4806 { |
| 4807 TestObj::deprecatedStaticMethod(); | 4807 TestObj::deprecatedStaticMethod(); |
| 4808 } | 4808 } |
| 4809 | 4809 |
| 4810 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& args) | 4810 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 4811 { | 4811 { |
| 4812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4813 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); | 4813 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); |
| 4814 TestObjV8Internal::deprecatedStaticMethodMethod(args); | 4814 TestObjV8Internal::deprecatedStaticMethodMethod(info); |
| 4815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 4816 } | 4816 } |
| 4817 | 4817 |
| 4818 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) | 4818 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4819 { | 4819 { |
| 4820 if (UNLIKELY(args.Length() < 1)) { | 4820 if (UNLIKELY(info.Length() < 1)) { |
| 4821 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate
()); | 4821 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate
()); |
| 4822 return; | 4822 return; |
| 4823 } | 4823 } |
| 4824 if (args.Length() <= 0 || !args[0]->IsFunction()) { | 4824 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| 4825 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), args.GetIsola
te()); | 4825 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), info.GetIsola
te()); |
| 4826 return; | 4826 return; |
| 4827 } | 4827 } |
| 4828 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getExecu
tionContext()); | 4828 RefPtr<TestCallback> testCallback = V8TestCallback::create(info[0], getExecu
tionContext()); |
| 4829 | 4829 |
| 4830 RefPtr<TestObj> impl = TestObj::create(testCallback); | 4830 RefPtr<TestObj> impl = TestObj::create(testCallback); |
| 4831 v8::Handle<v8::Object> wrapper = args.Holder(); | 4831 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 4832 | 4832 |
| 4833 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te
stObject::wrapperTypeInfo, wrapper, args.GetIsolate(), WrapperConfiguration::Dep
endent); | 4833 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te
stObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep
endent); |
| 4834 args.GetReturnValue().Set(wrapper); | 4834 info.GetReturnValue().Set(wrapper); |
| 4835 } | 4835 } |
| 4836 | 4836 |
| 4837 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 4837 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 4838 { | 4838 { |
| 4839 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | 4839 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
| 4840 TestObj* collection = V8TestObject::toNative(info.Holder()); | 4840 TestObj* collection = V8TestObject::toNative(info.Holder()); |
| 4841 RefPtr<Node> element = collection->item(index); | 4841 RefPtr<Node> element = collection->item(index); |
| 4842 if (!element) | 4842 if (!element) |
| 4843 return; | 4843 return; |
| 4844 v8SetReturnValueFast(info, element.release(), collection); | 4844 v8SetReturnValueFast(info, element.release(), collection); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5085 {"methodWithNullableArguments", TestObjV8Internal::methodWithNullableArgumen
tsMethodCallback, 0, 3}, | 5085 {"methodWithNullableArguments", TestObjV8Internal::methodWithNullableArgumen
tsMethodCallback, 0, 3}, |
| 5086 {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV
8Internal::perWorldMethodMethodCallbackForMainWorld, 0}, | 5086 {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV
8Internal::perWorldMethodMethodCallbackForMainWorld, 0}, |
| 5087 {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMeth
odCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorl
d, 1}, | 5087 {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMeth
odCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorl
d, 1}, |
| 5088 {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCall
back, 0, 1}, | 5088 {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCall
back, 0, 1}, |
| 5089 {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCall
back, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1}, | 5089 {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCall
back, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1}, |
| 5090 {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInI
solatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWor
ldMethodMethodCallbackForMainWorld, 1}, | 5090 {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInI
solatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWor
ldMethodMethodCallbackForMainWorld, 1}, |
| 5091 {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLogg
edMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodC
allbackForMainWorld, 1}, | 5091 {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLogg
edMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodC
allbackForMainWorld, 1}, |
| 5092 {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0
}, | 5092 {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0
}, |
| 5093 }; | 5093 }; |
| 5094 | 5094 |
| 5095 void V8TestObject::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& args) | 5095 void V8TestObject::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 5096 { | 5096 { |
| 5097 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); | 5097 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); |
| 5098 if (!args.IsConstructCall()) { | 5098 if (!info.IsConstructCall()) { |
| 5099 throwTypeError(ExceptionMessages::failedToConstruct("TestObject", "Pleas
e use the 'new' operator, this DOM object constructor cannot be called as a func
tion."), args.GetIsolate()); | 5099 throwTypeError(ExceptionMessages::failedToConstruct("TestObject", "Pleas
e use the 'new' operator, this DOM object constructor cannot be called as a func
tion."), info.GetIsolate()); |
| 5100 return; | 5100 return; |
| 5101 } | 5101 } |
| 5102 | 5102 |
| 5103 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { | 5103 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
| 5104 args.GetReturnValue().Set(args.Holder()); | 5104 info.GetReturnValue().Set(info.Holder()); |
| 5105 return; | 5105 return; |
| 5106 } | 5106 } |
| 5107 | 5107 |
| 5108 TestObjV8Internal::constructor(args); | 5108 TestObjV8Internal::constructor(info); |
| 5109 } | 5109 } |
| 5110 | 5110 |
| 5111 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle
<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorld
Type) | 5111 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle
<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorld
Type) |
| 5112 { | 5112 { |
| 5113 desc->ReadOnlyPrototype(); | 5113 desc->ReadOnlyPrototype(); |
| 5114 | 5114 |
| 5115 v8::Local<v8::Signature> defaultSignature; | 5115 v8::Local<v8::Signature> defaultSignature; |
| 5116 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestOb
ject", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::inte
rnalFieldCount, | 5116 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestOb
ject", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::inte
rnalFieldCount, |
| 5117 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), | 5117 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), |
| 5118 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), | 5118 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5296 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); | 5296 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); |
| 5297 return wrapper; | 5297 return wrapper; |
| 5298 } | 5298 } |
| 5299 | 5299 |
| 5300 void V8TestObject::derefObject(void* object) | 5300 void V8TestObject::derefObject(void* object) |
| 5301 { | 5301 { |
| 5302 fromInternalPointer(object)->deref(); | 5302 fromInternalPointer(object)->deref(); |
| 5303 } | 5303 } |
| 5304 | 5304 |
| 5305 } // namespace WebCore | 5305 } // namespace WebCore |
| OLD | NEW |