OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 2905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2916 | 2916 |
2917 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2917 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2918 { | 2918 { |
2919 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2919 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2920 TestObjV8Internal::voidMethodMethod(info); | 2920 TestObjV8Internal::voidMethodMethod(info); |
2921 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2921 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2922 } | 2922 } |
2923 | 2923 |
2924 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2924 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2925 { | 2925 { |
2926 if (UNLIKELY(info.Length() < 3)) { | 2926 if (info.Length() < 3) { |
2927 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); | 2927 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); |
2928 return; | 2928 return; |
2929 } | 2929 } |
2930 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2930 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2931 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 2931 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
2932 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 2932 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
2933 if (info.Length() <= 2 || !info[2]->IsFunction()) { | 2933 if (info.Length() <= 2 || !info[2]->IsFunction()) { |
2934 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", "The callback provided as parameter 3 is not a function."), info.G
etIsolate()); | 2934 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", "The callback provided as parameter 3 is not a function."), info.G
etIsolate()); |
2935 return; | 2935 return; |
2936 } | 2936 } |
(...skipping 16 matching lines...) Expand all Loading... |
2953 | 2953 |
2954 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2954 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2955 { | 2955 { |
2956 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2956 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2957 TestObjV8Internal::longMethodMethod(info); | 2957 TestObjV8Internal::longMethodMethod(info); |
2958 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2958 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2959 } | 2959 } |
2960 | 2960 |
2961 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2961 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2962 { | 2962 { |
2963 if (UNLIKELY(info.Length() < 3)) { | 2963 if (info.Length() < 3) { |
2964 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); | 2964 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); |
2965 return; | 2965 return; |
2966 } | 2966 } |
2967 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2967 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2968 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 2968 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
2969 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 2969 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
2970 if (info.Length() <= 2 || !info[2]->IsFunction()) { | 2970 if (info.Length() <= 2 || !info[2]->IsFunction()) { |
2971 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", "The callback provided as parameter 3 is not a function."), info.G
etIsolate()); | 2971 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", "The callback provided as parameter 3 is not a function."), info.G
etIsolate()); |
2972 return; | 2972 return; |
2973 } | 2973 } |
(...skipping 17 matching lines...) Expand all Loading... |
2991 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 2991 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
2992 { | 2992 { |
2993 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2993 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2994 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | 2994 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); |
2995 TestObjV8Internal::objMethodMethod(info); | 2995 TestObjV8Internal::objMethodMethod(info); |
2996 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2996 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2997 } | 2997 } |
2998 | 2998 |
2999 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 2999 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3000 { | 3000 { |
3001 if (UNLIKELY(info.Length() < 3)) { | 3001 if (info.Length() < 3) { |
3002 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI
solate()); | 3002 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI
solate()); |
3003 return; | 3003 return; |
3004 } | 3004 } |
3005 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3005 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3006 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 3006 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
3007 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3007 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
3008 if (info.Length() <= 2 || !info[2]->IsFunction()) { | 3008 if (info.Length() <= 2 || !info[2]->IsFunction()) { |
3009 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", "The callback provided as parameter 3 is not a function."), info.Ge
tIsolate()); | 3009 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", "The callback provided as parameter 3 is not a function."), info.Ge
tIsolate()); |
3010 return; | 3010 return; |
3011 } | 3011 } |
3012 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); | 3012 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); |
3013 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg.releas
e())); | 3013 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg.releas
e())); |
3014 } | 3014 } |
3015 | 3015 |
3016 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3016 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3017 { | 3017 { |
3018 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3018 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3019 TestObjV8Internal::objMethodWithArgsMethod(info); | 3019 TestObjV8Internal::objMethodWithArgsMethod(info); |
3020 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3020 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3021 } | 3021 } |
3022 | 3022 |
3023 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3023 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3024 { | 3024 { |
3025 if (UNLIKELY(info.Length() < 1)) { | 3025 if (info.Length() < 1) { |
3026 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 3026 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
3027 return; | 3027 return; |
3028 } | 3028 } |
3029 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3029 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3030 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); | 3030 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); |
3031 imp->methodWithSequenceArg(sequenceArg); | 3031 imp->methodWithSequenceArg(sequenceArg); |
3032 } | 3032 } |
3033 | 3033 |
3034 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3034 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3035 { | 3035 { |
3036 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3036 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3037 TestObjV8Internal::methodWithSequenceArgMethod(info); | 3037 TestObjV8Internal::methodWithSequenceArgMethod(info); |
3038 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3038 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3039 } | 3039 } |
3040 | 3040 |
3041 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3041 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3042 { | 3042 { |
3043 if (UNLIKELY(info.Length() < 1)) { | 3043 if (info.Length() < 1) { |
3044 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen
ce", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 3044 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen
ce", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
3045 return; | 3045 return; |
3046 } | 3046 } |
3047 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3047 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3048 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 3048 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
3049 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); | 3049 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); |
3050 } | 3050 } |
3051 | 3051 |
3052 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 3052 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
3053 { | 3053 { |
3054 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3054 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3055 TestObjV8Internal::methodReturningSequenceMethod(info); | 3055 TestObjV8Internal::methodReturningSequenceMethod(info); |
3056 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3056 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3057 } | 3057 } |
3058 | 3058 |
3059 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3059 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3060 { | 3060 { |
3061 if (UNLIKELY(info.Length() < 1)) { | 3061 if (info.Length() < 1) { |
3062 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 3062 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
3063 return; | 3063 return; |
3064 } | 3064 } |
3065 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3065 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3066 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); | 3066 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); |
3067 String string = enumArg; | 3067 String string = enumArg; |
3068 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { | 3068 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { |
3069 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); | 3069 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); |
3070 return; | 3070 return; |
3071 } | 3071 } |
3072 imp->methodWithEnumArg(enumArg); | 3072 imp->methodWithEnumArg(enumArg); |
3073 } | 3073 } |
3074 | 3074 |
3075 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3075 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3076 { | 3076 { |
3077 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3077 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3078 TestObjV8Internal::methodWithEnumArgMethod(info); | 3078 TestObjV8Internal::methodWithEnumArgMethod(info); |
3079 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3079 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3080 } | 3080 } |
3081 | 3081 |
3082 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3082 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3083 { | 3083 { |
3084 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); | 3084 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); |
3085 if (UNLIKELY(info.Length() < 2)) { | 3085 if (info.Length() < 2) { |
3086 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 3086 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
3087 exceptionState.throwIfNeeded(); | 3087 exceptionState.throwIfNeeded(); |
3088 return; | 3088 return; |
3089 } | 3089 } |
3090 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3090 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3091 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 3091 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
3092 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 3092 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
3093 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll
ArgsAndThrows", "TestObject", "The callback provided as parameter 2 is not a fun
ction."), info.GetIsolate()); | 3093 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll
ArgsAndThrows", "TestObject", "The callback provided as parameter 2 is not a fun
ction."), info.GetIsolate()); |
3094 return; | 3094 return; |
3095 } | 3095 } |
3096 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); | 3096 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); |
3097 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg.release(), exceptionState); | 3097 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg.release(), exceptionState); |
3098 if (exceptionState.throwIfNeeded()) | 3098 if (exceptionState.throwIfNeeded()) |
3099 return; | 3099 return; |
3100 v8SetReturnValue(info, result.release()); | 3100 v8SetReturnValue(info, result.release()); |
3101 } | 3101 } |
3102 | 3102 |
3103 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3103 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3104 { | 3104 { |
3105 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3105 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3106 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); | 3106 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
3107 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3107 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3108 } | 3108 } |
3109 | 3109 |
3110 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3110 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3111 { | 3111 { |
3112 if (UNLIKELY(info.Length() < 1)) { | 3112 if (info.Length() < 1) { |
3113 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListen
er", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 3113 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListen
er", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
3114 return; | 3114 return; |
3115 } | 3115 } |
3116 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3116 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3117 V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListList
ener::create(ScriptValue(info[0], info.GetIsolate()))); | 3117 V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListList
ener::create(ScriptValue(info[0], info.GetIsolate()))); |
3118 imp->methodQueryListListener(listener); | 3118 imp->methodQueryListListener(listener); |
3119 } | 3119 } |
3120 | 3120 |
3121 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 3121 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
3122 { | 3122 { |
3123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3124 TestObjV8Internal::methodQueryListListenerMethod(info); | 3124 TestObjV8Internal::methodQueryListListenerMethod(info); |
3125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3126 } | 3126 } |
3127 | 3127 |
3128 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 3128 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
3129 { | 3129 { |
3130 if (UNLIKELY(info.Length() < 1)) { | 3130 if (info.Length() < 1) { |
3131 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te
stObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIso
late()); | 3131 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te
stObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIso
late()); |
3132 return; | 3132 return; |
3133 } | 3133 } |
3134 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3134 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3135 bool serializedArgDidThrow = false; | 3135 bool serializedArgDidThrow = false; |
3136 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, serializedArgDidThrow, info.GetIsolate()); | 3136 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, serializedArgDidThrow, info.GetIsolate()); |
3137 if (serializedArgDidThrow) | 3137 if (serializedArgDidThrow) |
3138 return; | 3138 return; |
3139 imp->serializedValue(serializedArg); | 3139 imp->serializedValue(serializedArg); |
3140 } | 3140 } |
3141 | 3141 |
3142 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3142 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3143 { | 3143 { |
3144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3145 TestObjV8Internal::serializedValueMethod(info); | 3145 TestObjV8Internal::serializedValueMethod(info); |
3146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3147 } | 3147 } |
3148 | 3148 |
3149 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 3149 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
3150 { | 3150 { |
3151 if (UNLIKELY(info.Length() < 1)) { | 3151 if (info.Length() < 1) { |
3152 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); | 3152 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); |
3153 return; | 3153 return; |
3154 } | 3154 } |
3155 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3155 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3156 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); | 3156 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); |
3157 if (!oo.isUndefinedOrNull() && !oo.isObject()) { | 3157 if (!oo.isUndefinedOrNull() && !oo.isObject()) { |
3158 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); | 3158 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); |
3159 return; | 3159 return; |
3160 } | 3160 } |
3161 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); | 3161 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); |
3162 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { | 3162 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { |
3163 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); | 3163 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); |
3164 return; | 3164 return; |
3165 } | 3165 } |
3166 imp->optionsObject(oo, ooo); | 3166 imp->optionsObject(oo, ooo); |
3167 } | 3167 } |
3168 | 3168 |
3169 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3169 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3170 { | 3170 { |
3171 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3171 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3172 TestObjV8Internal::optionsObjectMethod(info); | 3172 TestObjV8Internal::optionsObjectMethod(info); |
3173 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3173 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3174 } | 3174 } |
3175 | 3175 |
3176 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3176 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3177 { | 3177 { |
3178 if (UNLIKELY(info.Length() < 1)) { | 3178 if (info.Length() < 1) { |
3179 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 3179 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
3180 return; | 3180 return; |
3181 } | 3181 } |
3182 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3182 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3183 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); | 3183 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); |
3184 imp->optionsObjectList(list); | 3184 imp->optionsObjectList(list); |
3185 } | 3185 } |
3186 | 3186 |
3187 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3187 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3188 { | 3188 { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3495 | 3495 |
3496 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3496 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3497 { | 3497 { |
3498 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3498 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3499 TestObjV8Internal::methodWithOptionalArgMethod(info); | 3499 TestObjV8Internal::methodWithOptionalArgMethod(info); |
3500 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3500 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3501 } | 3501 } |
3502 | 3502 |
3503 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3503 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3504 { | 3504 { |
3505 if (UNLIKELY(info.Length() < 1)) { | 3505 if (info.Length() < 1) { |
3506 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); | 3506 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); |
3507 return; | 3507 return; |
3508 } | 3508 } |
3509 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3509 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3510 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); | 3510 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
3511 if (UNLIKELY(info.Length() <= 1)) { | 3511 if (UNLIKELY(info.Length() <= 1)) { |
3512 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | 3512 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
3513 return; | 3513 return; |
3514 } | 3514 } |
3515 V8TRYCATCH_VOID(int, opt, toInt32(info[1])); | 3515 V8TRYCATCH_VOID(int, opt, toInt32(info[1])); |
3516 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | 3516 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
3517 } | 3517 } |
3518 | 3518 |
3519 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3519 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3520 { | 3520 { |
3521 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3521 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3522 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); | 3522 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); |
3523 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3523 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3524 } | 3524 } |
3525 | 3525 |
3526 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3526 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3527 { | 3527 { |
3528 if (UNLIKELY(info.Length() < 1)) { | 3528 if (info.Length() < 1) { |
3529 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, i
nfo.Length())), info.GetIsolate()); | 3529 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, i
nfo.Length())), info.GetIsolate()); |
3530 return; | 3530 return; |
3531 } | 3531 } |
3532 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3532 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3533 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); | 3533 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
3534 if (UNLIKELY(info.Length() <= 1)) { | 3534 if (UNLIKELY(info.Length() <= 1)) { |
3535 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | 3535 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
3536 return; | 3536 return; |
3537 } | 3537 } |
3538 V8TRYCATCH_VOID(int, opt1, toInt32(info[1])); | 3538 V8TRYCATCH_VOID(int, opt1, toInt32(info[1])); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3592 | 3592 |
3593 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) | 3593 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
3594 { | 3594 { |
3595 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3595 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3596 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); | 3596 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); |
3597 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3597 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3598 } | 3598 } |
3599 | 3599 |
3600 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 3600 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
3601 { | 3601 { |
3602 if (UNLIKELY(info.Length() < 1)) { | 3602 if (info.Length() < 1) { |
3603 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 3603 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
3604 return; | 3604 return; |
3605 } | 3605 } |
3606 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3606 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3607 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3607 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3608 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", "The callback provided as parameter 1 is not a functio
n."), info.GetIsolate()); | 3608 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", "The callback provided as parameter 1 is not a functio
n."), info.GetIsolate()); |
3609 return; | 3609 return; |
3610 } | 3610 } |
3611 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 3611 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
3612 imp->methodWithCallbackInterfaceArg(callbackInterface.release()); | 3612 imp->methodWithCallbackInterfaceArg(callbackInterface.release()); |
3613 } | 3613 } |
3614 | 3614 |
3615 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3615 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3616 { | 3616 { |
3617 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3617 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3618 TestObjV8Internal::methodWithCallbackInterfaceArgMethod(info); | 3618 TestObjV8Internal::methodWithCallbackInterfaceArgMethod(info); |
3619 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3619 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3620 } | 3620 } |
3621 | 3621 |
3622 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::Func
tionCallbackInfo<v8::Value>& info) | 3622 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::Func
tionCallbackInfo<v8::Value>& info) |
3623 { | 3623 { |
3624 if (UNLIKELY(info.Length() < 2)) { | 3624 if (info.Length() < 2) { |
3625 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments
(2, info.Length())), info.GetIsolate()); | 3625 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments
(2, info.Length())), info.GetIsolate()); |
3626 return; | 3626 return; |
3627 } | 3627 } |
3628 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3628 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3629 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); | 3629 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); |
3630 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 3630 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
3631 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackInterfaceArg", "TestObject", "The callback provided as parameter 2
is not a function."), info.GetIsolate()); | 3631 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackInterfaceArg", "TestObject", "The callback provided as parameter 2
is not a function."), info.GetIsolate()); |
3632 return; | 3632 return; |
3633 } | 3633 } |
3634 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext()); | 3634 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext()); |
(...skipping 23 matching lines...) Expand all Loading... |
3658 | 3658 |
3659 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) | 3659 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) |
3660 { | 3660 { |
3661 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3661 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3662 TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); | 3662 TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); |
3663 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3663 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3664 } | 3664 } |
3665 | 3665 |
3666 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3666 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3667 { | 3667 { |
3668 if (UNLIKELY(info.Length() < 1)) { | 3668 if (info.Length() < 1) { |
3669 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); | 3669 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); |
3670 return; | 3670 return; |
3671 } | 3671 } |
3672 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3672 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3673 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { | 3673 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
3674 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a
function."), info.GetIsolate()); | 3674 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a
function."), info.GetIsolate()); |
3675 return; | 3675 return; |
3676 } | 3676 } |
3677 OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullpt
r : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), get
ExecutionContext()); | 3677 OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullpt
r : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), get
ExecutionContext()); |
3678 imp->methodWithNullableCallbackInterfaceArg(callbackInterface.release()); | 3678 imp->methodWithNullableCallbackInterfaceArg(callbackInterface.release()); |
(...skipping 21 matching lines...) Expand all Loading... |
3700 | 3700 |
3701 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3701 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3702 { | 3702 { |
3703 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3703 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3704 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); | 3704 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); |
3705 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3705 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3706 } | 3706 } |
3707 | 3707 |
3708 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3708 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3709 { | 3709 { |
3710 if (UNLIKELY(info.Length() < 1)) { | 3710 if (info.Length() < 1) { |
3711 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3711 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3712 return; | 3712 return; |
3713 } | 3713 } |
3714 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3714 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3715 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); | 3715 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); |
3716 return; | 3716 return; |
3717 } | 3717 } |
3718 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 3718 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
3719 TestObj::staticMethodWithCallbackArg(callbackInterface.release()); | 3719 TestObj::staticMethodWithCallbackArg(callbackInterface.release()); |
3720 } | 3720 } |
3721 | 3721 |
3722 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3722 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3723 { | 3723 { |
3724 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3724 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3725 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); | 3725 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); |
3726 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3726 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3727 } | 3727 } |
3728 | 3728 |
3729 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3729 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3730 { | 3730 { |
3731 if (UNLIKELY(info.Length() < 1)) { | 3731 if (info.Length() < 1) { |
3732 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3732 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3733 return; | 3733 return; |
3734 } | 3734 } |
3735 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3735 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3736 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok)
, info.GetIsolate()); | 3736 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok)
, info.GetIsolate()); |
3737 imp->methodWithEnforceRangeInt8(value); | 3737 imp->methodWithEnforceRangeInt8(value); |
3738 } | 3738 } |
3739 | 3739 |
3740 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3740 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3741 { | 3741 { |
3742 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3742 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3743 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); | 3743 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); |
3744 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3744 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3745 } | 3745 } |
3746 | 3746 |
3747 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3747 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3748 { | 3748 { |
3749 if (UNLIKELY(info.Length() < 1)) { | 3749 if (info.Length() < 1) { |
3750 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3750 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3751 return; | 3751 return; |
3752 } | 3752 } |
3753 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3753 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3754 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRang
e, ok), info.GetIsolate()); | 3754 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRang
e, ok), info.GetIsolate()); |
3755 imp->methodWithEnforceRangeUInt8(value); | 3755 imp->methodWithEnforceRangeUInt8(value); |
3756 } | 3756 } |
3757 | 3757 |
3758 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3758 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3759 { | 3759 { |
3760 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3760 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3761 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); | 3761 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); |
3762 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3762 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3763 } | 3763 } |
3764 | 3764 |
3765 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3765 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3766 { | 3766 { |
3767 if (UNLIKELY(info.Length() < 1)) { | 3767 if (info.Length() < 1) { |
3768 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3768 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3769 return; | 3769 return; |
3770 } | 3770 } |
3771 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3771 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3772 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok
), info.GetIsolate()); | 3772 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok
), info.GetIsolate()); |
3773 imp->methodWithEnforceRangeInt16(value); | 3773 imp->methodWithEnforceRangeInt16(value); |
3774 } | 3774 } |
3775 | 3775 |
3776 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3776 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3777 { | 3777 { |
3778 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3778 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3779 TestObjV8Internal::methodWithEnforceRangeInt16Method(info); | 3779 TestObjV8Internal::methodWithEnforceRangeInt16Method(info); |
3780 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3780 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3781 } | 3781 } |
3782 | 3782 |
3783 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3783 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3784 { | 3784 { |
3785 if (UNLIKELY(info.Length() < 1)) { | 3785 if (info.Length() < 1) { |
3786 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); | 3786 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
3787 return; | 3787 return; |
3788 } | 3788 } |
3789 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3789 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3790 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRan
ge, ok), info.GetIsolate()); | 3790 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
3791 imp->methodWithEnforceRangeUInt16(value); | 3791 imp->methodWithEnforceRangeUInt16(value); |
3792 } | 3792 } |
3793 | 3793 |
3794 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3794 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3795 { | 3795 { |
3796 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3796 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3797 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); | 3797 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); |
3798 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3798 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3799 } | 3799 } |
3800 | 3800 |
3801 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3801 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3802 { | 3802 { |
3803 if (UNLIKELY(info.Length() < 1)) { | 3803 if (info.Length() < 1) { |
3804 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3804 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3805 return; | 3805 return; |
3806 } | 3806 } |
3807 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3807 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3808 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok
), info.GetIsolate()); | 3808 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok
), info.GetIsolate()); |
3809 imp->methodWithEnforceRangeInt32(value); | 3809 imp->methodWithEnforceRangeInt32(value); |
3810 } | 3810 } |
3811 | 3811 |
3812 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3812 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3813 { | 3813 { |
3814 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3814 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3815 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); | 3815 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); |
3816 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3816 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3817 } | 3817 } |
3818 | 3818 |
3819 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3819 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3820 { | 3820 { |
3821 if (UNLIKELY(info.Length() < 1)) { | 3821 if (info.Length() < 1) { |
3822 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); | 3822 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
3823 return; | 3823 return; |
3824 } | 3824 } |
3825 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3825 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3826 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRan
ge, ok), info.GetIsolate()); | 3826 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
3827 imp->methodWithEnforceRangeUInt32(value); | 3827 imp->methodWithEnforceRangeUInt32(value); |
3828 } | 3828 } |
3829 | 3829 |
3830 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3830 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3831 { | 3831 { |
3832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3833 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); | 3833 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); |
3834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3835 } | 3835 } |
3836 | 3836 |
3837 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3837 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3838 { | 3838 { |
3839 if (UNLIKELY(info.Length() < 1)) { | 3839 if (info.Length() < 1) { |
3840 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3840 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3841 return; | 3841 return; |
3842 } | 3842 } |
3843 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3843 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3844 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRan
ge, ok), info.GetIsolate()); | 3844 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
3845 imp->methodWithEnforceRangeInt64(value); | 3845 imp->methodWithEnforceRangeInt64(value); |
3846 } | 3846 } |
3847 | 3847 |
3848 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3848 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3849 { | 3849 { |
3850 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3850 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3851 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); | 3851 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); |
3852 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3852 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3853 } | 3853 } |
3854 | 3854 |
3855 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3855 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3856 { | 3856 { |
3857 if (UNLIKELY(info.Length() < 1)) { | 3857 if (info.Length() < 1) { |
3858 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); | 3858 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
3859 return; | 3859 return; |
3860 } | 3860 } |
3861 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3861 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3862 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0],
EnforceRange, ok), info.GetIsolate()); | 3862 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0],
EnforceRange, ok), info.GetIsolate()); |
3863 imp->methodWithEnforceRangeUInt64(value); | 3863 imp->methodWithEnforceRangeUInt64(value); |
3864 } | 3864 } |
3865 | 3865 |
3866 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3866 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3867 { | 3867 { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3929 | 3929 |
3930 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3930 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3931 { | 3931 { |
3932 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3932 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3933 TestObjV8Internal::callbackFunctionReturnValueMethod(info); | 3933 TestObjV8Internal::callbackFunctionReturnValueMethod(info); |
3934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3935 } | 3935 } |
3936 | 3936 |
3937 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 3937 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
3938 { | 3938 { |
3939 if (UNLIKELY(info.Length() < 1)) { | 3939 if (info.Length() < 1) { |
3940 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 3940 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
3941 return; | 3941 return; |
3942 } | 3942 } |
3943 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3943 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3944 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); | 3944 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); |
3945 imp->callbackFunctionArgument(function); | 3945 imp->callbackFunctionArgument(function); |
3946 } | 3946 } |
3947 | 3947 |
3948 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 3948 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
3949 { | 3949 { |
3950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3951 TestObjV8Internal::callbackFunctionArgumentMethod(info); | 3951 TestObjV8Internal::callbackFunctionArgumentMethod(info); |
3952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3953 } | 3953 } |
3954 | 3954 |
3955 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3955 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3956 { | 3956 { |
3957 if (UNLIKELY(info.Length() < 1)) { | 3957 if (info.Length() < 1) { |
3958 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 3958 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3959 return; | 3959 return; |
3960 } | 3960 } |
3961 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3961 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3962 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 3962 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
3963 imp->overloadedMethod(longArg); | 3963 imp->overloadedMethod(longArg); |
3964 } | 3964 } |
3965 | 3965 |
3966 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3966 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3967 { | 3967 { |
3968 if (UNLIKELY(info.Length() < 1)) { | 3968 if (info.Length() < 1) { |
3969 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 3969 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3970 return; | 3970 return; |
3971 } | 3971 } |
3972 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3972 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3973 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3973 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3974 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); | 3974 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); |
3975 return; | 3975 return; |
3976 } | 3976 } |
3977 OwnPtr<TestCallbackInterface> callbackInterfaceArg = V8TestCallbackInterface
::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 3977 OwnPtr<TestCallbackInterface> callbackInterfaceArg = V8TestCallbackInterface
::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
3978 imp->overloadedMethod(callbackInterfaceArg.release()); | 3978 imp->overloadedMethod(callbackInterfaceArg.release()); |
3979 } | 3979 } |
3980 | 3980 |
3981 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3981 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3982 { | 3982 { |
3983 if (UNLIKELY(info.Length() < 1)) { | 3983 if (info.Length() < 1) { |
3984 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 3984 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3985 return; | 3985 return; |
3986 } | 3986 } |
3987 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3987 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3988 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3988 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3989 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); | 3989 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); |
3990 return; | 3990 return; |
3991 } | 3991 } |
3992 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[0]), getExecutionContext()); | 3992 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[0]), getExecutionContext()); |
3993 imp->overloadedMethod(objArg.release()); | 3993 imp->overloadedMethod(objArg.release()); |
3994 } | 3994 } |
3995 | 3995 |
3996 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3996 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3997 { | 3997 { |
3998 if (UNLIKELY(info.Length() < 1)) { | 3998 if (info.Length() < 1) { |
3999 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 3999 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
4000 return; | 4000 return; |
4001 } | 4001 } |
4002 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4002 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4003 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1,
info.GetIsolate())); | 4003 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1,
info.GetIsolate())); |
4004 imp->overloadedMethod(arrayArg); | 4004 imp->overloadedMethod(arrayArg); |
4005 } | 4005 } |
4006 | 4006 |
4007 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4007 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
4008 { | 4008 { |
4009 if (UNLIKELY(info.Length() < 1)) { | 4009 if (info.Length() < 1) { |
4010 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4010 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
4011 return; | 4011 return; |
4012 } | 4012 } |
4013 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4013 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4014 V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[
0], 1, info.GetIsolate())); | 4014 V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[
0], 1, info.GetIsolate())); |
4015 imp->overloadedMethod(sequenceArg); | 4015 imp->overloadedMethod(sequenceArg); |
4016 } | 4016 } |
4017 | 4017 |
4018 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4018 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4019 { | 4019 { |
(...skipping 29 matching lines...) Expand all Loading... |
4049 | 4049 |
4050 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 4050 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
4051 { | 4051 { |
4052 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4052 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4053 TestObjV8Internal::overloadedMethodMethod(info); | 4053 TestObjV8Internal::overloadedMethodMethod(info); |
4054 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4054 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4055 } | 4055 } |
4056 | 4056 |
4057 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4057 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4058 { | 4058 { |
4059 if (UNLIKELY(info.Length() < 1)) { | 4059 if (info.Length() < 1) { |
4060 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4060 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4061 return; | 4061 return; |
4062 } | 4062 } |
4063 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4063 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4064 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { | 4064 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
4065 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", "The callback provided as parameter 1 is not a function."), info.Ge
tIsolate()); | 4065 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", "The callback provided as parameter 1 is not a function."), info.Ge
tIsolate()); |
4066 return; | 4066 return; |
4067 } | 4067 } |
4068 OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::crea
te(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 4068 OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::crea
te(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
4069 if (UNLIKELY(info.Length() <= 1)) { | 4069 if (UNLIKELY(info.Length() <= 1)) { |
4070 imp->overloadedMethodA(objArg.release()); | 4070 imp->overloadedMethodA(objArg.release()); |
4071 return; | 4071 return; |
4072 } | 4072 } |
4073 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4073 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4074 imp->overloadedMethodA(objArg.release(), longArg); | 4074 imp->overloadedMethodA(objArg.release(), longArg); |
4075 } | 4075 } |
4076 | 4076 |
4077 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4077 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4078 { | 4078 { |
4079 if (UNLIKELY(info.Length() < 2)) { | 4079 if (info.Length() < 2) { |
4080 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI
solate()); | 4080 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI
solate()); |
4081 return; | 4081 return; |
4082 } | 4082 } |
4083 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4083 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4084 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { | 4084 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
4085 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", "The callback provided as parameter 1 is not a function."), info.Ge
tIsolate()); | 4085 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", "The callback provided as parameter 1 is not a function."), info.Ge
tIsolate()); |
4086 return; | 4086 return; |
4087 } | 4087 } |
4088 OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::crea
te(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 4088 OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::crea
te(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
4089 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 4089 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
(...skipping 22 matching lines...) Expand all Loading... |
4112 | 4112 |
4113 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4113 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4114 { | 4114 { |
4115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4116 TestObjV8Internal::overloadedMethodAMethod(info); | 4116 TestObjV8Internal::overloadedMethodAMethod(info); |
4117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4118 } | 4118 } |
4119 | 4119 |
4120 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4120 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4121 { | 4121 { |
4122 if (UNLIKELY(info.Length() < 1)) { | 4122 if (info.Length() < 1) { |
4123 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4123 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4124 return; | 4124 return; |
4125 } | 4125 } |
4126 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4126 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4127 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4127 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4128 imp->overloadedMethodB(strArg); | 4128 imp->overloadedMethodB(strArg); |
4129 } | 4129 } |
4130 | 4130 |
4131 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4131 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4132 { | 4132 { |
4133 if (UNLIKELY(info.Length() < 1)) { | 4133 if (info.Length() < 1) { |
4134 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4134 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4135 return; | 4135 return; |
4136 } | 4136 } |
4137 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4137 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4138 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4138 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4139 imp->overloadedMethodB(strArg); | 4139 imp->overloadedMethodB(strArg); |
4140 } | 4140 } |
4141 | 4141 |
4142 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4142 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
4143 { | 4143 { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4197 | 4197 |
4198 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4198 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4199 { | 4199 { |
4200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4201 V8TestObject::classMethod2MethodCustom(info); | 4201 V8TestObject::classMethod2MethodCustom(info); |
4202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4203 } | 4203 } |
4204 | 4204 |
4205 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4205 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4206 { | 4206 { |
4207 if (UNLIKELY(info.Length() < 2)) { | 4207 if (info.Length() < 2) { |
4208 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); | 4208 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
4209 return; | 4209 return; |
4210 } | 4210 } |
4211 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4211 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4212 unsigned objArgsShort = 0; | 4212 unsigned objArgsShort = 0; |
4213 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); | 4213 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); |
4214 if (!std::isnan(objArgsShortNativeValue)) | 4214 if (!std::isnan(objArgsShortNativeValue)) |
4215 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | 4215 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); |
4216 unsigned objArgsLong = 0; | 4216 unsigned objArgsLong = 0; |
4217 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); | 4217 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); |
4218 if (!std::isnan(objArgsLongNativeValue)) | 4218 if (!std::isnan(objArgsLongNativeValue)) |
4219 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | 4219 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); |
4220 imp->classMethodWithClamp(objArgsShort, objArgsLong); | 4220 imp->classMethodWithClamp(objArgsShort, objArgsLong); |
4221 } | 4221 } |
4222 | 4222 |
4223 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4223 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4224 { | 4224 { |
4225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4226 TestObjV8Internal::classMethodWithClampMethod(info); | 4226 TestObjV8Internal::classMethodWithClampMethod(info); |
4227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4228 } | 4228 } |
4229 | 4229 |
4230 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4230 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4231 { | 4231 { |
4232 if (UNLIKELY(info.Length() < 1)) { | 4232 if (info.Length() < 1) { |
4233 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho
d", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info
.GetIsolate()); | 4233 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho
d", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info
.GetIsolate()); |
4234 return; | 4234 return; |
4235 } | 4235 } |
4236 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4236 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4237 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4237 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4238 imp->enabledAtRuntimeMethod(longArg); | 4238 imp->enabledAtRuntimeMethod(longArg); |
4239 } | 4239 } |
4240 | 4240 |
4241 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4241 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4242 { | 4242 { |
4243 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4243 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4244 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); | 4244 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); |
4245 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4245 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4246 } | 4246 } |
4247 | 4247 |
4248 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 4248 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
4249 { | 4249 { |
4250 if (UNLIKELY(info.Length() < 1)) { | 4250 if (info.Length() < 1) { |
4251 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth
od", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 4251 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth
od", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
4252 return; | 4252 return; |
4253 } | 4253 } |
4254 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4254 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4255 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4255 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4256 imp->enabledPerContextMethod(longArg); | 4256 imp->enabledPerContextMethod(longArg); |
4257 } | 4257 } |
4258 | 4258 |
4259 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4259 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4260 { | 4260 { |
4261 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4261 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4262 TestObjV8Internal::enabledPerContextMethodMethod(info); | 4262 TestObjV8Internal::enabledPerContextMethodMethod(info); |
4263 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4263 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4264 } | 4264 } |
4265 | 4265 |
4266 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4266 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4267 { | 4267 { |
4268 if (UNLIKELY(info.Length() < 1)) { | 4268 if (info.Length() < 1) { |
4269 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4269 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4270 return; | 4270 return; |
4271 } | 4271 } |
4272 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4272 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4273 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); | 4273 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); |
4274 imp->methodWithUnsignedLongSequence(unsignedLongSequence); | 4274 imp->methodWithUnsignedLongSequence(unsignedLongSequence); |
4275 } | 4275 } |
4276 | 4276 |
4277 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 4277 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
4278 { | 4278 { |
4279 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4279 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4280 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); | 4280 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); |
4281 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4281 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4282 } | 4282 } |
4283 | 4283 |
4284 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4284 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4285 { | 4285 { |
4286 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestObject", info.Holder(), info.GetIsolate()); | 4286 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestObject", info.Holder(), info.GetIsolate()); |
4287 if (UNLIKELY(info.Length() < 1)) { | 4287 if (info.Length() < 1) { |
4288 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4288 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4289 exceptionState.throwIfNeeded(); | 4289 exceptionState.throwIfNeeded(); |
4290 return; | 4290 return; |
4291 } | 4291 } |
4292 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4292 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4293 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); | 4293 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); |
4294 Vector<String> result = imp->stringArrayFunction(values, exceptionState); | 4294 Vector<String> result = imp->stringArrayFunction(values, exceptionState); |
4295 if (exceptionState.throwIfNeeded()) | 4295 if (exceptionState.throwIfNeeded()) |
4296 return; | 4296 return; |
4297 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); | 4297 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
4298 } | 4298 } |
4299 | 4299 |
4300 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4300 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4301 { | 4301 { |
4302 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4302 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4303 TestObjV8Internal::stringArrayFunctionMethod(info); | 4303 TestObjV8Internal::stringArrayFunctionMethod(info); |
4304 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4304 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4305 } | 4305 } |
4306 | 4306 |
4307 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4307 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4308 { | 4308 { |
4309 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); | 4309 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); |
4310 if (UNLIKELY(info.Length() < 1)) { | 4310 if (info.Length() < 1) { |
4311 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4311 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4312 exceptionState.throwIfNeeded(); | 4312 exceptionState.throwIfNeeded(); |
4313 return; | 4313 return; |
4314 } | 4314 } |
4315 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4315 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4316 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); | 4316 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); |
4317 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); | 4317 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); |
4318 if (exceptionState.throwIfNeeded()) | 4318 if (exceptionState.throwIfNeeded()) |
4319 return; | 4319 return; |
4320 v8SetReturnValue(info, result.release()); | 4320 v8SetReturnValue(info, result.release()); |
(...skipping 23 matching lines...) Expand all Loading... |
4344 | 4344 |
4345 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4345 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4346 { | 4346 { |
4347 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4347 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4348 TestObjV8Internal::getSVGDocumentMethod(info); | 4348 TestObjV8Internal::getSVGDocumentMethod(info); |
4349 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4349 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4350 } | 4350 } |
4351 | 4351 |
4352 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4352 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
4353 { | 4353 { |
4354 if (UNLIKELY(info.Length() < 1)) { | 4354 if (info.Length() < 1) { |
4355 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4355 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
4356 return; | 4356 return; |
4357 } | 4357 } |
4358 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4358 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4359 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4359 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
4360 imp->convert1(value); | 4360 imp->convert1(value); |
4361 } | 4361 } |
4362 | 4362 |
4363 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4363 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4364 { | 4364 { |
4365 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4365 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4366 TestObjV8Internal::convert1Method(info); | 4366 TestObjV8Internal::convert1Method(info); |
4367 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4367 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4368 } | 4368 } |
4369 | 4369 |
4370 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4370 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
4371 { | 4371 { |
4372 if (UNLIKELY(info.Length() < 1)) { | 4372 if (info.Length() < 1) { |
4373 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4373 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
4374 return; | 4374 return; |
4375 } | 4375 } |
4376 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4376 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4377 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4377 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
4378 imp->convert2(value); | 4378 imp->convert2(value); |
4379 } | 4379 } |
4380 | 4380 |
4381 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4381 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4382 { | 4382 { |
(...skipping 23 matching lines...) Expand all Loading... |
4406 | 4406 |
4407 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4407 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4408 { | 4408 { |
4409 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4409 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4410 TestObjV8Internal::immutablePointFunctionMethod(info); | 4410 TestObjV8Internal::immutablePointFunctionMethod(info); |
4411 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4411 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4412 } | 4412 } |
4413 | 4413 |
4414 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4414 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4415 { | 4415 { |
4416 if (UNLIKELY(info.Length() < 2)) { | 4416 if (info.Length() < 2) { |
4417 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol
ate()); | 4417 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol
ate()); |
4418 return; | 4418 return; |
4419 } | 4419 } |
4420 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4420 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4421 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); | 4421 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
4422 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); | 4422 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
4423 if (!item) { | 4423 if (!item) { |
4424 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); | 4424 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
4425 return; | 4425 return; |
4426 } | 4426 } |
4427 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); | 4427 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); |
4428 } | 4428 } |
4429 | 4429 |
4430 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4430 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4431 { | 4431 { |
4432 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4432 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4433 TestObjV8Internal::svgPointMethodMethod(info); | 4433 TestObjV8Internal::svgPointMethodMethod(info); |
4434 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4434 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4435 } | 4435 } |
4436 | 4436 |
4437 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4437 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4438 { | 4438 { |
4439 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPo
intMethod", "TestObject", info.Holder(), info.GetIsolate()); | 4439 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPo
intMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4440 if (UNLIKELY(info.Length() < 2)) { | 4440 if (info.Length() < 2) { |
4441 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 4441 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
4442 exceptionState.throwIfNeeded(); | 4442 exceptionState.throwIfNeeded(); |
4443 return; | 4443 return; |
4444 } | 4444 } |
4445 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4445 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4446 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst
ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { | 4446 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst
ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { |
4447 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); | 4447 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
4448 return; | 4448 return; |
4449 } | 4449 } |
4450 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); | 4450 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
(...skipping 24 matching lines...) Expand all Loading... |
4475 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4475 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4476 { | 4476 { |
4477 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4477 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4478 TestObjV8Internal::orangeMethod(info); | 4478 TestObjV8Internal::orangeMethod(info); |
4479 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4479 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4480 } | 4480 } |
4481 | 4481 |
4482 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4482 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4483 { | 4483 { |
4484 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunct
ion", "TestObject", info.Holder(), info.GetIsolate()); | 4484 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunct
ion", "TestObject", info.Holder(), info.GetIsolate()); |
4485 if (UNLIKELY(info.Length() < 3)) { | 4485 if (info.Length() < 3) { |
4486 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 4486 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
4487 exceptionState.throwIfNeeded(); | 4487 exceptionState.throwIfNeeded(); |
4488 return; | 4488 return; |
4489 } | 4489 } |
4490 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4490 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4491 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 4491 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
4492 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); | 4492 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); |
4493 V8TRYCATCH_VOID(int, b, toInt32(info[2])); | 4493 V8TRYCATCH_VOID(int, b, toInt32(info[2])); |
4494 bool result = imp->strictFunction(str, a, b, exceptionState); | 4494 bool result = imp->strictFunction(str, a, b, exceptionState); |
4495 if (exceptionState.throwIfNeeded()) | 4495 if (exceptionState.throwIfNeeded()) |
4496 return; | 4496 return; |
4497 v8SetReturnValueBool(info, result); | 4497 v8SetReturnValueBool(info, result); |
4498 } | 4498 } |
4499 | 4499 |
4500 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4500 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4501 { | 4501 { |
4502 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4502 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4503 TestObjV8Internal::strictFunctionMethod(info); | 4503 TestObjV8Internal::strictFunctionMethod(info); |
4504 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4504 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4505 } | 4505 } |
4506 | 4506 |
4507 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4507 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4508 { | 4508 { |
4509 if (UNLIKELY(info.Length() < 1)) { | 4509 if (info.Length() < 1) { |
4510 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); | 4510 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
4511 return; | 4511 return; |
4512 } | 4512 } |
4513 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4513 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4514 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); | 4514 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); |
4515 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); | 4515 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); |
4516 imp->variadicStringMethod(head, tail); | 4516 imp->variadicStringMethod(head, tail); |
4517 } | 4517 } |
4518 | 4518 |
4519 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4519 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4520 { | 4520 { |
4521 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4521 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4522 TestObjV8Internal::variadicStringMethodMethod(info); | 4522 TestObjV8Internal::variadicStringMethodMethod(info); |
4523 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4523 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4524 } | 4524 } |
4525 | 4525 |
4526 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4526 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4527 { | 4527 { |
4528 if (UNLIKELY(info.Length() < 1)) { | 4528 if (info.Length() < 1) { |
4529 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); | 4529 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
4530 return; | 4530 return; |
4531 } | 4531 } |
4532 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4532 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4533 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); | 4533 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); |
4534 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); | 4534 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); |
4535 imp->variadicDoubleMethod(head, tail); | 4535 imp->variadicDoubleMethod(head, tail); |
4536 } | 4536 } |
4537 | 4537 |
4538 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4538 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4539 { | 4539 { |
4540 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4540 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4541 TestObjV8Internal::variadicDoubleMethodMethod(info); | 4541 TestObjV8Internal::variadicDoubleMethodMethod(info); |
4542 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4542 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4543 } | 4543 } |
4544 | 4544 |
4545 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4545 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4546 { | 4546 { |
4547 if (UNLIKELY(info.Length() < 1)) { | 4547 if (info.Length() < 1) { |
4548 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); | 4548 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); |
4549 return; | 4549 return; |
4550 } | 4550 } |
4551 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4551 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4552 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); | 4552 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); |
4553 Vector<RefPtr<Node> > tail; | 4553 Vector<RefPtr<Node> > tail; |
4554 for (int i = 1; i < info.Length(); ++i) { | 4554 for (int i = 1; i < info.Length(); ++i) { |
4555 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { | 4555 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { |
4556 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); | 4556 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); |
4557 return; | 4557 return; |
4558 } | 4558 } |
4559 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); | 4559 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); |
4560 } | 4560 } |
4561 imp->variadicNodeMethod(head, tail); | 4561 imp->variadicNodeMethod(head, tail); |
4562 } | 4562 } |
4563 | 4563 |
4564 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4564 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4565 { | 4565 { |
4566 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4566 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4567 TestObjV8Internal::variadicNodeMethodMethod(info); | 4567 TestObjV8Internal::variadicNodeMethodMethod(info); |
4568 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4568 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4569 } | 4569 } |
4570 | 4570 |
4571 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4571 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4572 { | 4572 { |
4573 if (UNLIKELY(info.Length() < 3)) { | 4573 if (info.Length() < 3) { |
4574 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg
uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())),
info.GetIsolate()); | 4574 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg
uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())),
info.GetIsolate()); |
4575 return; | 4575 return; |
4576 } | 4576 } |
4577 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4577 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4578 bool strIsNull = info[0]->IsNull(); | 4578 bool strIsNull = info[0]->IsNull(); |
4579 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); | 4579 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); |
4580 String str = strStringResource; | 4580 String str = strStringResource; |
4581 bool lIsNull = info[1]->IsNull(); | 4581 bool lIsNull = info[1]->IsNull(); |
4582 V8TRYCATCH_VOID(int, l, toInt32(info[1])); | 4582 V8TRYCATCH_VOID(int, l, toInt32(info[1])); |
4583 if (info.Length() <= 2 || !(info[2]->IsFunction() || info[2]->IsNull())) { | 4583 if (info.Length() <= 2 || !(info[2]->IsFunction() || info[2]->IsNull())) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4622 | 4622 |
4623 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 4623 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
4624 { | 4624 { |
4625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4626 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); | 4626 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); |
4627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4628 } | 4628 } |
4629 | 4629 |
4630 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4630 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4631 { | 4631 { |
4632 if (UNLIKELY(info.Length() < 1)) { | 4632 if (info.Length() < 1) { |
4633 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 4633 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
4634 return; | 4634 return; |
4635 } | 4635 } |
4636 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4636 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4637 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4637 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4638 imp->overloadedPerWorldMethod(longArg); | 4638 imp->overloadedPerWorldMethod(longArg); |
4639 } | 4639 } |
4640 | 4640 |
4641 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 4641 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
4642 { | 4642 { |
4643 if (UNLIKELY(info.Length() < 1)) { | 4643 if (info.Length() < 1) { |
4644 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 4644 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
4645 return; | 4645 return; |
4646 } | 4646 } |
4647 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4647 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4648 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4648 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4649 imp->overloadedPerWorldMethod(longArg); | 4649 imp->overloadedPerWorldMethod(longArg); |
4650 } | 4650 } |
4651 | 4651 |
4652 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4652 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4653 { | 4653 { |
4654 if (UNLIKELY(info.Length() < 2)) { | 4654 if (info.Length() < 2) { |
4655 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); | 4655 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); |
4656 return; | 4656 return; |
4657 } | 4657 } |
4658 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4658 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4659 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4659 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4660 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4660 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4661 imp->overloadedPerWorldMethod(strArg, longArg); | 4661 imp->overloadedPerWorldMethod(strArg, longArg); |
4662 } | 4662 } |
4663 | 4663 |
4664 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 4664 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
(...skipping 18 matching lines...) Expand all Loading... |
4683 | 4683 |
4684 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 4684 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
4685 { | 4685 { |
4686 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4686 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4687 TestObjV8Internal::overloadedPerWorldMethodMethod(info); | 4687 TestObjV8Internal::overloadedPerWorldMethodMethod(info); |
4688 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4688 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4689 } | 4689 } |
4690 | 4690 |
4691 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 4691 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
4692 { | 4692 { |
4693 if (UNLIKELY(info.Length() < 2)) { | 4693 if (info.Length() < 2) { |
4694 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); | 4694 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); |
4695 return; | 4695 return; |
4696 } | 4696 } |
4697 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4697 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4698 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4698 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4699 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4699 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4700 imp->overloadedPerWorldMethod(strArg, longArg); | 4700 imp->overloadedPerWorldMethod(strArg, longArg); |
4701 } | 4701 } |
4702 | 4702 |
4703 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 4703 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
(...skipping 18 matching lines...) Expand all Loading... |
4722 | 4722 |
4723 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) | 4723 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) |
4724 { | 4724 { |
4725 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4725 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4726 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); | 4726 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); |
4727 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4727 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4728 } | 4728 } |
4729 | 4729 |
4730 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4730 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4731 { | 4731 { |
4732 if (UNLIKELY(info.Length() < 1)) { | 4732 if (info.Length() < 1) { |
4733 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4733 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4734 return; | 4734 return; |
4735 } | 4735 } |
4736 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4736 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4737 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4737 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4738 imp->activityLoggedMethod1(longArg); | 4738 imp->activityLoggedMethod1(longArg); |
4739 } | 4739 } |
4740 | 4740 |
4741 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4741 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4742 { | 4742 { |
4743 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4743 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4744 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4744 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4745 if (contextData && contextData->activityLogger()) { | 4745 if (contextData && contextData->activityLogger()) { |
4746 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4746 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4747 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); | 4747 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); |
4748 } | 4748 } |
4749 TestObjV8Internal::activityLoggedMethod1Method(info); | 4749 TestObjV8Internal::activityLoggedMethod1Method(info); |
4750 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4750 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4751 } | 4751 } |
4752 | 4752 |
4753 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4753 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4754 { | 4754 { |
4755 if (UNLIKELY(info.Length() < 1)) { | 4755 if (info.Length() < 1) { |
4756 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4756 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4757 return; | 4757 return; |
4758 } | 4758 } |
4759 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4759 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4760 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4760 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4761 imp->activityLoggedMethod2(longArg); | 4761 imp->activityLoggedMethod2(longArg); |
4762 } | 4762 } |
4763 | 4763 |
4764 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4764 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4765 { | 4765 { |
4766 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4766 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4767 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4767 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4768 if (contextData && contextData->activityLogger()) { | 4768 if (contextData && contextData->activityLogger()) { |
4769 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4769 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4770 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); | 4770 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
4771 } | 4771 } |
4772 TestObjV8Internal::activityLoggedMethod2Method(info); | 4772 TestObjV8Internal::activityLoggedMethod2Method(info); |
4773 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4773 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4774 } | 4774 } |
4775 | 4775 |
4776 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 4776 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
4777 { | 4777 { |
4778 if (UNLIKELY(info.Length() < 1)) { | 4778 if (info.Length() < 1) { |
4779 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4779 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4780 return; | 4780 return; |
4781 } | 4781 } |
4782 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4782 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4783 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4783 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4784 imp->activityLoggedMethod2(longArg); | 4784 imp->activityLoggedMethod2(longArg); |
4785 } | 4785 } |
4786 | 4786 |
4787 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 4787 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
4788 { | 4788 { |
4789 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4789 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4790 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4790 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4791 if (contextData && contextData->activityLogger()) { | 4791 if (contextData && contextData->activityLogger()) { |
4792 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4792 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4793 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); | 4793 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
4794 } | 4794 } |
4795 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); | 4795 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); |
4796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4797 } | 4797 } |
4798 | 4798 |
4799 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 4799 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
4800 { | 4800 { |
4801 if (UNLIKELY(info.Length() < 1)) { | 4801 if (info.Length() < 1) { |
4802 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); | 4802 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); |
4803 return; | 4803 return; |
4804 } | 4804 } |
4805 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4805 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4806 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4806 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4807 imp->activityLoggedInIsolatedWorldMethod(longArg); | 4807 imp->activityLoggedInIsolatedWorldMethod(longArg); |
4808 } | 4808 } |
4809 | 4809 |
4810 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 4810 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
4811 { | 4811 { |
4812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4813 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4813 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4814 if (contextData && contextData->activityLogger()) { | 4814 if (contextData && contextData->activityLogger()) { |
4815 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4815 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4816 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); | 4816 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); |
4817 } | 4817 } |
4818 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); | 4818 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); |
4819 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4819 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4820 } | 4820 } |
4821 | 4821 |
4822 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) | 4822 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) |
4823 { | 4823 { |
4824 if (UNLIKELY(info.Length() < 1)) { | 4824 if (info.Length() < 1) { |
4825 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); | 4825 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); |
4826 return; | 4826 return; |
4827 } | 4827 } |
4828 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4828 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4829 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4829 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4830 imp->activityLoggedInIsolatedWorldMethod(longArg); | 4830 imp->activityLoggedInIsolatedWorldMethod(longArg); |
4831 } | 4831 } |
4832 | 4832 |
4833 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4833 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) |
4834 { | 4834 { |
4835 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4835 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4836 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); | 4836 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); |
4837 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4837 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4838 } | 4838 } |
4839 | 4839 |
4840 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4840 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4841 { | 4841 { |
4842 if (UNLIKELY(info.Length() < 1)) { | 4842 if (info.Length() < 1) { |
4843 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4843 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4844 return; | 4844 return; |
4845 } | 4845 } |
4846 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4846 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4847 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4847 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4848 imp->overloadedActivityLoggedMethod(longArg); | 4848 imp->overloadedActivityLoggedMethod(longArg); |
4849 } | 4849 } |
4850 | 4850 |
4851 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) | 4851 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
4852 { | 4852 { |
4853 if (UNLIKELY(info.Length() < 1)) { | 4853 if (info.Length() < 1) { |
4854 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4854 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4855 return; | 4855 return; |
4856 } | 4856 } |
4857 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4857 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4858 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4858 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4859 imp->overloadedActivityLoggedMethod(longArg); | 4859 imp->overloadedActivityLoggedMethod(longArg); |
4860 } | 4860 } |
4861 | 4861 |
4862 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4862 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4863 { | 4863 { |
4864 if (UNLIKELY(info.Length() < 2)) { | 4864 if (info.Length() < 2) { |
4865 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); | 4865 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); |
4866 return; | 4866 return; |
4867 } | 4867 } |
4868 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4868 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4869 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4869 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4870 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4870 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4871 imp->overloadedActivityLoggedMethod(strArg, longArg); | 4871 imp->overloadedActivityLoggedMethod(strArg, longArg); |
4872 } | 4872 } |
4873 | 4873 |
4874 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4874 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
(...skipping 23 matching lines...) Expand all Loading... |
4898 if (contextData && contextData->activityLogger()) { | 4898 if (contextData && contextData->activityLogger()) { |
4899 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4899 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4900 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); | 4900 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
4901 } | 4901 } |
4902 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); | 4902 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); |
4903 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4903 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4904 } | 4904 } |
4905 | 4905 |
4906 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) | 4906 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
4907 { | 4907 { |
4908 if (UNLIKELY(info.Length() < 2)) { | 4908 if (info.Length() < 2) { |
4909 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); | 4909 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); |
4910 return; | 4910 return; |
4911 } | 4911 } |
4912 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4912 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4913 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4913 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4914 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4914 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4915 imp->overloadedActivityLoggedMethod(strArg, longArg); | 4915 imp->overloadedActivityLoggedMethod(strArg, longArg); |
4916 } | 4916 } |
4917 | 4917 |
4918 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC
allbackInfo<v8::Value>& info) | 4918 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC
allbackInfo<v8::Value>& info) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4969 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4969 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4970 { | 4970 { |
4971 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4971 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4972 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); | 4972 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); |
4973 TestObjV8Internal::deprecatedStaticMethodMethod(info); | 4973 TestObjV8Internal::deprecatedStaticMethodMethod(info); |
4974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4975 } | 4975 } |
4976 | 4976 |
4977 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 4977 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
4978 { | 4978 { |
4979 if (UNLIKELY(info.Length() < 1)) { | 4979 if (info.Length() < 1) { |
4980 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate
()); | 4980 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate
()); |
4981 return; | 4981 return; |
4982 } | 4982 } |
4983 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 4983 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
4984 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), info.GetIsola
te()); | 4984 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), info.GetIsola
te()); |
4985 return; | 4985 return; |
4986 } | 4986 } |
4987 OwnPtr<TestCallbackInterface> testCallbackInterface = V8TestCallbackInterfac
e::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 4987 OwnPtr<TestCallbackInterface> testCallbackInterface = V8TestCallbackInterfac
e::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
4988 RefPtr<TestObj> impl = TestObj::create(testCallbackInterface); | 4988 RefPtr<TestObj> impl = TestObj::create(testCallbackInterface); |
4989 v8::Handle<v8::Object> wrapper = info.Holder(); | 4989 v8::Handle<v8::Object> wrapper = info.Holder(); |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5435 fromInternalPointer(object)->deref(); | 5435 fromInternalPointer(object)->deref(); |
5436 } | 5436 } |
5437 | 5437 |
5438 template<> | 5438 template<> |
5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5440 { | 5440 { |
5441 return toV8(impl, creationContext, isolate); | 5441 return toV8(impl, creationContext, isolate); |
5442 } | 5442 } |
5443 | 5443 |
5444 } // namespace WebCore | 5444 } // namespace WebCore |
OLD | NEW |