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

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

Issue 112383002: IDL compiler: sync Python to r163665 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New test results Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * 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 23 matching lines...) Expand all
34 #include "V8TestObject.h" 34 #include "V8TestObject.h"
35 35
36 #include "HTMLNames.h" 36 #include "HTMLNames.h"
37 #include "RuntimeEnabledFeatures.h" 37 #include "RuntimeEnabledFeatures.h"
38 #include "V8DOMStringList.h" 38 #include "V8DOMStringList.h"
39 #include "V8Document.h" 39 #include "V8Document.h"
40 #include "V8MessagePort.h" 40 #include "V8MessagePort.h"
41 #include "V8Node.h" 41 #include "V8Node.h"
42 #include "V8SVGDocument.h" 42 #include "V8SVGDocument.h"
43 #include "V8SVGPoint.h" 43 #include "V8SVGPoint.h"
44 #include "V8TestCallback.h" 44 #include "V8TestCallbackInterface.h"
45 #include "V8TestInterface.h" 45 #include "V8TestInterface.h"
46 #include "V8TestNode.h" 46 #include "V8TestNode.h"
47 #include "V8TestObjectectA.h" 47 #include "V8TestObjectectA.h"
48 #include "V8TestObjectectB.h" 48 #include "V8TestObjectectB.h"
49 #include "V8TestObjectectC.h" 49 #include "V8TestObjectectC.h"
50 #include "V8TestSubObj.h" 50 #include "V8TestSubObj.h"
51 #include "bindings/v8/BindingSecurity.h" 51 #include "bindings/v8/BindingSecurity.h"
52 #include "bindings/v8/Dictionary.h" 52 #include "bindings/v8/Dictionary.h"
53 #include "bindings/v8/ExceptionMessages.h" 53 #include "bindings/v8/ExceptionMessages.h"
54 #include "bindings/v8/ExceptionState.h" 54 #include "bindings/v8/ExceptionState.h"
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 2924
2925 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 2925 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2926 { 2926 {
2927 if (UNLIKELY(info.Length() < 3)) { 2927 if (UNLIKELY(info.Length() < 3)) {
2928 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get Isolate()); 2928 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get Isolate());
2929 return; 2929 return;
2930 } 2930 }
2931 TestObj* imp = V8TestObject::toNative(info.Holder()); 2931 TestObj* imp = V8TestObject::toNative(info.Holder());
2932 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); 2932 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2933 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); 2933 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2934 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[2])) : 0); 2934 if (info.Length() <= 2 || !info[2]->IsFunction()) {
2935 imp->voidMethodWithArgs(longArg, strArg, objArg); 2935 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", "The callback provided as parameter 3 is not a function."), info.G etIsolate());
2936 return;
2937 }
2938 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C ast(info[2]), getExecutionContext());
2939 imp->voidMethodWithArgs(longArg, strArg, objArg.release());
2936 } 2940 }
2937 2941
2938 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 2942 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
2939 { 2943 {
2940 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 2944 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2941 TestObjV8Internal::voidMethodWithArgsMethod(info); 2945 TestObjV8Internal::voidMethodWithArgsMethod(info);
2942 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2946 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2943 } 2947 }
2944 2948
2945 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 2949 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 11 matching lines...) Expand all
2957 2961
2958 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 2962 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2959 { 2963 {
2960 if (UNLIKELY(info.Length() < 3)) { 2964 if (UNLIKELY(info.Length() < 3)) {
2961 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get Isolate()); 2965 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get Isolate());
2962 return; 2966 return;
2963 } 2967 }
2964 TestObj* imp = V8TestObject::toNative(info.Holder()); 2968 TestObj* imp = V8TestObject::toNative(info.Holder());
2965 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); 2969 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2966 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); 2970 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2967 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[2])) : 0); 2971 if (info.Length() <= 2 || !info[2]->IsFunction()) {
2968 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg)); 2972 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", "The callback provided as parameter 3 is not a function."), info.G etIsolate());
2973 return;
2974 }
2975 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C ast(info[2]), getExecutionContext());
2976 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg.re lease()));
2969 } 2977 }
2970 2978
2971 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 2979 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
2972 { 2980 {
2973 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 2981 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2974 TestObjV8Internal::longMethodWithArgsMethod(info); 2982 TestObjV8Internal::longMethodWithArgsMethod(info);
2975 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2983 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2976 } 2984 }
2977 2985
2978 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 2986 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 12 matching lines...) Expand all
2991 2999
2992 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 3000 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
2993 { 3001 {
2994 if (UNLIKELY(info.Length() < 3)) { 3002 if (UNLIKELY(info.Length() < 3)) {
2995 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", " TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI solate()); 3003 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", " TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI solate());
2996 return; 3004 return;
2997 } 3005 }
2998 TestObj* imp = V8TestObject::toNative(info.Holder()); 3006 TestObj* imp = V8TestObject::toNative(info.Holder());
2999 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); 3007 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
3000 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); 3008 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
3001 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[2])) : 0); 3009 if (info.Length() <= 2 || !info[2]->IsFunction()) {
3002 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg)); 3010 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", " TestObject", "The callback provided as parameter 3 is not a function."), info.Ge tIsolate());
3011 return;
3012 }
3013 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C ast(info[2]), getExecutionContext());
3014 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg.releas e()));
3003 } 3015 }
3004 3016
3005 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 3017 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
3006 { 3018 {
3007 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3019 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3008 TestObjV8Internal::objMethodWithArgsMethod(info); 3020 TestObjV8Internal::objMethodWithArgsMethod(info);
3009 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3021 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3010 } 3022 }
3011 3023
3012 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& info) 3024 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& info) 3083 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& info)
3072 { 3084 {
3073 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); 3085 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate());
3074 if (UNLIKELY(info.Length() < 2)) { 3086 if (UNLIKELY(info.Length() < 2)) {
3075 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 3087 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
3076 exceptionState.throwIfNeeded(); 3088 exceptionState.throwIfNeeded();
3077 return; 3089 return;
3078 } 3090 }
3079 TestObj* imp = V8TestObject::toNative(info.Holder()); 3091 TestObj* imp = V8TestObject::toNative(info.Holder());
3080 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); 3092 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3081 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0); 3093 if (info.Length() <= 1 || !info[1]->IsFunction()) {
3082 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, exceptionState); 3094 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll ArgsAndThrows", "TestObject", "The callback provided as parameter 2 is not a fun ction."), info.GetIsolate());
3095 return;
3096 }
3097 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C ast(info[1]), getExecutionContext());
3098 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg.release(), exceptionState);
3083 if (exceptionState.throwIfNeeded()) 3099 if (exceptionState.throwIfNeeded())
3084 return; 3100 return;
3085 v8SetReturnValue(info, result.release()); 3101 v8SetReturnValue(info, result.release());
3086 } 3102 }
3087 3103
3088 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 3104 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
3089 { 3105 {
3090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3091 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); 3107 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info);
3092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3575 imp->methodWithOptionalStringIsNullString(str); 3591 imp->methodWithOptionalStringIsNullString(str);
3576 } 3592 }
3577 3593
3578 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 3594 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info)
3579 { 3595 {
3580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3581 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); 3597 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info);
3582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3583 } 3599 }
3584 3600
3585 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value >& info) 3601 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info)
3586 { 3602 {
3587 if (UNLIKELY(info.Length() < 1)) { 3603 if (UNLIKELY(info.Length() < 1)) {
3588 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg ", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate()); 3604 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt erfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length() )), info.GetIsolate());
3589 return; 3605 return;
3590 } 3606 }
3591 TestObj* imp = V8TestObject::toNative(info.Holder()); 3607 TestObj* imp = V8TestObject::toNative(info.Holder());
3592 if (info.Length() <= 0 || !info[0]->IsFunction()) { 3608 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3593 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg ", "TestObject", "The callback provided as parameter 1 is not a function."), inf o.GetIsolate()); 3609 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt erfaceArg", "TestObject", "The callback provided as parameter 1 is not a functio n."), info.GetIsolate());
3594 return; 3610 return;
3595 } 3611 }
3596 OwnPtr<TestCallback> callback = V8TestCallback::create(v8::Handle<v8::Functi on>::Cast(info[0]), getExecutionContext()); 3612 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
3597 imp->methodWithCallbackArg(callback.release()); 3613 imp->methodWithCallbackInterfaceArg(callbackInterface.release());
3598 } 3614 }
3599 3615
3600 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info) 3616 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info)
3601 { 3617 {
3602 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3618 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3603 TestObjV8Internal::methodWithCallbackArgMethod(info); 3619 TestObjV8Internal::methodWithCallbackInterfaceArgMethod(info);
3604 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3620 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3605 } 3621 }
3606 3622
3607 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& info) 3623 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::Func tionCallbackInfo<v8::Value>& info)
3608 { 3624 {
3609 if (UNLIKELY(info.Length() < 2)) { 3625 if (UNLIKELY(info.Length() < 2)) {
3610 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback ArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info. Length())), info.GetIsolate()); 3626 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback ArgAndCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments (2, info.Length())), info.GetIsolate());
3611 return; 3627 return;
3612 } 3628 }
3613 TestObj* imp = V8TestObject::toNative(info.Holder()); 3629 TestObj* imp = V8TestObject::toNative(info.Holder());
3614 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); 3630 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0]));
3615 if (info.Length() <= 1 || !info[1]->IsFunction()) { 3631 if (info.Length() <= 1 || !info[1]->IsFunction()) {
3616 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback ArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate()); 3632 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback ArgAndCallbackInterfaceArg", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate());
3617 return; 3633 return;
3618 } 3634 }
3619 OwnPtr<TestCallback> callback = V8TestCallback::create(v8::Handle<v8::Functi on>::Cast(info[1]), getExecutionContext()); 3635 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c reate(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext());
3620 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback.release()) ; 3636 imp->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackIn terface.release());
3621 } 3637 }
3622 3638
3623 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) 3639 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3624 { 3640 {
3625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3641 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3626 TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(info); 3642 TestObjV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(inf o);
3627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3643 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3628 } 3644 }
3629 3645
3630 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInf o<v8::Value>& info) 3646 static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCa llbackInfo<v8::Value>& info)
3631 { 3647 {
3632 TestObj* imp = V8TestObject::toNative(info.Holder()); 3648 TestObj* imp = V8TestObject::toNative(info.Holder());
3633 OwnPtr<TestCallback> callback; 3649 OwnPtr<TestCallbackInterface> callbackInterface;
3634 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { 3650 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
3635 if (!info[0]->IsFunction()) { 3651 if (!info[0]->IsFunction()) {
3636 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac kAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a f unction."), info.GetIsolate()); 3652 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac kInterfaceAndOptionalArg", "TestObject", "The callback provided as parameter 1 i s not a function."), info.GetIsolate());
3637 return; 3653 return;
3638 } 3654 }
3639 callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0] ), getExecutionContext()); 3655 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Funct ion>::Cast(info[0]), getExecutionContext());
3640 } 3656 }
3641 imp->methodWithCallbackAndOptionalArg(callback.release()); 3657 imp->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release());
3642 } 3658 }
3643 3659
3644 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal lbackInfo<v8::Value>& info) 3660 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info)
3645 { 3661 {
3646 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3647 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(info); 3663 TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info);
3648 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3649 } 3665 }
3650 3666
3651 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v 8::Value>& info) 3667 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& info)
3652 { 3668 {
3653 if (UNLIKELY(info.Length() < 1)) { 3669 if (UNLIKELY(info.Length() < 1)) {
3654 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal lbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()) ), info.GetIsolate()); 3670 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal lbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info. Length())), info.GetIsolate());
3655 return; 3671 return;
3656 } 3672 }
3657 TestObj* imp = V8TestObject::toNative(info.Holder()); 3673 TestObj* imp = V8TestObject::toNative(info.Holder());
3658 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { 3674 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) {
3659 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal lbackArg", "TestObject", "The callback provided as parameter 1 is not a function ."), info.GetIsolate()); 3675 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal lbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3660 return; 3676 return;
3661 } 3677 }
3662 OwnPtr<TestCallback> callback = info[0]->IsNull() ? nullptr : V8TestCallback ::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); 3678 OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullpt r : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), get ExecutionContext());
3663 imp->methodWithNullableCallbackArg(callback.release()); 3679 imp->methodWithNullableCallbackInterfaceArg(callbackInterface.release());
3664 } 3680 }
3665 3681
3666 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallba ckInfo<v8::Value>& info) 3682 static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info)
3667 { 3683 {
3668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3684 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3669 TestObjV8Internal::methodWithNullableCallbackArgMethod(info); 3685 TestObjV8Internal::methodWithNullableCallbackInterfaceArgMethod(info);
3670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3686 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3671 } 3687 }
3672 3688
3673 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& info) 3689 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& info)
3674 { 3690 {
3675 OwnPtr<TestCallback> callback; 3691 OwnPtr<TestCallbackInterface> callbackInterface;
3676 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { 3692 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
3677 if (!info[0]->IsFunction()) { 3693 if (!info[0]->IsFunction()) {
3678 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n ot a function."), info.GetIsolate()); 3694 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n ot a function."), info.GetIsolate());
3679 return; 3695 return;
3680 } 3696 }
3681 callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0] ), getExecutionContext()); 3697 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Funct ion>::Cast(info[0]), getExecutionContext());
3682 } 3698 }
3683 TestObj::staticMethodWithCallbackAndOptionalArg(callback.release()); 3699 TestObj::staticMethodWithCallbackAndOptionalArg(callbackInterface.release()) ;
3684 } 3700 }
3685 3701
3686 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) 3702 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info)
3687 { 3703 {
3688 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3704 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3689 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); 3705 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info);
3690 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3706 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3691 } 3707 }
3692 3708
3693 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 3709 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
3694 { 3710 {
3695 if (UNLIKELY(info.Length() < 1)) { 3711 if (UNLIKELY(info.Length() < 1)) {
3696 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); 3712 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3697 return; 3713 return;
3698 } 3714 }
3699 if (info.Length() <= 0 || !info[0]->IsFunction()) { 3715 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3700 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb ackArg", "TestObject", "The callback provided as parameter 1 is not a function." ), info.GetIsolate()); 3716 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb ackArg", "TestObject", "The callback provided as parameter 1 is not a function." ), info.GetIsolate());
3701 return; 3717 return;
3702 } 3718 }
3703 OwnPtr<TestCallback> callback = V8TestCallback::create(v8::Handle<v8::Functi on>::Cast(info[0]), getExecutionContext()); 3719 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
3704 TestObj::staticMethodWithCallbackArg(callback.release()); 3720 TestObj::staticMethodWithCallbackArg(callbackInterface.release());
3705 } 3721 }
3706 3722
3707 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 3723 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
3708 { 3724 {
3709 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3725 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3710 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); 3726 TestObjV8Internal::staticMethodWithCallbackArgMethod(info);
3711 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3727 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3712 } 3728 }
3713 3729
3714 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8:: Value>& info) 3730 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8:: Value>& info)
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
3952 { 3968 {
3953 if (UNLIKELY(info.Length() < 1)) { 3969 if (UNLIKELY(info.Length() < 1)) {
3954 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate()); 3970 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate());
3955 return; 3971 return;
3956 } 3972 }
3957 TestObj* imp = V8TestObject::toNative(info.Holder()); 3973 TestObj* imp = V8TestObject::toNative(info.Holder());
3958 if (info.Length() <= 0 || !info[0]->IsFunction()) { 3974 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3959 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", "The callback provided as parameter 1 is not a function."), info.Get Isolate()); 3975 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", "The callback provided as parameter 1 is not a function."), info.Get Isolate());
3960 return; 3976 return;
3961 } 3977 }
3962 OwnPtr<TestCallback> callbackArg = V8TestCallback::create(v8::Handle<v8::Fun ction>::Cast(info[0]), getExecutionContext()); 3978 OwnPtr<TestCallbackInterface> callbackInterfaceArg = V8TestCallbackInterface ::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
3963 imp->overloadedMethod(callbackArg.release()); 3979 imp->overloadedMethod(callbackInterfaceArg.release());
3964 } 3980 }
3965 3981
3966 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 3982 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
3967 { 3983 {
3968 if (UNLIKELY(info.Length() < 1)) { 3984 if (UNLIKELY(info.Length() < 1)) {
3969 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate()); 3985 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate());
3970 return; 3986 return;
3971 } 3987 }
3972 TestObj* imp = V8TestObject::toNative(info.Holder()); 3988 TestObj* imp = V8TestObject::toNative(info.Holder());
3973 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[0])) : 0); 3989 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3974 imp->overloadedMethod(objArg); 3990 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", "The callback provided as parameter 1 is not a function."), info.Get Isolate());
3991 return;
3992 }
3993 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C ast(info[0]), getExecutionContext());
3994 imp->overloadedMethod(objArg.release());
3975 } 3995 }
3976 3996
3977 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 3997 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
3978 { 3998 {
3979 if (UNLIKELY(info.Length() < 1)) { 3999 if (UNLIKELY(info.Length() < 1)) {
3980 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate()); 4000 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate());
3981 return; 4001 return;
3982 } 4002 }
3983 TestObj* imp = V8TestObject::toNative(info.Holder()); 4003 TestObj* imp = V8TestObject::toNative(info.Holder());
3984 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate())); 4004 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
(...skipping 15 matching lines...) Expand all
4000 { 4020 {
4001 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethod", "TestObject", info.Holder(), info.GetIsolate()); 4021 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethod", "TestObject", info.Holder(), info.GetIsolate());
4002 if (((info.Length() == 1))) { 4022 if (((info.Length() == 1))) {
4003 overloadedMethod1Method(info); 4023 overloadedMethod1Method(info);
4004 return; 4024 return;
4005 } 4025 }
4006 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction()))) { 4026 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction()))) {
4007 overloadedMethod2Method(info); 4027 overloadedMethod2Method(info);
4008 return; 4028 return;
4009 } 4029 }
4010 if (((info.Length() == 1) && (V8TestObject::hasInstance(info[0], info.GetIso late(), worldType(info.GetIsolate()))))) { 4030 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction()))) {
4011 overloadedMethod3Method(info); 4031 overloadedMethod3Method(info);
4012 return; 4032 return;
4013 } 4033 }
4014 if (((info.Length() == 1) && (info[0]->IsArray()))) { 4034 if (((info.Length() == 1) && (info[0]->IsArray()))) {
4015 overloadedMethod4Method(info); 4035 overloadedMethod4Method(info);
4016 return; 4036 return;
4017 } 4037 }
4018 if (((info.Length() == 1) && (info[0]->IsArray()))) { 4038 if (((info.Length() == 1) && (info[0]->IsArray()))) {
4019 overloadedMethod5Method(info); 4039 overloadedMethod5Method(info);
4020 return; 4040 return;
(...skipping 14 matching lines...) Expand all
4035 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4055 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4036 } 4056 }
4037 4057
4038 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4058 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4039 { 4059 {
4040 if (UNLIKELY(info.Length() < 1)) { 4060 if (UNLIKELY(info.Length() < 1)) {
4041 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI solate()); 4061 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI solate());
4042 return; 4062 return;
4043 } 4063 }
4044 TestObj* imp = V8TestObject::toNative(info.Holder()); 4064 TestObj* imp = V8TestObject::toNative(info.Holder());
4045 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[0])) : 0); 4065 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) {
4066 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", "The callback provided as parameter 1 is not a function."), info.Ge tIsolate());
4067 return;
4068 }
4069 OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::crea te(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
4046 if (UNLIKELY(info.Length() <= 1)) { 4070 if (UNLIKELY(info.Length() <= 1)) {
4047 imp->overloadedMethodA(objArg); 4071 imp->overloadedMethodA(objArg.release());
4048 return; 4072 return;
4049 } 4073 }
4050 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); 4074 V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4051 imp->overloadedMethodA(objArg, longArg); 4075 imp->overloadedMethodA(objArg.release(), longArg);
4052 } 4076 }
4053 4077
4054 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4078 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4055 { 4079 {
4056 if (UNLIKELY(info.Length() < 2)) { 4080 if (UNLIKELY(info.Length() < 2)) {
4057 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI solate()); 4081 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI solate());
4058 return; 4082 return;
4059 } 4083 }
4060 TestObj* imp = V8TestObject::toNative(info.Holder()); 4084 TestObj* imp = V8TestObject::toNative(info.Holder());
4061 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[0])) : 0); 4085 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) {
4086 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", "The callback provided as parameter 1 is not a function."), info.Ge tIsolate());
4087 return;
4088 }
4089 OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::crea te(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
4062 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); 4090 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
4063 imp->overloadedMethodA(objArg, strArg); 4091 imp->overloadedMethodA(objArg.release(), strArg);
4064 } 4092 }
4065 4093
4066 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4094 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4067 { 4095 {
4068 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodA", "TestObject", info.Holder(), info.GetIsolate()); 4096 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodA", "TestObject", info.Holder(), info.GetIsolate());
4069 if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance (info[0], info.GetIsolate(), worldType(info.GetIsolate())))) || ((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolat e(), worldType(info.GetIsolate()))))) { 4097 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction())) | | ((info.Length() == 2) && (info[0]->IsNull() || info[0]->IsFunction()))) {
4070 overloadedMethodA1Method(info); 4098 overloadedMethodA1Method(info);
4071 return; 4099 return;
4072 } 4100 }
4073 if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance (info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) { 4101 if (((info.Length() == 2) && (info[0]->IsNull() || info[0]->IsFunction()))) {
4074 overloadedMethodA2Method(info); 4102 overloadedMethodA2Method(info);
4075 return; 4103 return;
4076 } 4104 }
4077 if (UNLIKELY(info.Length() < 1)) { 4105 if (UNLIKELY(info.Length() < 1)) {
4078 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 4106 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4079 exceptionState.throwIfNeeded(); 4107 exceptionState.throwIfNeeded();
4080 return; 4108 return;
4081 } 4109 }
4082 exceptionState.throwTypeError("No function was found that matched the signat ure provided."); 4110 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4083 exceptionState.throwIfNeeded(); 4111 exceptionState.throwIfNeeded();
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
4546 if (UNLIKELY(info.Length() < 3)) { 4574 if (UNLIKELY(info.Length() < 3)) {
4547 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate()); 4575 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
4548 return; 4576 return;
4549 } 4577 }
4550 TestObj* imp = V8TestObject::toNative(info.Holder()); 4578 TestObj* imp = V8TestObject::toNative(info.Holder());
4551 bool strIsNull = info[0]->IsNull(); 4579 bool strIsNull = info[0]->IsNull();
4552 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource, info[0]); 4580 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource, info[0]);
4553 String str = strStringResource; 4581 String str = strStringResource;
4554 bool lIsNull = info[1]->IsNull(); 4582 bool lIsNull = info[1]->IsNull();
4555 V8TRYCATCH_VOID(int, l, toInt32(info[1])); 4583 V8TRYCATCH_VOID(int, l, toInt32(info[1]));
4556 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::hasInstance(info[2], info.GetIs olate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::O bject>::Cast(info[2])) : 0); 4584 if (info.Length() <= 2 || !(info[2]->IsFunction() || info[2]->IsNull())) {
4585 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg uments", "TestObject", "The callback provided as parameter 3 is not a function." ), info.GetIsolate());
4586 return;
4587 }
4588 OwnPtr<TestObject> obj = info[2]->IsNull() ? nullptr : V8TestObject::create( v8::Handle<v8::Function>::Cast(info[2]), getExecutionContext());
4557 if (UNLIKELY(info.Length() <= 3)) { 4589 if (UNLIKELY(info.Length() <= 3)) {
4558 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj); 4590 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj.release());
4559 return; 4591 return;
4560 } 4592 }
4561 bool dIsNull = info[3]->IsNull(); 4593 bool dIsNull = info[3]->IsNull();
4562 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); 4594 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue()));
4563 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj , dIsNull ? 0 : &d); 4595 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj .release(), dIsNull ? 0 : &d);
4564 } 4596 }
4565 4597
4566 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 4598 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
4567 { 4599 {
4568 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4600 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4569 TestObjV8Internal::methodWithNullableArgumentsMethod(info); 4601 TestObjV8Internal::methodWithNullableArgumentsMethod(info);
4570 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4602 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4571 } 4603 }
4572 4604
4573 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info ) 4605 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info )
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
4946 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 4978 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
4947 { 4979 {
4948 if (UNLIKELY(info.Length() < 1)) { 4980 if (UNLIKELY(info.Length() < 1)) {
4949 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate ()); 4981 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate ());
4950 return; 4982 return;
4951 } 4983 }
4952 if (info.Length() <= 0 || !info[0]->IsFunction()) { 4984 if (info.Length() <= 0 || !info[0]->IsFunction()) {
4953 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb ject", "The callback provided as parameter 1 is not a function."), info.GetIsola te()); 4985 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb ject", "The callback provided as parameter 1 is not a function."), info.GetIsola te());
4954 return; 4986 return;
4955 } 4987 }
4956 OwnPtr<TestCallback> testCallback = V8TestCallback::create(v8::Handle<v8::Fu nction>::Cast(info[0]), getExecutionContext()); 4988 OwnPtr<TestCallbackInterface> testCallbackInterface = V8TestCallbackInterfac e::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
4957 RefPtr<TestObj> impl = TestObj::create(testCallback); 4989 RefPtr<TestObj> impl = TestObj::create(testCallbackInterface);
4958 v8::Handle<v8::Object> wrapper = info.Holder(); 4990 v8::Handle<v8::Object> wrapper = info.Holder();
4959 4991
4960 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te stObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep endent); 4992 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te stObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep endent);
4961 v8SetReturnValue(info, wrapper); 4993 v8SetReturnValue(info, wrapper);
4962 } 4994 }
4963 4995
4964 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 4996 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
4965 { 4997 {
4966 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); 4998 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4967 TestObj* collection = V8TestObject::toNative(info.Holder()); 4999 TestObj* collection = V8TestObject::toNative(info.Holder());
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
5150 {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8In ternal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl> (v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */ }, 5182 {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8In ternal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl> (v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */ },
5151 {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeG etterCallback, TestObjV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */}, 5183 {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeG etterCallback, TestObjV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */},
5152 }; 5184 };
5153 5185
5154 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { 5186 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = {
5155 {"attrWithJSGetterAndSetter", TestObjV8Internal::attrWithJSGetterAndSetterAt tributeGetterCallback, TestObjV8Internal::attrWithJSGetterAndSetterAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None)}, 5187 {"attrWithJSGetterAndSetter", TestObjV8Internal::attrWithJSGetterAndSetterAt tributeGetterCallback, TestObjV8Internal::attrWithJSGetterAndSetterAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None)},
5156 }; 5188 };
5157 5189
5158 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { 5190 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
5159 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, 5191 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0},
5192 {"voidMethodWithArgs", TestObjV8Internal::voidMethodWithArgsMethodCallback, 0, 3},
5160 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, 5193 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0},
5194 {"longMethodWithArgs", TestObjV8Internal::longMethodWithArgsMethodCallback, 0, 3},
5161 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0}, 5195 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0},
5196 {"objMethodWithArgs", TestObjV8Internal::objMethodWithArgsMethodCallback, 0, 3},
5162 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCall back, 0, 1}, 5197 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCall back, 0, 1},
5163 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod Callback, 0, 1}, 5198 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod Callback, 0, 1},
5164 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0, 1}, 5199 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0, 1},
5200 {"methodThatRequiresAllArgsAndThrows", TestObjV8Internal::methodThatRequires AllArgsAndThrowsMethodCallback, 0, 2},
5165 {"methodQueryListListener", TestObjV8Internal::methodQueryListListenerMethod Callback, 0, 1}, 5201 {"methodQueryListListener", TestObjV8Internal::methodQueryListListenerMethod Callback, 0, 1},
5166 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1}, 5202 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1},
5167 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1}, 5203 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1},
5168 {"optionsObjectList", TestObjV8Internal::optionsObjectListMethodCallback, 0, 1}, 5204 {"optionsObjectList", TestObjV8Internal::optionsObjectListMethodCallback, 0, 1},
5169 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback , 0, 0}, 5205 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback , 0, 0},
5170 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0}, 5206 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0},
5171 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba ck, 0, 3}, 5207 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba ck, 0, 3},
5172 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2 }, 5208 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2 },
5173 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback , 0, 2}, 5209 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback , 0, 2},
5174 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback , 0, 0}, 5210 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback , 0, 0},
5175 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback, 0, 0}, 5211 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback, 0, 0},
5176 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep tionMethodCallback, 0, 0}, 5212 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep tionMethodCallback, 0, 0},
5177 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti onMethodCallback, 0, 0}, 5213 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti onMethodCallback, 0, 0},
5178 {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallba ck, 0, 0}, 5214 {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallba ck, 0, 0},
5179 {"withExecutionContextAndScriptState", TestObjV8Internal::withExecutionConte xtAndScriptStateMethodCallback, 0, 0}, 5215 {"withExecutionContextAndScriptState", TestObjV8Internal::withExecutionConte xtAndScriptStateMethodCallback, 0, 0},
5180 {"withExecutionContextAndScriptStateObjException", TestObjV8Internal::withEx ecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0}, 5216 {"withExecutionContextAndScriptStateObjException", TestObjV8Internal::withEx ecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0},
5181 {"withExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::withExec utionContextAndScriptStateWithSpacesMethodCallback, 0, 0}, 5217 {"withExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::withExec utionContextAndScriptStateWithSpacesMethodCallback, 0, 0},
5182 {"withActiveWindowAndFirstWindow", TestObjV8Internal::withActiveWindowAndFir stWindowMethodCallback, 0, 0}, 5218 {"withActiveWindowAndFirstWindow", TestObjV8Internal::withActiveWindowAndFir stWindowMethodCallback, 0, 0},
5183 {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCall back, 0, 0}, 5219 {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCall back, 0, 0},
5184 {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonO ptionalArgAndOptionalArgMethodCallback, 0, 1}, 5220 {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonO ptionalArgAndOptionalArgMethodCallback, 0, 1},
5185 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWith NonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1}, 5221 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWith NonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1},
5186 {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMeth odCallback, 0, 0}, 5222 {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMeth odCallback, 0, 0},
5187 {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptiona lStringIsUndefinedMethodCallback, 0, 0}, 5223 {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptiona lStringIsUndefinedMethodCallback, 0, 0},
5188 {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOption alStringIsNullStringMethodCallback, 0, 0}, 5224 {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOption alStringIsNullStringMethodCallback, 0, 0},
5189 {"methodWithCallbackArg", TestObjV8Internal::methodWithCallbackArgMethodCall back, 0, 1}, 5225 {"methodWithCallbackInterfaceArg", TestObjV8Internal::methodWithCallbackInte rfaceArgMethodCallback, 0, 1},
5190 {"methodWithNonCallbackArgAndCallbackArg", TestObjV8Internal::methodWithNonC allbackArgAndCallbackArgMethodCallback, 0, 2}, 5226 {"methodWithNonCallbackArgAndCallbackInterfaceArg", TestObjV8Internal::metho dWithNonCallbackArgAndCallbackInterfaceArgMethodCallback, 0, 2},
5191 {"methodWithCallbackAndOptionalArg", TestObjV8Internal::methodWithCallbackAn dOptionalArgMethodCallback, 0, 0}, 5227 {"methodWithCallbackInterfaceAndOptionalArg", TestObjV8Internal::methodWithC allbackInterfaceAndOptionalArgMethodCallback, 0, 0},
5192 {"methodWithNullableCallbackArg", TestObjV8Internal::methodWithNullableCallb ackArgMethodCallback, 0, 1}, 5228 {"methodWithNullableCallbackInterfaceArg", TestObjV8Internal::methodWithNull ableCallbackInterfaceArgMethodCallback, 0, 1},
5193 {"methodWithEnforceRangeInt8", TestObjV8Internal::methodWithEnforceRangeInt8 MethodCallback, 0, 1}, 5229 {"methodWithEnforceRangeInt8", TestObjV8Internal::methodWithEnforceRangeInt8 MethodCallback, 0, 1},
5194 {"methodWithEnforceRangeUInt8", TestObjV8Internal::methodWithEnforceRangeUIn t8MethodCallback, 0, 1}, 5230 {"methodWithEnforceRangeUInt8", TestObjV8Internal::methodWithEnforceRangeUIn t8MethodCallback, 0, 1},
5195 {"methodWithEnforceRangeInt16", TestObjV8Internal::methodWithEnforceRangeInt 16MethodCallback, 0, 1}, 5231 {"methodWithEnforceRangeInt16", TestObjV8Internal::methodWithEnforceRangeInt 16MethodCallback, 0, 1},
5196 {"methodWithEnforceRangeUInt16", TestObjV8Internal::methodWithEnforceRangeUI nt16MethodCallback, 0, 1}, 5232 {"methodWithEnforceRangeUInt16", TestObjV8Internal::methodWithEnforceRangeUI nt16MethodCallback, 0, 1},
5197 {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt 32MethodCallback, 0, 1}, 5233 {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt 32MethodCallback, 0, 1},
5198 {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUI nt32MethodCallback, 0, 1}, 5234 {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUI nt32MethodCallback, 0, 1},
5199 {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt 64MethodCallback, 0, 1}, 5235 {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt 64MethodCallback, 0, 1},
5200 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI nt64MethodCallback, 0, 1}, 5236 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI nt64MethodCallback, 0, 1},
5201 #if ENABLE(Condition1) 5237 #if ENABLE(Condition1)
5202 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0}, 5238 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0},
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
5268 {"enabledAtRuntimeAttr", TestObjV8Internal::enabledAtRuntimeAttrAttribut eGetterCallback, TestObjV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA ttribute>(v8::None), 0 /* on instance */}; 5304 {"enabledAtRuntimeAttr", TestObjV8Internal::enabledAtRuntimeAttrAttribut eGetterCallback, TestObjV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA ttribute>(v8::None), 0 /* on instance */};
5269 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate, currentWorldType); 5305 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate, currentWorldType);
5270 } 5306 }
5271 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants [] = { 5307 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants [] = {
5272 {"DEPRECATED_CONSTANT", 1}, 5308 {"DEPRECATED_CONSTANT", 1},
5273 }; 5309 };
5274 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate); 5310 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate);
5275 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECAT ED_CONSTANTDoesntMatchWithImplementation); 5311 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECAT ED_CONSTANTDoesntMatchWithImplementation);
5276 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Int ernal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj >); 5312 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Int ernal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj >);
5277 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Inter nal::namedPropertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallba ck, 0, TestObjV8Internal::namedPropertyEnumeratorCallback); 5313 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Inter nal::namedPropertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallba ck, 0, TestObjV8Internal::namedPropertyEnumeratorCallback);
5278
5279 // Custom Signature 'voidMethodWithArgs'
5280 const int voidMethodWithArgsArgc = 3;
5281 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsAr gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5282 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(i solate, functionTemplate, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
5283 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodWithArgs" , v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8 Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMethodWithArgsSig nature, 3));
5284
5285 // Custom Signature 'longMethodWithArgs'
5286 const int longMethodWithArgsArgc = 3;
5287 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsAr gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5288 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(i solate, functionTemplate, longMethodWithArgsArgc, longMethodWithArgsArgv);
5289 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "longMethodWithArgs" , v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8 Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMethodWithArgsSig nature, 3));
5290
5291 // Custom Signature 'objMethodWithArgs'
5292 const int objMethodWithArgsArgc = 3;
5293 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc ] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8 PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, cu rrentWorldType) };
5294 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(is olate, functionTemplate, objMethodWithArgsArgc, objMethodWithArgsArgv);
5295 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "objMethodWithArgs", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8I nternal::objMethodWithArgsMethodCallback, v8Undefined(), objMethodWithArgsSignat ure, 3));
5296
5297 // Custom Signature 'methodThatRequiresAllArgsAndThrows'
5298 const int methodThatRequiresAllArgsAndThrowsArgc = 2;
5299 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[meth odThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8Pe rIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, curr entWorldType) };
5300 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8:: Signature::New(isolate, functionTemplate, methodThatRequiresAllArgsAndThrowsArgc , methodThatRequiresAllArgsAndThrowsArgv);
5301 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "methodThatRequiresA llArgsAndThrows", v8::String::kInternalizedString), v8::FunctionTemplate::New(is olate, TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, v8Un defined(), methodThatRequiresAllArgsAndThrowsSignature, 2));
5302 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCall backAndOptionalArg", v8::String::kInternalizedString), v8::FunctionTemplate::New (isolate, TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallbac k, v8Undefined(), v8::Local<v8::Signature>(), 0)); 5314 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCall backAndOptionalArg", v8::String::kInternalizedString), v8::FunctionTemplate::New (isolate, TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallbac k, v8Undefined(), v8::Local<v8::Signature>(), 0));
5303 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCall backArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, T estObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8:: Local<v8::Signature>(), 1)); 5315 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCall backArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, T estObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8:: Local<v8::Signature>(), 1));
5304 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod", v8::St ring::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal ::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); 5316 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod", v8::St ring::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal ::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5305 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethodWithOptio nal", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestO bjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8 ::Signature>(), 0)); 5317 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethodWithOptio nal", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestO bjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8 ::Signature>(), 0));
5306 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod2", v8::S tring::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Interna l::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1)); 5318 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod2", v8::S tring::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Interna l::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5307 if (RuntimeEnabledFeatures::featureNameEnabled()) 5319 if (RuntimeEnabledFeatures::featureNameEnabled())
5308 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "enabledAtRuntim eMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, T estObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSi gnature, 1)); 5320 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "enabledAtRuntim eMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, T estObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSi gnature, 1));
5309 5321
5310 // Custom Signature 'domStringListFunction' 5322 // Custom Signature 'domStringListFunction'
5311 const int domStringListFunctionArgc = 1; 5323 const int domStringListFunctionArgc = 1;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
5424 fromInternalPointer(object)->deref(); 5436 fromInternalPointer(object)->deref();
5425 } 5437 }
5426 5438
5427 template<> 5439 template<>
5428 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 5440 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
5429 { 5441 {
5430 return toV8(impl, creationContext, isolate); 5442 return toV8(impl, creationContext, isolate);
5431 } 5443 }
5432 5444
5433 } // namespace WebCore 5445 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestTypedefs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698