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

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

Issue 36843003: Improve remaining TypeErrors in bindings code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: vibration. Created 7 years, 1 month 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "bindings/v8/V8Binding.h" 61 #include "bindings/v8/V8Binding.h"
62 #include "bindings/v8/V8DOMActivityLogger.h" 62 #include "bindings/v8/V8DOMActivityLogger.h"
63 #include "bindings/v8/V8DOMConfiguration.h" 63 #include "bindings/v8/V8DOMConfiguration.h"
64 #include "bindings/v8/V8DOMWrapper.h" 64 #include "bindings/v8/V8DOMWrapper.h"
65 #include "bindings/v8/V8EventListenerList.h" 65 #include "bindings/v8/V8EventListenerList.h"
66 #include "bindings/v8/V8HiddenPropertyName.h" 66 #include "bindings/v8/V8HiddenPropertyName.h"
67 #include "bindings/v8/V8ObjectConstructor.h" 67 #include "bindings/v8/V8ObjectConstructor.h"
68 #include "bindings/v8/custom/V8Float32ArrayCustom.h" 68 #include "bindings/v8/custom/V8Float32ArrayCustom.h"
69 #include "core/dom/ContextFeatures.h" 69 #include "core/dom/ContextFeatures.h"
70 #include "core/dom/Document.h" 70 #include "core/dom/Document.h"
71 #include "core/dom/ExceptionCode.h"
72 #include "core/dom/custom/CustomElementCallbackDispatcher.h" 71 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
73 #include "core/frame/DOMWindow.h" 72 #include "core/frame/DOMWindow.h"
74 #include "core/frame/UseCounter.h" 73 #include "core/frame/UseCounter.h"
75 #include "core/svg/properties/SVGPropertyTearOff.h" 74 #include "core/svg/properties/SVGPropertyTearOff.h"
76 #include "core/svg/properties/SVGStaticPropertyTearOff.h" 75 #include "core/svg/properties/SVGStaticPropertyTearOff.h"
77 #include "platform/TraceEvent.h" 76 #include "platform/TraceEvent.h"
78 #include "wtf/GetPtr.h" 77 #include "wtf/GetPtr.h"
79 #include "wtf/RefPtr.h" 78 #include "wtf/RefPtr.h"
80 #include "wtf/UnusedParam.h" 79 #include "wtf/UnusedParam.h"
81 80
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1871 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1873 TestObjV8Internal::mutablePointAttributeGetter(info); 1872 TestObjV8Internal::mutablePointAttributeGetter(info);
1874 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1873 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1875 } 1874 }
1876 1875
1877 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8:: PropertyCallbackInfo<void>& info) 1876 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8:: PropertyCallbackInfo<void>& info)
1878 { 1877 {
1879 TestObj* imp = V8TestObject::toNative(info.Holder()); 1878 TestObj* imp = V8TestObject::toNative(info.Holder());
1880 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); 1879 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1881 if (!WTF::getPtr(cppValue)) { 1880 if (!WTF::getPtr(cppValue)) {
1882 throwUninformativeAndGenericTypeError(info.GetIsolate()); 1881 throwTypeError(ExceptionMessages::failedToSet("mutablePoint", "TestObjec t", "The provided value is not of type 'SVGPoint'."), info.GetIsolate());
1883 return; 1882 return;
1884 } 1883 }
1885 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); 1884 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference());
1886 } 1885 }
1887 1886
1888 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local <v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1887 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local <v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1889 { 1888 {
1890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1889 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1891 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info); 1890 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info);
1892 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1891 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 10 matching lines...) Expand all
1903 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1902 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1904 TestObjV8Internal::immutablePointAttributeGetter(info); 1903 TestObjV8Internal::immutablePointAttributeGetter(info);
1905 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1904 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1906 } 1905 }
1907 1906
1908 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8 ::PropertyCallbackInfo<void>& info) 1907 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8 ::PropertyCallbackInfo<void>& info)
1909 { 1908 {
1910 TestObj* imp = V8TestObject::toNative(info.Holder()); 1909 TestObj* imp = V8TestObject::toNative(info.Holder());
1911 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); 1910 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1912 if (!WTF::getPtr(cppValue)) { 1911 if (!WTF::getPtr(cppValue)) {
1913 throwUninformativeAndGenericTypeError(info.GetIsolate()); 1912 throwTypeError(ExceptionMessages::failedToSet("immutablePoint", "TestObj ect", "The provided value is not of type 'SVGPoint'."), info.GetIsolate());
1914 return; 1913 return;
1915 } 1914 }
1916 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); 1915 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference());
1917 } 1916 }
1918 1917
1919 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1918 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1920 { 1919 {
1921 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1920 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1922 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info); 1921 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info);
1923 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1922 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3932 return; 3931 return;
3933 } 3932 }
3934 if (((info.Length() == 1) && (info[0]->IsArray()))) { 3933 if (((info.Length() == 1) && (info[0]->IsArray()))) {
3935 overloadedMethod5Method(info); 3934 overloadedMethod5Method(info);
3936 return; 3935 return;
3937 } 3936 }
3938 if (UNLIKELY(info.Length() < 1)) { 3937 if (UNLIKELY(info.Length() < 1)) {
3939 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate()); 3938 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs olate());
3940 return; 3939 return;
3941 } 3940 }
3942 throwUninformativeAndGenericTypeError(info.GetIsolate()); 3941 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestO bject", "No function was found that matched the signature provided."), info.GetI solate());
3943 } 3942 }
3944 3943
3945 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 3944 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
3946 { 3945 {
3947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3946 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3948 TestObjV8Internal::overloadedMethodMethod(info); 3947 TestObjV8Internal::overloadedMethodMethod(info);
3949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3948 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3950 } 3949 }
3951 3950
3952 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 3951 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3984 return; 3983 return;
3985 } 3984 }
3986 if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance (info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) { 3985 if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance (info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
3987 overloadedMethodA2Method(info); 3986 overloadedMethodA2Method(info);
3988 return; 3987 return;
3989 } 3988 }
3990 if (UNLIKELY(info.Length() < 1)) { 3989 if (UNLIKELY(info.Length() < 1)) {
3991 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI solate()); 3990 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI solate());
3992 return; 3991 return;
3993 } 3992 }
3994 throwUninformativeAndGenericTypeError(info.GetIsolate()); 3993 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "Test Object", "No function was found that matched the signature provided."), info.Get Isolate());
3995 } 3994 }
3996 3995
3997 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 3996 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
3998 { 3997 {
3999 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3998 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4000 TestObjV8Internal::overloadedMethodAMethod(info); 3999 TestObjV8Internal::overloadedMethodAMethod(info);
4001 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4000 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4002 } 4001 }
4003 4002
4004 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4003 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 25 matching lines...) Expand all
4030 return; 4029 return;
4031 } 4030 }
4032 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsUndefined() || info[0]->IsString() || info[0]->IsObject()))) { 4031 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsUndefined() || info[0]->IsString() || info[0]->IsObject()))) {
4033 overloadedMethodB2Method(info); 4032 overloadedMethodB2Method(info);
4034 return; 4033 return;
4035 } 4034 }
4036 if (UNLIKELY(info.Length() < 1)) { 4035 if (UNLIKELY(info.Length() < 1)) {
4037 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", " TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI solate()); 4036 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", " TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI solate());
4038 return; 4037 return;
4039 } 4038 }
4040 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4039 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "Test Object", "No function was found that matched the signature provided."), info.Get Isolate());
4041 } 4040 }
4042 4041
4043 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4042 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4044 { 4043 {
4045 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4044 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4046 TestObjV8Internal::overloadedMethodBMethod(info); 4045 TestObjV8Internal::overloadedMethodBMethod(info);
4047 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4046 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4048 } 4047 }
4049 4048
4050 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4049 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
4293 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info ) 4292 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info )
4294 { 4293 {
4295 if (UNLIKELY(info.Length() < 2)) { 4294 if (UNLIKELY(info.Length() < 2)) {
4296 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol ate()); 4295 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol ate());
4297 return; 4296 return;
4298 } 4297 }
4299 TestObj* imp = V8TestObject::toNative(info.Holder()); 4298 TestObj* imp = V8TestObject::toNative(info.Holder());
4300 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); 4299 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);
4301 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); 4300 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4302 if (!item) { 4301 if (!item) {
4303 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4302 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes tObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4304 return; 4303 return;
4305 } 4304 }
4306 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp- >svgPointMethod(item->propertyReference(), index)))); 4305 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp- >svgPointMethod(item->propertyReference(), index))));
4307 } 4306 }
4308 4307
4309 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info) 4308 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
4310 { 4309 {
4311 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4310 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4312 TestObjV8Internal::svgPointMethodMethod(info); 4311 TestObjV8Internal::svgPointMethodMethod(info);
4313 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4312 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4314 } 4313 }
4315 4314
4316 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info) 4315 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)
4317 { 4316 {
4318 if (UNLIKELY(info.Length() < 2)) { 4317 if (UNLIKELY(info.Length() < 2)) {
4319 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G etIsolate()); 4318 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G etIsolate());
4320 return; 4319 return;
4321 } 4320 }
4322 TestObj* imp = V8TestObject::toNative(info.Holder()); 4321 TestObj* imp = V8TestObject::toNative(info.Holder());
4323 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 4322 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4324 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { 4323 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
4325 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); 4324 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4326 return; 4325 return;
4327 } 4326 }
4328 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); 4327 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);
4329 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); 4328 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4330 if (!item) { 4329 if (!item) {
4331 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4330 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4332 return; 4331 return;
4333 } 4332 }
4334 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index , exceptionState); 4333 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index , exceptionState);
4335 if (exceptionState.throwIfNeeded()) 4334 if (exceptionState.throwIfNeeded())
4336 return; 4335 return;
4337 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu lt))); 4336 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu lt)));
4338 } 4337 }
4339 4338
4340 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info) 4339 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info)
4341 { 4340 {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
4541 return; 4540 return;
4542 } 4541 }
4543 if (((info.Length() == 2))) { 4542 if (((info.Length() == 2))) {
4544 overloadedPerWorldMethod2Method(info); 4543 overloadedPerWorldMethod2Method(info);
4545 return; 4544 return;
4546 } 4545 }
4547 if (UNLIKELY(info.Length() < 1)) { 4546 if (UNLIKELY(info.Length() < 1)) {
4548 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in fo.GetIsolate()); 4547 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in fo.GetIsolate());
4549 return; 4548 return;
4550 } 4549 }
4551 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4550 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod" , "TestObject", "No function was found that matched the signature provided."), i nfo.GetIsolate());
4552 } 4551 }
4553 4552
4554 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& info) 4553 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
4555 { 4554 {
4556 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4555 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4557 TestObjV8Internal::overloadedPerWorldMethodMethod(info); 4556 TestObjV8Internal::overloadedPerWorldMethodMethod(info);
4558 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4559 } 4558 }
4560 4559
4561 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba ckInfo<v8::Value>& info) 4560 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba ckInfo<v8::Value>& info)
(...skipping 15 matching lines...) Expand all
4577 return; 4576 return;
4578 } 4577 }
4579 if (((info.Length() == 2))) { 4578 if (((info.Length() == 2))) {
4580 overloadedPerWorldMethod2MethodForMainWorld(info); 4579 overloadedPerWorldMethod2MethodForMainWorld(info);
4581 return; 4580 return;
4582 } 4581 }
4583 if (UNLIKELY(info.Length() < 1)) { 4582 if (UNLIKELY(info.Length() < 1)) {
4584 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in fo.GetIsolate()); 4583 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in fo.GetIsolate());
4585 return; 4584 return;
4586 } 4585 }
4587 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4586 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod" , "TestObject", "No function was found that matched the signature provided."), i nfo.GetIsolate());
4588 } 4587 }
4589 4588
4590 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio nCallbackInfo<v8::Value>& info) 4589 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio nCallbackInfo<v8::Value>& info)
4591 { 4590 {
4592 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4591 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4593 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); 4592 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info);
4594 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4593 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4595 } 4594 }
4596 4595
4597 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value >& info) 4596 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value >& info)
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
4745 return; 4744 return;
4746 } 4745 }
4747 if (((info.Length() == 2))) { 4746 if (((info.Length() == 2))) {
4748 overloadedActivityLoggedMethod2Method(info); 4747 overloadedActivityLoggedMethod2Method(info);
4749 return; 4748 return;
4750 } 4749 }
4751 if (UNLIKELY(info.Length() < 1)) { 4750 if (UNLIKELY(info.Length() < 1)) {
4752 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length() )), info.GetIsolate()); 4751 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length() )), info.GetIsolate());
4753 return; 4752 return;
4754 } 4753 }
4755 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4754 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedM ethod", "TestObject", "No function was found that matched the signature provided ."), info.GetIsolate());
4756 } 4755 }
4757 4756
4758 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) 4757 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info)
4759 { 4758 {
4760 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4759 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4761 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 4760 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
4762 if (contextData && contextData->activityLogger()) { 4761 if (contextData && contextData->activityLogger()) {
4763 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle <v8::Value> >(info, 0); 4762 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle <v8::Value> >(info, 0);
4764 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM ethod", info.Length(), loggerArgs.data(), "Method"); 4763 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM ethod", info.Length(), loggerArgs.data(), "Method");
4765 } 4764 }
(...skipping 20 matching lines...) Expand all
4786 return; 4785 return;
4787 } 4786 }
4788 if (((info.Length() == 2))) { 4787 if (((info.Length() == 2))) {
4789 overloadedActivityLoggedMethod2MethodForMainWorld(info); 4788 overloadedActivityLoggedMethod2MethodForMainWorld(info);
4790 return; 4789 return;
4791 } 4790 }
4792 if (UNLIKELY(info.Length() < 1)) { 4791 if (UNLIKELY(info.Length() < 1)) {
4793 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length() )), info.GetIsolate()); 4792 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length() )), info.GetIsolate());
4794 return; 4793 return;
4795 } 4794 }
4796 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4795 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedM ethod", "TestObject", "No function was found that matched the signature provided ."), info.GetIsolate());
4797 } 4796 }
4798 4797
4799 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::F unctionCallbackInfo<v8::Value>& info) 4798 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::F unctionCallbackInfo<v8::Value>& info)
4800 { 4799 {
4801 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4800 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4802 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 4801 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
4803 if (contextData && contextData->activityLogger()) { 4802 if (contextData && contextData->activityLogger()) {
4804 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle <v8::Value> >(info, 0); 4803 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle <v8::Value> >(info, 0);
4805 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM ethod", info.Length(), loggerArgs.data(), "Method"); 4804 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM ethod", info.Length(), loggerArgs.data(), "Method");
4806 } 4805 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
5312 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent); 5311 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent);
5313 return wrapper; 5312 return wrapper;
5314 } 5313 }
5315 5314
5316 void V8TestObject::derefObject(void* object) 5315 void V8TestObject::derefObject(void* object)
5317 { 5316 {
5318 fromInternalPointer(object)->deref(); 5317 fromInternalPointer(object)->deref();
5319 } 5318 }
5320 5319
5321 } // namespace WebCore 5320 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/tests/results/V8TestObjectPython.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698