Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: Source/bindings/tests/results/V8TestObject.cpp

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 21 matching lines...) Expand all
32 #include "V8SVGPoint.h" 32 #include "V8SVGPoint.h"
33 #include "V8TestCallback.h" 33 #include "V8TestCallback.h"
34 #include "V8TestInterface.h" 34 #include "V8TestInterface.h"
35 #include "V8TestNode.h" 35 #include "V8TestNode.h"
36 #include "V8TestObjectectA.h" 36 #include "V8TestObjectectA.h"
37 #include "V8TestObjectectB.h" 37 #include "V8TestObjectectB.h"
38 #include "V8TestObjectectC.h" 38 #include "V8TestObjectectC.h"
39 #include "V8TestSubObj.h" 39 #include "V8TestSubObj.h"
40 #include "bindings/v8/BindingSecurity.h" 40 #include "bindings/v8/BindingSecurity.h"
41 #include "bindings/v8/Dictionary.h" 41 #include "bindings/v8/Dictionary.h"
42 #include "bindings/v8/ExceptionMessages.h"
42 #include "bindings/v8/ExceptionState.h" 43 #include "bindings/v8/ExceptionState.h"
43 #include "bindings/v8/ScriptController.h" 44 #include "bindings/v8/ScriptController.h"
44 #include "bindings/v8/ScriptValue.h" 45 #include "bindings/v8/ScriptValue.h"
45 #include "bindings/v8/SerializedScriptValue.h" 46 #include "bindings/v8/SerializedScriptValue.h"
46 #include "bindings/v8/V8AbstractEventListener.h" 47 #include "bindings/v8/V8AbstractEventListener.h"
47 #include "bindings/v8/V8Binding.h" 48 #include "bindings/v8/V8Binding.h"
48 #include "bindings/v8/V8DOMActivityLogger.h" 49 #include "bindings/v8/V8DOMActivityLogger.h"
49 #include "bindings/v8/V8DOMConfiguration.h" 50 #include "bindings/v8/V8DOMConfiguration.h"
50 #include "bindings/v8/V8DOMWrapper.h" 51 #include "bindings/v8/V8DOMWrapper.h"
51 #include "bindings/v8/V8EventListenerList.h" 52 #include "bindings/v8/V8EventListenerList.h"
(...skipping 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 2961 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
2961 { 2962 {
2962 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 2963 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2963 TestObjV8Internal::voidMethodMethod(args); 2964 TestObjV8Internal::voidMethodMethod(args);
2964 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2965 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2965 } 2966 }
2966 2967
2967 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 2968 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
2968 { 2969 {
2969 if (UNLIKELY(args.Length() < 3)) { 2970 if (UNLIKELY(args.Length() < 3)) {
2970 throwNotEnoughArgumentsError(args.GetIsolate()); 2971 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObj", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIso late());
2971 return; 2972 return;
2972 } 2973 }
2973 TestObj* imp = V8TestObject::toNative(args.Holder()); 2974 TestObj* imp = V8TestObject::toNative(args.Holder());
2974 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 2975 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
2975 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); 2976 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]);
2976 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[2])) : 0); 2977 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[2])) : 0);
2977 imp->voidMethodWithArgs(longArg, strArg, objArg); 2978 imp->voidMethodWithArgs(longArg, strArg, objArg);
2978 2979
2979 return; 2980 return;
2980 } 2981 }
(...skipping 15 matching lines...) Expand all
2996 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 2997 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
2997 { 2998 {
2998 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 2999 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2999 TestObjV8Internal::longMethodMethod(args); 3000 TestObjV8Internal::longMethodMethod(args);
3000 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3001 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3001 } 3002 }
3002 3003
3003 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 3004 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
3004 { 3005 {
3005 if (UNLIKELY(args.Length() < 3)) { 3006 if (UNLIKELY(args.Length() < 3)) {
3006 throwNotEnoughArgumentsError(args.GetIsolate()); 3007 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObj", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIso late());
3007 return; 3008 return;
3008 } 3009 }
3009 TestObj* imp = V8TestObject::toNative(args.Holder()); 3010 TestObj* imp = V8TestObject::toNative(args.Holder());
3010 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 3011 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
3011 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); 3012 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]);
3012 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[2])) : 0); 3013 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[2])) : 0);
3013 v8SetReturnValueInt(args, imp->longMethodWithArgs(longArg, strArg, objArg)); 3014 v8SetReturnValueInt(args, imp->longMethodWithArgs(longArg, strArg, objArg));
3014 return; 3015 return;
3015 } 3016 }
3016 3017
(...skipping 15 matching lines...) Expand all
3032 { 3033 {
3033 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3034 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3034 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); 3035 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
3035 TestObjV8Internal::objMethodMethod(args); 3036 TestObjV8Internal::objMethodMethod(args);
3036 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3037 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3037 } 3038 }
3038 3039
3039 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 3040 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
3040 { 3041 {
3041 if (UNLIKELY(args.Length() < 3)) { 3042 if (UNLIKELY(args.Length() < 3)) {
3042 throwNotEnoughArgumentsError(args.GetIsolate()); 3043 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", " TestObj", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIsol ate());
3043 return; 3044 return;
3044 } 3045 }
3045 TestObj* imp = V8TestObject::toNative(args.Holder()); 3046 TestObj* imp = V8TestObject::toNative(args.Holder());
3046 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 3047 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
3047 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); 3048 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]);
3048 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[2])) : 0); 3049 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[2], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[2])) : 0);
3049 v8SetReturnValue(args, imp->objMethodWithArgs(longArg, strArg, objArg), args .Holder()); 3050 v8SetReturnValue(args, imp->objMethodWithArgs(longArg, strArg, objArg), args .Holder());
3050 return; 3051 return;
3051 } 3052 }
3052 3053
3053 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& args) 3054 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& args)
3054 { 3055 {
3055 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3056 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3056 TestObjV8Internal::objMethodWithArgsMethod(args); 3057 TestObjV8Internal::objMethodWithArgsMethod(args);
3057 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3058 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3058 } 3059 }
3059 3060
3060 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args) 3061 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args)
3061 { 3062 {
3062 if (UNLIKELY(args.Length() < 1)) { 3063 if (UNLIKELY(args.Length() < 1)) {
3063 throwNotEnoughArgumentsError(args.GetIsolate()); 3064 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg ", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
3064 return; 3065 return;
3065 } 3066 }
3066 TestObj* imp = V8TestObject::toNative(args.Holder()); 3067 TestObj* imp = V8TestObject::toNative(args.Holder());
3067 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative Array<TestInterface, V8TestInterface>(args[0], args.GetIsolate()))); 3068 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative Array<TestInterface, V8TestInterface>(args[0], args.GetIsolate())));
3068 imp->methodWithSequenceArg(sequenceArg); 3069 imp->methodWithSequenceArg(sequenceArg);
3069 3070
3070 return; 3071 return;
3071 } 3072 }
3072 3073
3073 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 3074 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
3074 { 3075 {
3075 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3076 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3076 TestObjV8Internal::methodWithSequenceArgMethod(args); 3077 TestObjV8Internal::methodWithSequenceArgMethod(args);
3077 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3078 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3078 } 3079 }
3079 3080
3080 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val ue>& args) 3081 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val ue>& args)
3081 { 3082 {
3082 if (UNLIKELY(args.Length() < 1)) { 3083 if (UNLIKELY(args.Length() < 1)) {
3083 throwNotEnoughArgumentsError(args.GetIsolate()); 3084 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen ce", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.G etIsolate());
3084 return; 3085 return;
3085 } 3086 }
3086 TestObj* imp = V8TestObject::toNative(args.Holder()); 3087 TestObj* imp = V8TestObject::toNative(args.Holder());
3087 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 3088 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
3088 v8SetReturnValue(args, v8Array(imp->methodReturningSequence(longArg), args.G etIsolate())); 3089 v8SetReturnValue(args, v8Array(imp->methodReturningSequence(longArg), args.G etIsolate()));
3089 return; 3090 return;
3090 } 3091 }
3091 3092
3092 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& args) 3093 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& args)
3093 { 3094 {
3094 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3095 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3095 TestObjV8Internal::methodReturningSequenceMethod(args); 3096 TestObjV8Internal::methodReturningSequenceMethod(args);
3096 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3097 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3097 } 3098 }
3098 3099
3099 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 3100 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
3100 { 3101 {
3101 if (UNLIKELY(args.Length() < 1)) { 3102 if (UNLIKELY(args.Length() < 1)) {
3102 throwNotEnoughArgumentsError(args.GetIsolate()); 3103 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", " TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsol ate());
3103 return; 3104 return;
3104 } 3105 }
3105 TestObj* imp = V8TestObject::toNative(args.Holder()); 3106 TestObj* imp = V8TestObject::toNative(args.Holder());
3106 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, args[0]); 3107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, args[0]);
3107 String string = enumArg; 3108 String string = enumArg;
3108 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st ring == "EnumValue3")) { 3109 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st ring == "EnumValue3")) {
3109 throwTypeError(args.GetIsolate()); 3110 throwTypeError(args.GetIsolate());
3110 return; 3111 return;
3111 } 3112 }
3112 imp->methodWithEnumArg(enumArg); 3113 imp->methodWithEnumArg(enumArg);
3113 3114
3114 return; 3115 return;
3115 } 3116 }
3116 3117
3117 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& args) 3118 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& args)
3118 { 3119 {
3119 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3120 TestObjV8Internal::methodWithEnumArgMethod(args); 3121 TestObjV8Internal::methodWithEnumArgMethod(args);
3121 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3122 } 3123 }
3123 3124
3124 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& args) 3125 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& args)
3125 { 3126 {
3126 if (UNLIKELY(args.Length() < 2)) { 3127 if (UNLIKELY(args.Length() < 2)) {
3127 throwNotEnoughArgumentsError(args.GetIsolate()); 3128 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll ArgsAndThrows", "TestObj", ExceptionMessages::notEnoughArguments(2, args.Length( ))), args.GetIsolate());
3128 return; 3129 return;
3129 } 3130 }
3130 TestObj* imp = V8TestObject::toNative(args.Holder()); 3131 TestObj* imp = V8TestObject::toNative(args.Holder());
3131 ExceptionState es(args.GetIsolate()); 3132 ExceptionState es(args.GetIsolate());
3132 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 3133 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
3133 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[1], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[1])) : 0); 3134 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[1], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[1])) : 0);
3134 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, es); 3135 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, es);
3135 if (es.throwIfNeeded()) 3136 if (es.throwIfNeeded())
3136 return; 3137 return;
3137 v8SetReturnValue(args, result.release(), args.Holder()); 3138 v8SetReturnValue(args, result.release(), args.Holder());
3138 return; 3139 return;
3139 } 3140 }
3140 3141
3141 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& args) 3142 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& args)
3142 { 3143 {
3143 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3144 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(args); 3145 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(args);
3145 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3146 } 3147 }
3147 3148
3148 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& arg s) 3149 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& arg s)
3149 { 3150 {
3150 if (UNLIKELY(args.Length() < 1)) { 3151 if (UNLIKELY(args.Length() < 1)) {
3151 throwNotEnoughArgumentsError(args.GetIsolate()); 3152 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te stObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolat e());
3152 return; 3153 return;
3153 } 3154 }
3154 TestObj* imp = V8TestObject::toNative(args.Holder()); 3155 TestObj* imp = V8TestObject::toNative(args.Holder());
3155 bool serializedArgDidThrow = false; 3156 bool serializedArgDidThrow = false;
3156 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create( args[0], 0, 0, serializedArgDidThrow, args.GetIsolate()); 3157 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create( args[0], 0, 0, serializedArgDidThrow, args.GetIsolate());
3157 if (serializedArgDidThrow) 3158 if (serializedArgDidThrow)
3158 return; 3159 return;
3159 imp->serializedValue(serializedArg); 3160 imp->serializedValue(serializedArg);
3160 3161
3161 return; 3162 return;
3162 } 3163 }
3163 3164
3164 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& args) 3165 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& args)
3165 { 3166 {
3166 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3167 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3167 TestObjV8Internal::serializedValueMethod(args); 3168 TestObjV8Internal::serializedValueMethod(args);
3168 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3169 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3169 } 3170 }
3170 3171
3171 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 3172 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
3172 { 3173 {
3173 if (UNLIKELY(args.Length() < 1)) { 3174 if (UNLIKELY(args.Length() < 1)) {
3174 throwNotEnoughArgumentsError(args.GetIsolate()); 3175 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test Obj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate( ));
3175 return; 3176 return;
3176 } 3177 }
3177 TestObj* imp = V8TestObject::toNative(args.Holder()); 3178 TestObj* imp = V8TestObject::toNative(args.Holder());
3178 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(args[0], args.GetIsolate())); 3179 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(args[0], args.GetIsolate()));
3179 if (!oo.isUndefinedOrNull() && !oo.isObject()) { 3180 if (!oo.isUndefinedOrNull() && !oo.isObject()) {
3180 throwTypeError("Not an object.", args.GetIsolate()); 3181 throwTypeError("Not an object.", args.GetIsolate());
3181 return; 3182 return;
3182 } 3183 }
3183 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(args[1], args.GetIsolate())); 3184 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(args[1], args.GetIsolate()));
3184 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { 3185 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
3519 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 3520 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
3520 { 3521 {
3521 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3522 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3522 TestObjV8Internal::methodWithOptionalArgMethod(args); 3523 TestObjV8Internal::methodWithOptionalArgMethod(args);
3523 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3524 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3524 } 3525 }
3525 3526
3526 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& args) 3527 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& args)
3527 { 3528 {
3528 if (UNLIKELY(args.Length() < 1)) { 3529 if (UNLIKELY(args.Length() < 1)) {
3529 throwNotEnoughArgumentsError(args.GetIsolate()); 3530 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional ArgAndOptionalArg", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Len gth())), args.GetIsolate());
3530 return; 3531 return;
3531 } 3532 }
3532 TestObj* imp = V8TestObject::toNative(args.Holder()); 3533 TestObj* imp = V8TestObject::toNative(args.Holder());
3533 V8TRYCATCH_VOID(int, nonOpt, toInt32(args[0])); 3534 V8TRYCATCH_VOID(int, nonOpt, toInt32(args[0]));
3534 if (UNLIKELY(args.Length() <= 1)) { 3535 if (UNLIKELY(args.Length() <= 1)) {
3535 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); 3536 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
3536 3537
3537 return; 3538 return;
3538 } 3539 }
3539 V8TRYCATCH_VOID(int, opt, toInt32(args[1])); 3540 V8TRYCATCH_VOID(int, opt, toInt32(args[1]));
3540 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); 3541 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
3541 3542
3542 return; 3543 return;
3543 } 3544 }
3544 3545
3545 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& args) 3546 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& args)
3546 { 3547 {
3547 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3548 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3548 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(args); 3549 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(args);
3549 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3550 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3550 } 3551 }
3551 3552
3552 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC allbackInfo<v8::Value>& args) 3553 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC allbackInfo<v8::Value>& args)
3553 { 3554 {
3554 if (UNLIKELY(args.Length() < 1)) { 3555 if (UNLIKELY(args.Length() < 1)) {
3555 throwNotEnoughArgumentsError(args.GetIsolate()); 3556 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional ArgAndTwoOptionalArgs", "TestObj", ExceptionMessages::notEnoughArguments(1, args .Length())), args.GetIsolate());
3556 return; 3557 return;
3557 } 3558 }
3558 TestObj* imp = V8TestObject::toNative(args.Holder()); 3559 TestObj* imp = V8TestObject::toNative(args.Holder());
3559 V8TRYCATCH_VOID(int, nonOpt, toInt32(args[0])); 3560 V8TRYCATCH_VOID(int, nonOpt, toInt32(args[0]));
3560 if (UNLIKELY(args.Length() <= 1)) { 3561 if (UNLIKELY(args.Length() <= 1)) {
3561 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); 3562 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
3562 3563
3563 return; 3564 return;
3564 } 3565 }
3565 V8TRYCATCH_VOID(int, opt1, toInt32(args[1])); 3566 V8TRYCATCH_VOID(int, opt1, toInt32(args[1]));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
3630 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& args) 3631 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& args)
3631 { 3632 {
3632 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3633 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3633 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(args); 3634 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(args);
3634 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3635 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3635 } 3636 }
3636 3637
3637 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args) 3638 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args)
3638 { 3639 {
3639 if (UNLIKELY(args.Length() < 1)) { 3640 if (UNLIKELY(args.Length() < 1)) {
3640 throwNotEnoughArgumentsError(args.GetIsolate()); 3641 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg ", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
3641 return; 3642 return;
3642 } 3643 }
3643 TestObj* imp = V8TestObject::toNative(args.Holder()); 3644 TestObj* imp = V8TestObject::toNative(args.Holder());
3644 if (args.Length() <= 0 || !args[0]->IsFunction()) { 3645 if (args.Length() <= 0 || !args[0]->IsFunction()) {
3645 throwTypeError(args.GetIsolate()); 3646 throwTypeError(args.GetIsolate());
3646 return; 3647 return;
3647 } 3648 }
3648 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe cutionContext()); 3649 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe cutionContext());
3649 imp->methodWithCallbackArg(callback); 3650 imp->methodWithCallbackArg(callback);
3650 3651
3651 return; 3652 return;
3652 } 3653 }
3653 3654
3654 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 3655 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
3655 { 3656 {
3656 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3657 TestObjV8Internal::methodWithCallbackArgMethod(args); 3658 TestObjV8Internal::methodWithCallbackArgMethod(args);
3658 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3659 } 3660 }
3660 3661
3661 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& args) 3662 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& args)
3662 { 3663 {
3663 if (UNLIKELY(args.Length() < 2)) { 3664 if (UNLIKELY(args.Length() < 2)) {
3664 throwNotEnoughArgumentsError(args.GetIsolate()); 3665 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback ArgAndCallbackArg", "TestObj", ExceptionMessages::notEnoughArguments(2, args.Len gth())), args.GetIsolate());
3665 return; 3666 return;
3666 } 3667 }
3667 TestObj* imp = V8TestObject::toNative(args.Holder()); 3668 TestObj* imp = V8TestObject::toNative(args.Holder());
3668 V8TRYCATCH_VOID(int, nonCallback, toInt32(args[0])); 3669 V8TRYCATCH_VOID(int, nonCallback, toInt32(args[0]));
3669 if (args.Length() <= 1 || !args[1]->IsFunction()) { 3670 if (args.Length() <= 1 || !args[1]->IsFunction()) {
3670 throwTypeError(args.GetIsolate()); 3671 throwTypeError(args.GetIsolate());
3671 return; 3672 return;
3672 } 3673 }
3673 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExe cutionContext()); 3674 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExe cutionContext());
3674 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); 3675 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
(...skipping 27 matching lines...) Expand all
3702 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal lbackInfo<v8::Value>& args) 3703 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal lbackInfo<v8::Value>& args)
3703 { 3704 {
3704 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3705 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3705 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(args); 3706 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(args);
3706 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3707 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3707 } 3708 }
3708 3709
3709 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v 8::Value>& args) 3710 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v 8::Value>& args)
3710 { 3711 {
3711 if (UNLIKELY(args.Length() < 1)) { 3712 if (UNLIKELY(args.Length() < 1)) {
3712 throwNotEnoughArgumentsError(args.GetIsolate()); 3713 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal lbackArg", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
3713 return; 3714 return;
3714 } 3715 }
3715 TestObj* imp = V8TestObject::toNative(args.Holder()); 3716 TestObj* imp = V8TestObject::toNative(args.Holder());
3716 if (args.Length() <= 0 || !(args[0]->IsFunction() || args[0]->IsNull())) { 3717 if (args.Length() <= 0 || !(args[0]->IsFunction() || args[0]->IsNull())) {
3717 throwTypeError(args.GetIsolate()); 3718 throwTypeError(args.GetIsolate());
3718 return; 3719 return;
3719 } 3720 }
3720 RefPtr<TestCallback> callback = args[0]->IsNull() ? 0 : V8TestCallback::crea te(args[0], getScriptExecutionContext()); 3721 RefPtr<TestCallback> callback = args[0]->IsNull() ? 0 : V8TestCallback::crea te(args[0], getScriptExecutionContext());
3721 imp->methodWithNullableCallbackArg(callback); 3722 imp->methodWithNullableCallbackArg(callback);
3722 3723
(...skipping 25 matching lines...) Expand all
3748 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& args) 3749 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& args)
3749 { 3750 {
3750 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3751 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3751 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(args); 3752 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(args);
3752 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3753 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3753 } 3754 }
3754 3755
3755 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& args) 3756 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& args)
3756 { 3757 {
3757 if (UNLIKELY(args.Length() < 1)) { 3758 if (UNLIKELY(args.Length() < 1)) {
3758 throwNotEnoughArgumentsError(args.GetIsolate()); 3759 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb ackArg", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), ar gs.GetIsolate());
3759 return; 3760 return;
3760 } 3761 }
3761 if (args.Length() <= 0 || !args[0]->IsFunction()) { 3762 if (args.Length() <= 0 || !args[0]->IsFunction()) {
3762 throwTypeError(args.GetIsolate()); 3763 throwTypeError(args.GetIsolate());
3763 return; 3764 return;
3764 } 3765 }
3765 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe cutionContext()); 3766 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe cutionContext());
3766 TestObj::staticMethodWithCallbackArg(callback); 3767 TestObj::staticMethodWithCallbackArg(callback);
3767 3768
3768 return; 3769 return;
3769 } 3770 }
3770 3771
3771 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& args) 3772 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& args)
3772 { 3773 {
3773 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3774 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3774 TestObjV8Internal::staticMethodWithCallbackArgMethod(args); 3775 TestObjV8Internal::staticMethodWithCallbackArgMethod(args);
3775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3776 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3776 } 3777 }
3777 3778
3778 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8:: Value>& args) 3779 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8:: Value>& args)
3779 { 3780 {
3780 if (UNLIKELY(args.Length() < 1)) { 3781 if (UNLIKELY(args.Length() < 1)) {
3781 throwNotEnoughArgumentsError(args.GetIsolate()); 3782 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang eInt8", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), arg s.GetIsolate());
3782 return; 3783 return;
3783 } 3784 }
3784 TestObj* imp = V8TestObject::toNative(args.Holder()); 3785 TestObj* imp = V8TestObject::toNative(args.Holder());
3785 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(args[0], EnforceRange, ok) , args.GetIsolate()); 3786 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(args[0], EnforceRange, ok) , args.GetIsolate());
3786 imp->methodWithEnforceRangeInt8(value); 3787 imp->methodWithEnforceRangeInt8(value);
3787 3788
3788 return; 3789 return;
3789 } 3790 }
3790 3791
3791 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& args) 3792 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& args)
3792 { 3793 {
3793 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3794 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3794 TestObjV8Internal::methodWithEnforceRangeInt8Method(args); 3795 TestObjV8Internal::methodWithEnforceRangeInt8Method(args);
3795 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3796 } 3797 }
3797 3798
3798 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8: :Value>& args) 3799 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8: :Value>& args)
3799 { 3800 {
3800 if (UNLIKELY(args.Length() < 1)) { 3801 if (UNLIKELY(args.Length() < 1)) {
3801 throwNotEnoughArgumentsError(args.GetIsolate()); 3802 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang eUInt8", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), ar gs.GetIsolate());
3802 return; 3803 return;
3803 } 3804 }
3804 TestObj* imp = V8TestObject::toNative(args.Holder()); 3805 TestObj* imp = V8TestObject::toNative(args.Holder());
3805 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(args[0], EnforceRang e, ok), args.GetIsolate()); 3806 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(args[0], EnforceRang e, ok), args.GetIsolate());
3806 imp->methodWithEnforceRangeUInt8(value); 3807 imp->methodWithEnforceRangeUInt8(value);
3807 3808
3808 return; 3809 return;
3809 } 3810 }
3810 3811
3811 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback Info<v8::Value>& args) 3812 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback Info<v8::Value>& args)
3812 { 3813 {
3813 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3814 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3814 TestObjV8Internal::methodWithEnforceRangeUInt8Method(args); 3815 TestObjV8Internal::methodWithEnforceRangeUInt8Method(args);
3815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3816 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3816 } 3817 }
3817 3818
3818 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8: :Value>& args) 3819 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8: :Value>& args)
3819 { 3820 {
3820 if (UNLIKELY(args.Length() < 1)) { 3821 if (UNLIKELY(args.Length() < 1)) {
3821 throwNotEnoughArgumentsError(args.GetIsolate()); 3822 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang eInt32", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), ar gs.GetIsolate());
3822 return; 3823 return;
3823 } 3824 }
3824 TestObj* imp = V8TestObject::toNative(args.Holder()); 3825 TestObj* imp = V8TestObject::toNative(args.Holder());
3825 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(args[0], EnforceRange, ok ), args.GetIsolate()); 3826 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(args[0], EnforceRange, ok ), args.GetIsolate());
3826 imp->methodWithEnforceRangeInt32(value); 3827 imp->methodWithEnforceRangeInt32(value);
3827 3828
3828 return; 3829 return;
3829 } 3830 }
3830 3831
3831 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback Info<v8::Value>& args) 3832 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback Info<v8::Value>& args)
3832 { 3833 {
3833 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3834 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3834 TestObjV8Internal::methodWithEnforceRangeInt32Method(args); 3835 TestObjV8Internal::methodWithEnforceRangeInt32Method(args);
3835 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3836 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3836 } 3837 }
3837 3838
3838 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8 ::Value>& args) 3839 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8 ::Value>& args)
3839 { 3840 {
3840 if (UNLIKELY(args.Length() < 1)) { 3841 if (UNLIKELY(args.Length() < 1)) {
3841 throwNotEnoughArgumentsError(args.GetIsolate()); 3842 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang eUInt32", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), a rgs.GetIsolate());
3842 return; 3843 return;
3843 } 3844 }
3844 TestObj* imp = V8TestObject::toNative(args.Holder()); 3845 TestObj* imp = V8TestObject::toNative(args.Holder());
3845 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(args[0], EnforceRan ge, ok), args.GetIsolate()); 3846 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(args[0], EnforceRan ge, ok), args.GetIsolate());
3846 imp->methodWithEnforceRangeUInt32(value); 3847 imp->methodWithEnforceRangeUInt32(value);
3847 3848
3848 return; 3849 return;
3849 } 3850 }
3850 3851
3851 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& args) 3852 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& args)
3852 { 3853 {
3853 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3854 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3854 TestObjV8Internal::methodWithEnforceRangeUInt32Method(args); 3855 TestObjV8Internal::methodWithEnforceRangeUInt32Method(args);
3855 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3856 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3856 } 3857 }
3857 3858
3858 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8: :Value>& args) 3859 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8: :Value>& args)
3859 { 3860 {
3860 if (UNLIKELY(args.Length() < 1)) { 3861 if (UNLIKELY(args.Length() < 1)) {
3861 throwNotEnoughArgumentsError(args.GetIsolate()); 3862 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang eInt64", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), ar gs.GetIsolate());
3862 return; 3863 return;
3863 } 3864 }
3864 TestObj* imp = V8TestObject::toNative(args.Holder()); 3865 TestObj* imp = V8TestObject::toNative(args.Holder());
3865 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(args[0], EnforceRan ge, ok), args.GetIsolate()); 3866 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(args[0], EnforceRan ge, ok), args.GetIsolate());
3866 imp->methodWithEnforceRangeInt64(value); 3867 imp->methodWithEnforceRangeInt64(value);
3867 3868
3868 return; 3869 return;
3869 } 3870 }
3870 3871
3871 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback Info<v8::Value>& args) 3872 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback Info<v8::Value>& args)
3872 { 3873 {
3873 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3874 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3874 TestObjV8Internal::methodWithEnforceRangeInt64Method(args); 3875 TestObjV8Internal::methodWithEnforceRangeInt64Method(args);
3875 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3876 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3876 } 3877 }
3877 3878
3878 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8 ::Value>& args) 3879 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8 ::Value>& args)
3879 { 3880 {
3880 if (UNLIKELY(args.Length() < 1)) { 3881 if (UNLIKELY(args.Length() < 1)) {
3881 throwNotEnoughArgumentsError(args.GetIsolate()); 3882 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang eUInt64", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), a rgs.GetIsolate());
3882 return; 3883 return;
3883 } 3884 }
3884 TestObj* imp = V8TestObject::toNative(args.Holder()); 3885 TestObj* imp = V8TestObject::toNative(args.Holder());
3885 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(args[0], EnforceRange, ok), args.GetIsolate()); 3886 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(args[0], EnforceRange, ok), args.GetIsolate());
3886 imp->methodWithEnforceRangeUInt64(value); 3887 imp->methodWithEnforceRangeUInt64(value);
3887 3888
3888 return; 3889 return;
3889 } 3890 }
3890 3891
3891 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& args) 3892 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& args)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
3973 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback Info<v8::Value>& args) 3974 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback Info<v8::Value>& args)
3974 { 3975 {
3975 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3976 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3976 TestObjV8Internal::callbackFunctionReturnValueMethod(args); 3977 TestObjV8Internal::callbackFunctionReturnValueMethod(args);
3977 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3978 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3978 } 3979 }
3979 3980
3980 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va lue>& args) 3981 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va lue>& args)
3981 { 3982 {
3982 if (UNLIKELY(args.Length() < 1)) { 3983 if (UNLIKELY(args.Length() < 1)) {
3983 throwNotEnoughArgumentsError(args.GetIsolate()); 3984 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum ent", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
3984 return; 3985 return;
3985 } 3986 }
3986 TestObj* imp = V8TestObject::toNative(args.Holder()); 3987 TestObj* imp = V8TestObject::toNative(args.Holder());
3987 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(args[0], args.GetIsolate( ))); 3988 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(args[0], args.GetIsolate( )));
3988 imp->callbackFunctionArgument(function); 3989 imp->callbackFunctionArgument(function);
3989 3990
3990 return; 3991 return;
3991 } 3992 }
3992 3993
3993 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& args) 3994 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& args)
3994 { 3995 {
3995 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3996 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3996 TestObjV8Internal::callbackFunctionArgumentMethod(args); 3997 TestObjV8Internal::callbackFunctionArgumentMethod(args);
3997 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3998 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3998 } 3999 }
3999 4000
4000 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4001 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4001 { 4002 {
4002 if (UNLIKELY(args.Length() < 2)) { 4003 if (UNLIKELY(args.Length() < 2)) {
4003 throwNotEnoughArgumentsError(args.GetIsolate()); 4004 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsola te());
4004 return; 4005 return;
4005 } 4006 }
4006 TestObj* imp = V8TestObject::toNative(args.Holder()); 4007 TestObj* imp = V8TestObject::toNative(args.Holder());
4007 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0); 4008 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0);
4008 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); 4009 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]);
4009 imp->overloadedMethod(objArg, strArg); 4010 imp->overloadedMethod(objArg, strArg);
4010 4011
4011 return; 4012 return;
4012 } 4013 }
4013 4014
4014 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4015 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4015 { 4016 {
4016 if (UNLIKELY(args.Length() < 1)) { 4017 if (UNLIKELY(args.Length() < 1)) {
4017 throwNotEnoughArgumentsError(args.GetIsolate()); 4018 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4018 return; 4019 return;
4019 } 4020 }
4020 TestObj* imp = V8TestObject::toNative(args.Holder()); 4021 TestObj* imp = V8TestObject::toNative(args.Holder());
4021 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0); 4022 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0);
4022 if (UNLIKELY(args.Length() <= 1)) { 4023 if (UNLIKELY(args.Length() <= 1)) {
4023 imp->overloadedMethod(objArg); 4024 imp->overloadedMethod(objArg);
4024 4025
4025 return; 4026 return;
4026 } 4027 }
4027 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); 4028 V8TRYCATCH_VOID(int, longArg, toInt32(args[1]));
4028 imp->overloadedMethod(objArg, longArg); 4029 imp->overloadedMethod(objArg, longArg);
4029 4030
4030 return; 4031 return;
4031 } 4032 }
4032 4033
4033 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4034 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4034 { 4035 {
4035 if (UNLIKELY(args.Length() < 1)) { 4036 if (UNLIKELY(args.Length() < 1)) {
4036 throwNotEnoughArgumentsError(args.GetIsolate()); 4037 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4037 return; 4038 return;
4038 } 4039 }
4039 TestObj* imp = V8TestObject::toNative(args.Holder()); 4040 TestObj* imp = V8TestObject::toNative(args.Holder());
4040 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 4041 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
4041 imp->overloadedMethod(strArg); 4042 imp->overloadedMethod(strArg);
4042 4043
4043 return; 4044 return;
4044 } 4045 }
4045 4046
4046 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4047 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4047 { 4048 {
4048 if (UNLIKELY(args.Length() < 1)) { 4049 if (UNLIKELY(args.Length() < 1)) {
4049 throwNotEnoughArgumentsError(args.GetIsolate()); 4050 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4050 return; 4051 return;
4051 } 4052 }
4052 TestObj* imp = V8TestObject::toNative(args.Holder()); 4053 TestObj* imp = V8TestObject::toNative(args.Holder());
4053 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4054 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4054 imp->overloadedMethod(longArg); 4055 imp->overloadedMethod(longArg);
4055 4056
4056 return; 4057 return;
4057 } 4058 }
4058 4059
4059 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4060 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4060 { 4061 {
4061 if (UNLIKELY(args.Length() < 1)) { 4062 if (UNLIKELY(args.Length() < 1)) {
4062 throwNotEnoughArgumentsError(args.GetIsolate()); 4063 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4063 return; 4064 return;
4064 } 4065 }
4065 TestObj* imp = V8TestObject::toNative(args.Holder()); 4066 TestObj* imp = V8TestObject::toNative(args.Holder());
4066 if (args.Length() <= 0 || !args[0]->IsFunction()) { 4067 if (args.Length() <= 0 || !args[0]->IsFunction()) {
4067 throwTypeError(args.GetIsolate()); 4068 throwTypeError(args.GetIsolate());
4068 return; 4069 return;
4069 } 4070 }
4070 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe cutionContext()); 4071 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe cutionContext());
4071 imp->overloadedMethod(callback); 4072 imp->overloadedMethod(callback);
4072 4073
4073 return; 4074 return;
4074 } 4075 }
4075 4076
4076 static void overloadedMethod6Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4077 static void overloadedMethod6Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4077 { 4078 {
4078 if (UNLIKELY(args.Length() < 1)) { 4079 if (UNLIKELY(args.Length() < 1)) {
4079 throwNotEnoughArgumentsError(args.GetIsolate()); 4080 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4080 return; 4081 return;
4081 } 4082 }
4082 TestObj* imp = V8TestObject::toNative(args.Holder()); 4083 TestObj* imp = V8TestObject::toNative(args.Holder());
4083 V8TRYCATCH_VOID(RefPtr<DOMStringList>, listArg, toDOMStringList(args[0], arg s.GetIsolate())); 4084 V8TRYCATCH_VOID(RefPtr<DOMStringList>, listArg, toDOMStringList(args[0], arg s.GetIsolate()));
4084 imp->overloadedMethod(listArg); 4085 imp->overloadedMethod(listArg);
4085 4086
4086 return; 4087 return;
4087 } 4088 }
4088 4089
4089 static void overloadedMethod7Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4090 static void overloadedMethod7Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4090 { 4091 {
4091 if (UNLIKELY(args.Length() < 1)) { 4092 if (UNLIKELY(args.Length() < 1)) {
4092 throwNotEnoughArgumentsError(args.GetIsolate()); 4093 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4093 return; 4094 return;
4094 } 4095 }
4095 TestObj* imp = V8TestObject::toNative(args.Holder()); 4096 TestObj* imp = V8TestObject::toNative(args.Holder());
4096 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate())); 4097 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate()));
4097 imp->overloadedMethod(arrayArg); 4098 imp->overloadedMethod(arrayArg);
4098 4099
4099 return; 4100 return;
4100 } 4101 }
4101 4102
4102 static void overloadedMethod8Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4103 static void overloadedMethod8Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4103 { 4104 {
4104 if (UNLIKELY(args.Length() < 1)) { 4105 if (UNLIKELY(args.Length() < 1)) {
4105 throwNotEnoughArgumentsError(args.GetIsolate()); 4106 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4106 return; 4107 return;
4107 } 4108 }
4108 TestObj* imp = V8TestObject::toNative(args.Holder()); 4109 TestObj* imp = V8TestObject::toNative(args.Holder());
4109 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0); 4110 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0);
4110 imp->overloadedMethod(objArg); 4111 imp->overloadedMethod(objArg);
4111 4112
4112 return; 4113 return;
4113 } 4114 }
4114 4115
4115 static void overloadedMethod9Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4116 static void overloadedMethod9Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4116 { 4117 {
4117 if (UNLIKELY(args.Length() < 1)) { 4118 if (UNLIKELY(args.Length() < 1)) {
4118 throwNotEnoughArgumentsError(args.GetIsolate()); 4119 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4119 return; 4120 return;
4120 } 4121 }
4121 TestObj* imp = V8TestObject::toNative(args.Holder()); 4122 TestObj* imp = V8TestObject::toNative(args.Holder());
4122 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate())); 4123 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate()));
4123 imp->overloadedMethod(arrayArg); 4124 imp->overloadedMethod(arrayArg);
4124 4125
4125 return; 4126 return;
4126 } 4127 }
4127 4128
4128 static void overloadedMethod10Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4129 static void overloadedMethod10Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4129 { 4130 {
4130 if (UNLIKELY(args.Length() < 1)) { 4131 if (UNLIKELY(args.Length() < 1)) {
4131 throwNotEnoughArgumentsError(args.GetIsolate()); 4132 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4132 return; 4133 return;
4133 } 4134 }
4134 TestObj* imp = V8TestObject::toNative(args.Holder()); 4135 TestObj* imp = V8TestObject::toNative(args.Holder());
4135 V8TRYCATCH_VOID(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(args[0], args.GetIsolate())); 4136 V8TRYCATCH_VOID(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(args[0], args.GetIsolate()));
4136 imp->overloadedMethod(arrayArg); 4137 imp->overloadedMethod(arrayArg);
4137 4138
4138 return; 4139 return;
4139 } 4140 }
4140 4141
4141 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4142 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4142 { 4143 {
4143 if (UNLIKELY(args.Length() < 1)) { 4144 if (UNLIKELY(args.Length() < 1)) {
4144 throwNotEnoughArgumentsError(args.GetIsolate()); 4145 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4145 return; 4146 return;
4146 } 4147 }
4147 TestObj* imp = V8TestObject::toNative(args.Holder()); 4148 TestObj* imp = V8TestObject::toNative(args.Holder());
4148 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 4149 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
4149 imp->overloadedMethod(strArg); 4150 imp->overloadedMethod(strArg);
4150 4151
4151 return; 4152 return;
4152 } 4153 }
4153 4154
4154 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 4155 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
4191 } 4192 }
4192 if ((args.Length() == 1 && (args[0]->IsArray()))) { 4193 if ((args.Length() == 1 && (args[0]->IsArray()))) {
4193 overloadedMethod10Method(args); 4194 overloadedMethod10Method(args);
4194 return; 4195 return;
4195 } 4196 }
4196 if (args.Length() == 1) { 4197 if (args.Length() == 1) {
4197 overloadedMethod11Method(args); 4198 overloadedMethod11Method(args);
4198 return; 4199 return;
4199 } 4200 }
4200 if (UNLIKELY(args.Length() < 1)) { 4201 if (UNLIKELY(args.Length() < 1)) {
4201 throwNotEnoughArgumentsError(args.GetIsolate()); 4202 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsola te());
4202 return; 4203 return;
4203 } 4204 }
4204 throwTypeError(args.GetIsolate()); 4205 throwTypeError(args.GetIsolate());
4205 } 4206 }
4206 4207
4207 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args) 4208 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args)
4208 { 4209 {
4209 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4210 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4210 TestObjV8Internal::overloadedMethodMethod(args); 4211 TestObjV8Internal::overloadedMethodMethod(args);
4211 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4212 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
4248 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4249 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4249 V8TestObject::classMethod2MethodCustom(args); 4250 V8TestObject::classMethod2MethodCustom(args);
4250 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4251 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4251 } 4252 }
4252 4253
4253 #if ENABLE(Condition1) 4254 #if ENABLE(Condition1)
4254 4255
4255 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4256 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4256 { 4257 {
4257 if (UNLIKELY(args.Length() < 1)) { 4258 if (UNLIKELY(args.Length() < 1)) {
4258 throwNotEnoughArgumentsError(args.GetIsolate()); 4259 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", " TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsol ate());
4259 return; 4260 return;
4260 } 4261 }
4261 V8TRYCATCH_VOID(int, arg, toInt32(args[0])); 4262 V8TRYCATCH_VOID(int, arg, toInt32(args[0]));
4262 TestObj::overloadedMethod1(arg); 4263 TestObj::overloadedMethod1(arg);
4263 4264
4264 return; 4265 return;
4265 } 4266 }
4266 4267
4267 #endif // ENABLE(Condition1) 4268 #endif // ENABLE(Condition1)
4268 4269
4269 #if ENABLE(Condition1) 4270 #if ENABLE(Condition1)
4270 4271
4271 static void overloadedMethod12Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4272 static void overloadedMethod12Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4272 { 4273 {
4273 if (UNLIKELY(args.Length() < 1)) { 4274 if (UNLIKELY(args.Length() < 1)) {
4274 throwNotEnoughArgumentsError(args.GetIsolate()); 4275 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", " TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsol ate());
4275 return; 4276 return;
4276 } 4277 }
4277 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); 4278 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]);
4278 TestObj::overloadedMethod1(type); 4279 TestObj::overloadedMethod1(type);
4279 4280
4280 return; 4281 return;
4281 } 4282 }
4282 4283
4283 #endif // ENABLE(Condition1) 4284 #endif // ENABLE(Condition1)
4284 4285
4285 #if ENABLE(Condition1) 4286 #if ENABLE(Condition1)
4286 4287
4287 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 4288 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
4288 { 4289 {
4289 if (args.Length() == 1) { 4290 if (args.Length() == 1) {
4290 overloadedMethod11Method(args); 4291 overloadedMethod11Method(args);
4291 return; 4292 return;
4292 } 4293 }
4293 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a rgs[0]->IsString() || args[0]->IsObject()))) { 4294 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a rgs[0]->IsString() || args[0]->IsObject()))) {
4294 overloadedMethod12Method(args); 4295 overloadedMethod12Method(args);
4295 return; 4296 return;
4296 } 4297 }
4297 if (UNLIKELY(args.Length() < 1)) { 4298 if (UNLIKELY(args.Length() < 1)) {
4298 throwNotEnoughArgumentsError(args.GetIsolate()); 4299 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", " TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsol ate());
4299 return; 4300 return;
4300 } 4301 }
4301 throwTypeError(args.GetIsolate()); 4302 throwTypeError(args.GetIsolate());
4302 } 4303 }
4303 4304
4304 #endif // ENABLE(Condition1) 4305 #endif // ENABLE(Condition1)
4305 4306
4306 #if ENABLE(Condition1) 4307 #if ENABLE(Condition1)
4307 4308
4308 static void overloadedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& args) 4309 static void overloadedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& args)
4309 { 4310 {
4310 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4311 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4311 TestObjV8Internal::overloadedMethod1Method(args); 4312 TestObjV8Internal::overloadedMethod1Method(args);
4312 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4313 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4313 } 4314 }
4314 4315
4315 #endif // ENABLE(Condition1) 4316 #endif // ENABLE(Condition1)
4316 4317
4317 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value> & args) 4318 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value> & args)
4318 { 4319 {
4319 if (UNLIKELY(args.Length() < 2)) { 4320 if (UNLIKELY(args.Length() < 2)) {
4320 throwNotEnoughArgumentsError(args.GetIsolate()); 4321 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp" , "TestObj", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetI solate());
4321 return; 4322 return;
4322 } 4323 }
4323 TestObj* imp = V8TestObject::toNative(args.Holder()); 4324 TestObj* imp = V8TestObject::toNative(args.Holder());
4324 unsigned short objArgsShort = 0; 4325 unsigned short objArgsShort = 0;
4325 V8TRYCATCH_VOID(double, objArgsShortNativeValue, args[0]->NumberValue()); 4326 V8TRYCATCH_VOID(double, objArgsShortNativeValue, args[0]->NumberValue());
4326 if (!std::isnan(objArgsShortNativeValue)) 4327 if (!std::isnan(objArgsShortNativeValue))
4327 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); 4328 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue);
4328 unsigned long objArgsLong = 0; 4329 unsigned long objArgsLong = 0;
4329 V8TRYCATCH_VOID(double, objArgsLongNativeValue, args[1]->NumberValue()); 4330 V8TRYCATCH_VOID(double, objArgsLongNativeValue, args[1]->NumberValue());
4330 if (!std::isnan(objArgsLongNativeValue)) 4331 if (!std::isnan(objArgsLongNativeValue))
4331 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); 4332 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue);
4332 imp->classMethodWithClamp(objArgsShort, objArgsLong); 4333 imp->classMethodWithClamp(objArgsShort, objArgsLong);
4333 4334
4334 return; 4335 return;
4335 } 4336 }
4336 4337
4337 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args) 4338 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args)
4338 { 4339 {
4339 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4340 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4340 TestObjV8Internal::classMethodWithClampMethod(args); 4341 TestObjV8Internal::classMethodWithClampMethod(args);
4341 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4342 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4342 } 4343 }
4343 4344
4344 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu e>& args) 4345 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu e>& args)
4345 { 4346 {
4346 if (UNLIKELY(args.Length() < 1)) { 4347 if (UNLIKELY(args.Length() < 1)) {
4347 throwNotEnoughArgumentsError(args.GetIsolate()); 4348 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho d", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Ge tIsolate());
4348 return; 4349 return;
4349 } 4350 }
4350 TestObj* imp = V8TestObject::toNative(args.Holder()); 4351 TestObj* imp = V8TestObject::toNative(args.Holder());
4351 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4352 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4352 imp->enabledAtRuntimeMethod(longArg); 4353 imp->enabledAtRuntimeMethod(longArg);
4353 4354
4354 return; 4355 return;
4355 } 4356 }
4356 4357
4357 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& args) 4358 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& args)
4358 { 4359 {
4359 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4360 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4360 TestObjV8Internal::enabledAtRuntimeMethodMethod(args); 4361 TestObjV8Internal::enabledAtRuntimeMethodMethod(args);
4361 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4362 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4362 } 4363 }
4363 4364
4364 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& args) 4365 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& args)
4365 { 4366 {
4366 if (UNLIKELY(args.Length() < 1)) { 4367 if (UNLIKELY(args.Length() < 1)) {
4367 throwNotEnoughArgumentsError(args.GetIsolate()); 4368 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth od", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.G etIsolate());
4368 return; 4369 return;
4369 } 4370 }
4370 TestObj* imp = V8TestObject::toNative(args.Holder()); 4371 TestObj* imp = V8TestObject::toNative(args.Holder());
4371 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4372 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4372 imp->enabledPerContextMethod(longArg); 4373 imp->enabledPerContextMethod(longArg);
4373 4374
4374 return; 4375 return;
4375 } 4376 }
4376 4377
4377 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& args) 4378 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& args)
4378 { 4379 {
4379 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4380 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4380 TestObjV8Internal::enabledPerContextMethodMethod(args); 4381 TestObjV8Internal::enabledPerContextMethodMethod(args);
4381 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4382 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4382 } 4383 }
4383 4384
4384 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo< v8::Value>& args) 4385 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo< v8::Value>& args)
4385 { 4386 {
4386 if (UNLIKELY(args.Length() < 1)) { 4387 if (UNLIKELY(args.Length() < 1)) {
4387 throwNotEnoughArgumentsError(args.GetIsolate()); 4388 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon gSequence", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4388 return; 4389 return;
4389 } 4390 }
4390 TestObj* imp = V8TestObject::toNative(args.Holder()); 4391 TestObj* imp = V8TestObject::toNative(args.Holder());
4391 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign ed>(args[0], args.GetIsolate())); 4392 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign ed>(args[0], args.GetIsolate()));
4392 imp->methodWithUnsignedLongSequence(unsignedLongSequence); 4393 imp->methodWithUnsignedLongSequence(unsignedLongSequence);
4393 4394
4394 return; 4395 return;
4395 } 4396 }
4396 4397
4397 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& args) 4398 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& args)
4398 { 4399 {
4399 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4400 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(args); 4401 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(args);
4401 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4402 } 4403 }
4403 4404
4404 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 4405 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
4405 { 4406 {
4406 if (UNLIKELY(args.Length() < 1)) { 4407 if (UNLIKELY(args.Length() < 1)) {
4407 throwNotEnoughArgumentsError(args.GetIsolate()); 4408 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIs olate());
4408 return; 4409 return;
4409 } 4410 }
4410 TestObj* imp = V8TestObject::toNative(args.Holder()); 4411 TestObj* imp = V8TestObject::toNative(args.Holder());
4411 ExceptionState es(args.GetIsolate()); 4412 ExceptionState es(args.GetIsolate());
4412 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate())); 4413 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate()));
4413 Vector<String> result = imp->stringArrayFunction(values, es); 4414 Vector<String> result = imp->stringArrayFunction(values, es);
4414 if (es.throwIfNeeded()) 4415 if (es.throwIfNeeded())
4415 return; 4416 return;
4416 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 4417 v8SetReturnValue(args, v8Array(result, args.GetIsolate()));
4417 return; 4418 return;
4418 } 4419 }
4419 4420
4420 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args) 4421 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args)
4421 { 4422 {
4422 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4423 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4423 TestObjV8Internal::stringArrayFunctionMethod(args); 4424 TestObjV8Internal::stringArrayFunctionMethod(args);
4424 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4425 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4425 } 4426 }
4426 4427
4427 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value >& args) 4428 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value >& args)
4428 { 4429 {
4429 if (UNLIKELY(args.Length() < 1)) { 4430 if (UNLIKELY(args.Length() < 1)) {
4430 throwNotEnoughArgumentsError(args.GetIsolate()); 4431 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction ", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
4431 return; 4432 return;
4432 } 4433 }
4433 TestObj* imp = V8TestObject::toNative(args.Holder()); 4434 TestObj* imp = V8TestObject::toNative(args.Holder());
4434 ExceptionState es(args.GetIsolate()); 4435 ExceptionState es(args.GetIsolate());
4435 V8TRYCATCH_VOID(RefPtr<DOMStringList>, values, toDOMStringList(args[0], args .GetIsolate())); 4436 V8TRYCATCH_VOID(RefPtr<DOMStringList>, values, toDOMStringList(args[0], args .GetIsolate()));
4436 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es); 4437 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es);
4437 if (es.throwIfNeeded()) 4438 if (es.throwIfNeeded())
4438 return; 4439 return;
4439 v8SetReturnValue(args, result.release(), args.Holder()); 4440 v8SetReturnValue(args, result.release(), args.Holder());
4440 return; 4441 return;
(...skipping 24 matching lines...) Expand all
4465 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& args) 4466 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& args)
4466 { 4467 {
4467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4468 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4468 TestObjV8Internal::getSVGDocumentMethod(args); 4469 TestObjV8Internal::getSVGDocumentMethod(args);
4469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4470 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4470 } 4471 }
4471 4472
4472 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4473 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4473 { 4474 {
4474 if (UNLIKELY(args.Length() < 1)) { 4475 if (UNLIKELY(args.Length() < 1)) {
4475 throwNotEnoughArgumentsError(args.GetIsolate()); 4476 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4476 return; 4477 return;
4477 } 4478 }
4478 TestObj* imp = V8TestObject::toNative(args.Holder()); 4479 TestObj* imp = V8TestObject::toNative(args.Holder());
4479 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); 4480 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);
4480 imp->convert1(value); 4481 imp->convert1(value);
4481 4482
4482 return; 4483 return;
4483 } 4484 }
4484 4485
4485 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 4486 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
4486 { 4487 {
4487 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4488 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4488 TestObjV8Internal::convert1Method(args); 4489 TestObjV8Internal::convert1Method(args);
4489 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4490 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4490 } 4491 }
4491 4492
4492 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4493 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4493 { 4494 {
4494 if (UNLIKELY(args.Length() < 1)) { 4495 if (UNLIKELY(args.Length() < 1)) {
4495 throwNotEnoughArgumentsError(args.GetIsolate()); 4496 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4496 return; 4497 return;
4497 } 4498 }
4498 TestObj* imp = V8TestObject::toNative(args.Holder()); 4499 TestObj* imp = V8TestObject::toNative(args.Holder());
4499 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); 4500 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);
4500 imp->convert2(value); 4501 imp->convert2(value);
4501 4502
4502 return; 4503 return;
4503 } 4504 }
4504 4505
4505 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 4506 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
4506 { 4507 {
4507 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4508 TestObjV8Internal::convert2Method(args); 4509 TestObjV8Internal::convert2Method(args);
4509 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4510 } 4511 }
4511 4512
4512 static void convert4Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4513 static void convert4Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4513 { 4514 {
4514 if (UNLIKELY(args.Length() < 1)) { 4515 if (UNLIKELY(args.Length() < 1)) {
4515 throwNotEnoughArgumentsError(args.GetIsolate()); 4516 throwTypeError(ExceptionMessages::failedToExecute("convert4", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4516 return; 4517 return;
4517 } 4518 }
4518 TestObj* imp = V8TestObject::toNative(args.Holder()); 4519 TestObj* imp = V8TestObject::toNative(args.Holder());
4519 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); 4520 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);
4520 imp->convert4(value); 4521 imp->convert4(value);
4521 4522
4522 return; 4523 return;
4523 } 4524 }
4524 4525
4525 static void convert4MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 4526 static void convert4MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
4526 { 4527 {
4527 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4528 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4528 TestObjV8Internal::convert4Method(args); 4529 TestObjV8Internal::convert4Method(args);
4529 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4530 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4530 } 4531 }
4531 4532
4532 static void convert5Method(const v8::FunctionCallbackInfo<v8::Value>& args) 4533 static void convert5Method(const v8::FunctionCallbackInfo<v8::Value>& args)
4533 { 4534 {
4534 if (UNLIKELY(args.Length() < 1)) { 4535 if (UNLIKELY(args.Length() < 1)) {
4535 throwNotEnoughArgumentsError(args.GetIsolate()); 4536 throwTypeError(ExceptionMessages::failedToExecute("convert5", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4536 return; 4537 return;
4537 } 4538 }
4538 TestObj* imp = V8TestObject::toNative(args.Holder()); 4539 TestObj* imp = V8TestObject::toNative(args.Holder());
4539 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); 4540 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);
4540 imp->convert5(value); 4541 imp->convert5(value);
4541 4542
4542 return; 4543 return;
4543 } 4544 }
4544 4545
4545 static void convert5MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 4546 static void convert5MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
4588 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args ) 4589 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args )
4589 { 4590 {
4590 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4591 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4591 TestObjV8Internal::orangeMethod(args); 4592 TestObjV8Internal::orangeMethod(args);
4592 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4593 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4593 } 4594 }
4594 4595
4595 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args ) 4596 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args )
4596 { 4597 {
4597 if (UNLIKELY(args.Length() < 3)) { 4598 if (UNLIKELY(args.Length() < 3)) {
4598 throwNotEnoughArgumentsError(args.GetIsolate()); 4599 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes tObj", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIsolate ());
4599 return; 4600 return;
4600 } 4601 }
4601 TestObj* imp = V8TestObject::toNative(args.Holder()); 4602 TestObj* imp = V8TestObject::toNative(args.Holder());
4602 ExceptionState es(args.GetIsolate()); 4603 ExceptionState es(args.GetIsolate());
4603 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, args[0]); 4604 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, args[0]);
4604 V8TRYCATCH_VOID(float, a, static_cast<float>(args[1]->NumberValue())); 4605 V8TRYCATCH_VOID(float, a, static_cast<float>(args[1]->NumberValue()));
4605 V8TRYCATCH_VOID(int, b, toInt32(args[2])); 4606 V8TRYCATCH_VOID(int, b, toInt32(args[2]));
4606 bool result = imp->strictFunction(str, a, b, es); 4607 bool result = imp->strictFunction(str, a, b, es);
4607 if (es.throwIfNeeded()) 4608 if (es.throwIfNeeded())
4608 return; 4609 return;
4609 v8SetReturnValueBool(args, result); 4610 v8SetReturnValueBool(args, result);
4610 return; 4611 return;
4611 } 4612 }
4612 4613
4613 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& args) 4614 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& args)
4614 { 4615 {
4615 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4616 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4616 TestObjV8Internal::strictFunctionMethod(args); 4617 TestObjV8Internal::strictFunctionMethod(args);
4617 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4618 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4618 } 4619 }
4619 4620
4620 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & args) 4621 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & args)
4621 { 4622 {
4622 if (UNLIKELY(args.Length() < 1)) { 4623 if (UNLIKELY(args.Length() < 1)) {
4623 throwNotEnoughArgumentsError(args.GetIsolate()); 4624 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod" , "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetI solate());
4624 return; 4625 return;
4625 } 4626 }
4626 TestObj* imp = V8TestObject::toNative(args.Holder()); 4627 TestObj* imp = V8TestObject::toNative(args.Holder());
4627 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, args[0]); 4628 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, args[0]);
4628 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(args, 1)); 4629 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(args, 1));
4629 imp->variadicStringMethod(head, tail); 4630 imp->variadicStringMethod(head, tail);
4630 4631
4631 return; 4632 return;
4632 } 4633 }
4633 4634
4634 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args) 4635 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args)
4635 { 4636 {
4636 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4637 TestObjV8Internal::variadicStringMethodMethod(args); 4638 TestObjV8Internal::variadicStringMethodMethod(args);
4638 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4639 } 4640 }
4640 4641
4641 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & args) 4642 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & args)
4642 { 4643 {
4643 if (UNLIKELY(args.Length() < 1)) { 4644 if (UNLIKELY(args.Length() < 1)) {
4644 throwNotEnoughArgumentsError(args.GetIsolate()); 4645 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod" , "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetI solate());
4645 return; 4646 return;
4646 } 4647 }
4647 TestObj* imp = V8TestObject::toNative(args.Holder()); 4648 TestObj* imp = V8TestObject::toNative(args.Holder());
4648 V8TRYCATCH_VOID(double, head, static_cast<double>(args[0]->NumberValue())); 4649 V8TRYCATCH_VOID(double, head, static_cast<double>(args[0]->NumberValue()));
4649 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(args, 1)); 4650 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(args, 1));
4650 imp->variadicDoubleMethod(head, tail); 4651 imp->variadicDoubleMethod(head, tail);
4651 4652
4652 return; 4653 return;
4653 } 4654 }
4654 4655
4655 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args) 4656 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args)
4656 { 4657 {
4657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4658 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4658 TestObjV8Internal::variadicDoubleMethodMethod(args); 4659 TestObjV8Internal::variadicDoubleMethodMethod(args);
4659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4660 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4660 } 4661 }
4661 4662
4662 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 4663 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
4663 { 4664 {
4664 if (UNLIKELY(args.Length() < 1)) { 4665 if (UNLIKELY(args.Length() < 1)) {
4665 throwNotEnoughArgumentsError(args.GetIsolate()); 4666 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIso late());
4666 return; 4667 return;
4667 } 4668 }
4668 TestObj* imp = V8TestObject::toNative(args.Holder()); 4669 TestObj* imp = V8TestObject::toNative(args.Holder());
4669 V8TRYCATCH_VOID(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(a rgs[0])) : 0); 4670 V8TRYCATCH_VOID(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(a rgs[0])) : 0);
4670 Vector<RefPtr<Node> > tail; 4671 Vector<RefPtr<Node> > tail;
4671 for (int i = 1; i < args.Length(); ++i) { 4672 for (int i = 1; i < args.Length(); ++i) {
4672 if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetI solate()))) { 4673 if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetI solate()))) {
4673 throwTypeError(args.GetIsolate()); 4674 throwTypeError(args.GetIsolate());
4674 return; 4675 return;
4675 } 4676 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4713 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI nfo<v8::Value>& args) 4714 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI nfo<v8::Value>& args)
4714 { 4715 {
4715 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4716 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4716 TestObjV8Internal::perWorldMethodMethodForMainWorld(args); 4717 TestObjV8Internal::perWorldMethodMethodForMainWorld(args);
4717 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4718 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4718 } 4719 }
4719 4720
4720 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V alue>& args) 4721 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V alue>& args)
4721 { 4722 {
4722 if (UNLIKELY(args.Length() < 1)) { 4723 if (UNLIKELY(args.Length() < 1)) {
4723 throwNotEnoughArgumentsError(args.GetIsolate()); 4724 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
4724 return; 4725 return;
4725 } 4726 }
4726 TestObj* imp = V8TestObject::toNative(args.Holder()); 4727 TestObj* imp = V8TestObject::toNative(args.Holder());
4727 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4728 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4728 imp->overloadedPerWorldMethod(longArg); 4729 imp->overloadedPerWorldMethod(longArg);
4729 4730
4730 return; 4731 return;
4731 } 4732 }
4732 4733
4733 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba ckInfo<v8::Value>& args) 4734 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba ckInfo<v8::Value>& args)
4734 { 4735 {
4735 if (UNLIKELY(args.Length() < 1)) { 4736 if (UNLIKELY(args.Length() < 1)) {
4736 throwNotEnoughArgumentsError(args.GetIsolate()); 4737 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
4737 return; 4738 return;
4738 } 4739 }
4739 TestObj* imp = V8TestObject::toNative(args.Holder()); 4740 TestObj* imp = V8TestObject::toNative(args.Holder());
4740 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4741 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4741 imp->overloadedPerWorldMethod(longArg); 4742 imp->overloadedPerWorldMethod(longArg);
4742 4743
4743 return; 4744 return;
4744 } 4745 }
4745 4746
4746 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V alue>& args) 4747 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V alue>& args)
4747 { 4748 {
4748 if (UNLIKELY(args.Length() < 2)) { 4749 if (UNLIKELY(args.Length() < 2)) {
4749 throwNotEnoughArgumentsError(args.GetIsolate()); 4750 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObj", ExceptionMessages::notEnoughArguments(2, args.Length())), args. GetIsolate());
4750 return; 4751 return;
4751 } 4752 }
4752 TestObj* imp = V8TestObject::toNative(args.Holder()); 4753 TestObj* imp = V8TestObject::toNative(args.Holder());
4753 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 4754 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
4754 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); 4755 V8TRYCATCH_VOID(int, longArg, toInt32(args[1]));
4755 imp->overloadedPerWorldMethod(strArg, longArg); 4756 imp->overloadedPerWorldMethod(strArg, longArg);
4756 4757
4757 return; 4758 return;
4758 } 4759 }
4759 4760
4760 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba ckInfo<v8::Value>& args) 4761 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba ckInfo<v8::Value>& args)
4761 { 4762 {
4762 if (UNLIKELY(args.Length() < 2)) { 4763 if (UNLIKELY(args.Length() < 2)) {
4763 throwNotEnoughArgumentsError(args.GetIsolate()); 4764 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObj", ExceptionMessages::notEnoughArguments(2, args.Length())), args. GetIsolate());
4764 return; 4765 return;
4765 } 4766 }
4766 TestObj* imp = V8TestObject::toNative(args.Holder()); 4767 TestObj* imp = V8TestObject::toNative(args.Holder());
4767 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 4768 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
4768 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); 4769 V8TRYCATCH_VOID(int, longArg, toInt32(args[1]));
4769 imp->overloadedPerWorldMethod(strArg, longArg); 4770 imp->overloadedPerWorldMethod(strArg, longArg);
4770 4771
4771 return; 4772 return;
4772 } 4773 }
4773 4774
4774 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va lue>& args) 4775 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va lue>& args)
4775 { 4776 {
4776 if (args.Length() == 1) { 4777 if (args.Length() == 1) {
4777 overloadedPerWorldMethod1Method(args); 4778 overloadedPerWorldMethod1Method(args);
4778 return; 4779 return;
4779 } 4780 }
4780 if (args.Length() == 2) { 4781 if (args.Length() == 2) {
4781 overloadedPerWorldMethod2Method(args); 4782 overloadedPerWorldMethod2Method(args);
4782 return; 4783 return;
4783 } 4784 }
4784 if (UNLIKELY(args.Length() < 1)) { 4785 if (UNLIKELY(args.Length() < 1)) {
4785 throwNotEnoughArgumentsError(args.GetIsolate()); 4786 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
4786 return; 4787 return;
4787 } 4788 }
4788 throwTypeError(args.GetIsolate()); 4789 throwTypeError(args.GetIsolate());
4789 } 4790 }
4790 4791
4791 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac kInfo<v8::Value>& args) 4792 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac kInfo<v8::Value>& args)
4792 { 4793 {
4793 if (args.Length() == 1) { 4794 if (args.Length() == 1) {
4794 overloadedPerWorldMethod1MethodForMainWorld(args); 4795 overloadedPerWorldMethod1MethodForMainWorld(args);
4795 return; 4796 return;
4796 } 4797 }
4797 if (args.Length() == 2) { 4798 if (args.Length() == 2) {
4798 overloadedPerWorldMethod2MethodForMainWorld(args); 4799 overloadedPerWorldMethod2MethodForMainWorld(args);
4799 return; 4800 return;
4800 } 4801 }
4801 if (UNLIKELY(args.Length() < 1)) { 4802 if (UNLIKELY(args.Length() < 1)) {
4802 throwNotEnoughArgumentsError(args.GetIsolate()); 4803 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
4803 return; 4804 return;
4804 } 4805 }
4805 throwTypeError(args.GetIsolate()); 4806 throwTypeError(args.GetIsolate());
4806 } 4807 }
4807 4808
4808 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& args) 4809 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& args)
4809 { 4810 {
4810 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4811 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4811 TestObjV8Internal::overloadedPerWorldMethodMethod(args); 4812 TestObjV8Internal::overloadedPerWorldMethodMethod(args);
4812 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4813 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4813 } 4814 }
4814 4815
4815 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio nCallbackInfo<v8::Value>& args) 4816 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio nCallbackInfo<v8::Value>& args)
4816 { 4817 {
4817 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4818 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4818 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(args); 4819 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(args);
4819 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4820 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4820 } 4821 }
4821 4822
4822 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value >& args) 4823 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value >& args)
4823 { 4824 {
4824 if (UNLIKELY(args.Length() < 1)) { 4825 if (UNLIKELY(args.Length() < 1)) {
4825 throwNotEnoughArgumentsError(args.GetIsolate()); 4826 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1 ", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
4826 return; 4827 return;
4827 } 4828 }
4828 TestObj* imp = V8TestObject::toNative(args.Holder()); 4829 TestObj* imp = V8TestObject::toNative(args.Holder());
4829 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4830 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4830 imp->activityLoggedMethod1(longArg); 4831 imp->activityLoggedMethod1(longArg);
4831 4832
4832 return; 4833 return;
4833 } 4834 }
4834 4835
4835 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 4836 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
4836 { 4837 {
4837 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4838 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4838 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge tCurrentContext()); 4839 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge tCurrentContext());
4839 if (contextData && contextData->activityLogger()) { 4840 if (contextData && contextData->activityLogger()) {
4840 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); 4841 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args);
4841 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", a rgs.Length(), loggerArgs.data(), "Method"); 4842 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", a rgs.Length(), loggerArgs.data(), "Method");
4842 } 4843 }
4843 TestObjV8Internal::activityLoggedMethod1Method(args); 4844 TestObjV8Internal::activityLoggedMethod1Method(args);
4844 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4845 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4845 } 4846 }
4846 4847
4847 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value >& args) 4848 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value >& args)
4848 { 4849 {
4849 if (UNLIKELY(args.Length() < 1)) { 4850 if (UNLIKELY(args.Length() < 1)) {
4850 throwNotEnoughArgumentsError(args.GetIsolate()); 4851 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2 ", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
4851 return; 4852 return;
4852 } 4853 }
4853 TestObj* imp = V8TestObject::toNative(args.Holder()); 4854 TestObj* imp = V8TestObject::toNative(args.Holder());
4854 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4855 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4855 imp->activityLoggedMethod2(longArg); 4856 imp->activityLoggedMethod2(longArg);
4856 4857
4857 return; 4858 return;
4858 } 4859 }
4859 4860
4860 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn fo<v8::Value>& args) 4861 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn fo<v8::Value>& args)
4861 { 4862 {
4862 if (UNLIKELY(args.Length() < 1)) { 4863 if (UNLIKELY(args.Length() < 1)) {
4863 throwNotEnoughArgumentsError(args.GetIsolate()); 4864 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2 ", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
4864 return; 4865 return;
4865 } 4866 }
4866 TestObj* imp = V8TestObject::toNative(args.Holder()); 4867 TestObj* imp = V8TestObject::toNative(args.Holder());
4867 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4868 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4868 imp->activityLoggedMethod2(longArg); 4869 imp->activityLoggedMethod2(longArg);
4869 4870
4870 return; 4871 return;
4871 } 4872 }
4872 4873
4873 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 4874 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
(...skipping 16 matching lines...) Expand all
4890 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); 4891 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args);
4891 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a rgs.Length(), loggerArgs.data(), "Method"); 4892 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a rgs.Length(), loggerArgs.data(), "Method");
4892 } 4893 }
4893 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(args); 4894 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(args);
4894 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4895 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4895 } 4896 }
4896 4897
4897 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback Info<v8::Value>& args) 4898 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback Info<v8::Value>& args)
4898 { 4899 {
4899 if (UNLIKELY(args.Length() < 1)) { 4900 if (UNLIKELY(args.Length() < 1)) {
4900 throwNotEnoughArgumentsError(args.GetIsolate()); 4901 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola tedWorldMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length ())), args.GetIsolate());
4901 return; 4902 return;
4902 } 4903 }
4903 TestObj* imp = V8TestObject::toNative(args.Holder()); 4904 TestObj* imp = V8TestObject::toNative(args.Holder());
4904 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4905 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4905 imp->activityLoggedInIsolatedWorldMethod(longArg); 4906 imp->activityLoggedInIsolatedWorldMethod(longArg);
4906 4907
4907 return; 4908 return;
4908 } 4909 }
4909 4910
4910 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func tionCallbackInfo<v8::Value>& args) 4911 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func tionCallbackInfo<v8::Value>& args)
4911 { 4912 {
4912 if (UNLIKELY(args.Length() < 1)) { 4913 if (UNLIKELY(args.Length() < 1)) {
4913 throwNotEnoughArgumentsError(args.GetIsolate()); 4914 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola tedWorldMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length ())), args.GetIsolate());
4914 return; 4915 return;
4915 } 4916 }
4916 TestObj* imp = V8TestObject::toNative(args.Holder()); 4917 TestObj* imp = V8TestObject::toNative(args.Holder());
4917 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4918 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4918 imp->activityLoggedInIsolatedWorldMethod(longArg); 4919 imp->activityLoggedInIsolatedWorldMethod(longArg);
4919 4920
4920 return; 4921 return;
4921 } 4922 }
4922 4923
4923 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function CallbackInfo<v8::Value>& args) 4924 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function CallbackInfo<v8::Value>& args)
(...skipping 11 matching lines...) Expand all
4935 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& args) 4936 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& args)
4936 { 4937 {
4937 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4938 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4938 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(arg s); 4939 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(arg s);
4939 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4940 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4940 } 4941 }
4941 4942
4942 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo <v8::Value>& args) 4943 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo <v8::Value>& args)
4943 { 4944 {
4944 if (UNLIKELY(args.Length() < 1)) { 4945 if (UNLIKELY(args.Length() < 1)) {
4945 throwNotEnoughArgumentsError(args.GetIsolate()); 4946 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4946 return; 4947 return;
4947 } 4948 }
4948 TestObj* imp = V8TestObject::toNative(args.Holder()); 4949 TestObj* imp = V8TestObject::toNative(args.Holder());
4949 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4950 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4950 imp->overloadedActivityLoggedMethod(longArg); 4951 imp->overloadedActivityLoggedMethod(longArg);
4951 4952
4952 return; 4953 return;
4953 } 4954 }
4954 4955
4955 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function CallbackInfo<v8::Value>& args) 4956 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function CallbackInfo<v8::Value>& args)
4956 { 4957 {
4957 if (UNLIKELY(args.Length() < 1)) { 4958 if (UNLIKELY(args.Length() < 1)) {
4958 throwNotEnoughArgumentsError(args.GetIsolate()); 4959 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
4959 return; 4960 return;
4960 } 4961 }
4961 TestObj* imp = V8TestObject::toNative(args.Holder()); 4962 TestObj* imp = V8TestObject::toNative(args.Holder());
4962 V8TRYCATCH_VOID(int, longArg, toInt32(args[0])); 4963 V8TRYCATCH_VOID(int, longArg, toInt32(args[0]));
4963 imp->overloadedActivityLoggedMethod(longArg); 4964 imp->overloadedActivityLoggedMethod(longArg);
4964 4965
4965 return; 4966 return;
4966 } 4967 }
4967 4968
4968 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo <v8::Value>& args) 4969 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo <v8::Value>& args)
4969 { 4970 {
4970 if (UNLIKELY(args.Length() < 2)) { 4971 if (UNLIKELY(args.Length() < 2)) {
4971 throwNotEnoughArgumentsError(args.GetIsolate()); 4972 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObj", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsolate());
4972 return; 4973 return;
4973 } 4974 }
4974 TestObj* imp = V8TestObject::toNative(args.Holder()); 4975 TestObj* imp = V8TestObject::toNative(args.Holder());
4975 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 4976 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
4976 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); 4977 V8TRYCATCH_VOID(int, longArg, toInt32(args[1]));
4977 imp->overloadedActivityLoggedMethod(strArg, longArg); 4978 imp->overloadedActivityLoggedMethod(strArg, longArg);
4978 4979
4979 return; 4980 return;
4980 } 4981 }
4981 4982
4982 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function CallbackInfo<v8::Value>& args) 4983 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function CallbackInfo<v8::Value>& args)
4983 { 4984 {
4984 if (UNLIKELY(args.Length() < 2)) { 4985 if (UNLIKELY(args.Length() < 2)) {
4985 throwNotEnoughArgumentsError(args.GetIsolate()); 4986 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObj", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsolate());
4986 return; 4987 return;
4987 } 4988 }
4988 TestObj* imp = V8TestObject::toNative(args.Holder()); 4989 TestObj* imp = V8TestObject::toNative(args.Holder());
4989 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]); 4990 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
4990 V8TRYCATCH_VOID(int, longArg, toInt32(args[1])); 4991 V8TRYCATCH_VOID(int, longArg, toInt32(args[1]));
4991 imp->overloadedActivityLoggedMethod(strArg, longArg); 4992 imp->overloadedActivityLoggedMethod(strArg, longArg);
4992 4993
4993 return; 4994 return;
4994 } 4995 }
4995 4996
4996 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo< v8::Value>& args) 4997 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo< v8::Value>& args)
4997 { 4998 {
4998 if (args.Length() == 1) { 4999 if (args.Length() == 1) {
4999 overloadedActivityLoggedMethod1Method(args); 5000 overloadedActivityLoggedMethod1Method(args);
5000 return; 5001 return;
5001 } 5002 }
5002 if (args.Length() == 2) { 5003 if (args.Length() == 2) {
5003 overloadedActivityLoggedMethod2Method(args); 5004 overloadedActivityLoggedMethod2Method(args);
5004 return; 5005 return;
5005 } 5006 }
5006 if (UNLIKELY(args.Length() < 1)) { 5007 if (UNLIKELY(args.Length() < 1)) {
5007 throwNotEnoughArgumentsError(args.GetIsolate()); 5008 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
5008 return; 5009 return;
5009 } 5010 }
5010 throwTypeError(args.GetIsolate()); 5011 throwTypeError(args.GetIsolate());
5011 } 5012 }
5012 5013
5013 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC allbackInfo<v8::Value>& args) 5014 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC allbackInfo<v8::Value>& args)
5014 { 5015 {
5015 if (args.Length() == 1) { 5016 if (args.Length() == 1) {
5016 overloadedActivityLoggedMethod1MethodForMainWorld(args); 5017 overloadedActivityLoggedMethod1MethodForMainWorld(args);
5017 return; 5018 return;
5018 } 5019 }
5019 if (args.Length() == 2) { 5020 if (args.Length() == 2) {
5020 overloadedActivityLoggedMethod2MethodForMainWorld(args); 5021 overloadedActivityLoggedMethod2MethodForMainWorld(args);
5021 return; 5022 return;
5022 } 5023 }
5023 if (UNLIKELY(args.Length() < 1)) { 5024 if (UNLIKELY(args.Length() < 1)) {
5024 throwNotEnoughArgumentsError(args.GetIsolate()); 5025 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObj", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
5025 return; 5026 return;
5026 } 5027 }
5027 throwTypeError(args.GetIsolate()); 5028 throwTypeError(args.GetIsolate());
5028 } 5029 }
5029 5030
5030 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& args) 5031 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& args)
5031 { 5032 {
5032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5033 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5033 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge tCurrentContext()); 5034 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge tCurrentContext());
5034 if (contextData && contextData->activityLogger()) { 5035 if (contextData && contextData->activityLogger()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
5078 { 5079 {
5079 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5080 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5080 UseCounter::countDeprecation(activeScriptExecutionContext(), UseCounter::Sta ticMethod); 5081 UseCounter::countDeprecation(activeScriptExecutionContext(), UseCounter::Sta ticMethod);
5081 TestObjV8Internal::deprecatedStaticMethodMethod(args); 5082 TestObjV8Internal::deprecatedStaticMethodMethod(args);
5082 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 5083 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
5083 } 5084 }
5084 5085
5085 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) 5086 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
5086 { 5087 {
5087 if (UNLIKELY(args.Length() < 1)) { 5088 if (UNLIKELY(args.Length() < 1)) {
5088 throwNotEnoughArgumentsError(args.GetIsolate()); 5089 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb j", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate()) ;
5089 return; 5090 return;
5090 } 5091 }
5091 if (args.Length() <= 0 || !args[0]->IsFunction()) { 5092 if (args.Length() <= 0 || !args[0]->IsFunction()) {
5092 throwTypeError(args.GetIsolate()); 5093 throwTypeError(args.GetIsolate());
5093 return; 5094 return;
5094 } 5095 }
5095 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip tExecutionContext()); 5096 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip tExecutionContext());
5096 5097
5097 RefPtr<TestObj> impl = TestObj::create(testCallback); 5098 RefPtr<TestObj> impl = TestObj::create(testCallback);
5098 v8::Handle<v8::Object> wrapper = args.Holder(); 5099 v8::Handle<v8::Object> wrapper = args.Holder();
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
5555 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent); 5556 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent);
5556 return wrapper; 5557 return wrapper;
5557 } 5558 }
5558 5559
5559 void V8TestObject::derefObject(void* object) 5560 void V8TestObject::derefObject(void* object)
5560 { 5561 {
5561 fromInternalPointer(object)->deref(); 5562 fromInternalPointer(object)->deref();
5562 } 5563 }
5563 5564
5564 } // namespace WebCore 5565 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698