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

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

Issue 810563007: IDL: Add missing type-check for callback function arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 5765 matching lines...) Expand 10 before | Expand all | Expand 10 after
5776 5776
5777 static void voidMethodVoidCallbackFunctionArgMethod(const v8::FunctionCallbackIn fo<v8::Value>& info) 5777 static void voidMethodVoidCallbackFunctionArgMethod(const v8::FunctionCallbackIn fo<v8::Value>& info)
5778 { 5778 {
5779 if (UNLIKELY(info.Length() < 1)) { 5779 if (UNLIKELY(info.Length() < 1)) {
5780 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodVoidCallbackFunctionArg", "TestObject", 1, info.Leng th()), info.GetIsolate()); 5780 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodVoidCallbackFunctionArg", "TestObject", 1, info.Leng th()), info.GetIsolate());
5781 return; 5781 return;
5782 } 5782 }
5783 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5783 TestObject* impl = V8TestObject::toImpl(info.Holder());
5784 ScriptValue voidCallbackFunctionArg; 5784 ScriptValue voidCallbackFunctionArg;
5785 { 5785 {
5786 if (!info[0]->IsFunction()) {
5787 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodVoidCallbackFunctionArg", "TestObject", "The callb ack provided as parameter 1 is not a function."));
5788 return;
5789 }
5786 voidCallbackFunctionArg = ScriptValue(ScriptState::current(info.GetIsola te()), info[0]); 5790 voidCallbackFunctionArg = ScriptValue(ScriptState::current(info.GetIsola te()), info[0]);
5787 } 5791 }
5788 impl->voidMethodVoidCallbackFunctionArg(voidCallbackFunctionArg); 5792 impl->voidMethodVoidCallbackFunctionArg(voidCallbackFunctionArg);
5789 } 5793 }
5790 5794
5791 static void voidMethodVoidCallbackFunctionArgMethodCallback(const v8::FunctionCa llbackInfo<v8::Value>& info) 5795 static void voidMethodVoidCallbackFunctionArgMethodCallback(const v8::FunctionCa llbackInfo<v8::Value>& info)
5792 { 5796 {
5793 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5797 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5794 TestObjectV8Internal::voidMethodVoidCallbackFunctionArgMethod(info); 5798 TestObjectV8Internal::voidMethodVoidCallbackFunctionArgMethod(info);
5795 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5799 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5796 } 5800 }
5797 5801
5802 static void voidMethodOptionalVoidCallbackFunctionArgMethod(const v8::FunctionCa llbackInfo<v8::Value>& info)
5803 {
5804 TestObject* impl = V8TestObject::toImpl(info.Holder());
5805 ScriptValue voidCallbackFunctionArg;
5806 {
5807 if (UNLIKELY(info.Length() <= 0)) {
5808 impl->voidMethodOptionalVoidCallbackFunctionArg();
5809 return;
5810 }
5811 if (!info[0]->IsFunction()) {
5812 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodOptionalVoidCallbackFunctionArg", "TestObject", "T he callback provided as parameter 1 is not a function."));
5813 return;
5814 }
5815 voidCallbackFunctionArg = ScriptValue(ScriptState::current(info.GetIsola te()), info[0]);
5816 }
5817 impl->voidMethodOptionalVoidCallbackFunctionArg(voidCallbackFunctionArg);
5818 }
5819
5820 static void voidMethodOptionalVoidCallbackFunctionArgMethodCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info)
5821 {
5822 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5823 TestObjectV8Internal::voidMethodOptionalVoidCallbackFunctionArgMethod(info);
5824 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5825 }
5826
5827 static void voidMethodNullableVoidCallbackFunctionArgMethod(const v8::FunctionCa llbackInfo<v8::Value>& info)
5828 {
5829 if (UNLIKELY(info.Length() < 1)) {
5830 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodNullableVoidCallbackFunctionArg", "TestObject", 1, i nfo.Length()), info.GetIsolate());
5831 return;
5832 }
5833 TestObject* impl = V8TestObject::toImpl(info.Holder());
5834 ScriptValue voidCallbackFunctionArg;
5835 {
5836 if (!info[0]->IsFunction() && !info[0]->IsNull()) {
5837 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodNullableVoidCallbackFunctionArg", "TestObject", "T he callback provided as parameter 1 is not a function."));
5838 return;
5839 }
5840 voidCallbackFunctionArg = ScriptValue(ScriptState::current(info.GetIsola te()), info[0]);
5841 }
5842 impl->voidMethodNullableVoidCallbackFunctionArg(voidCallbackFunctionArg);
5843 }
5844
5845 static void voidMethodNullableVoidCallbackFunctionArgMethodCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info)
5846 {
5847 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5848 TestObjectV8Internal::voidMethodNullableVoidCallbackFunctionArgMethod(info);
5849 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5850 }
5851
5798 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethod(const v8::Function CallbackInfo<v8::Value>& info) 5852 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethod(const v8::Function CallbackInfo<v8::Value>& info)
5799 { 5853 {
5800 if (UNLIKELY(info.Length() < 1)) { 5854 if (UNLIKELY(info.Length() < 1)) {
5801 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodAnyCallbackFunctionOptionalAnyArg", "TestObject", 1, info.Length()), info.GetIsolate()); 5855 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodAnyCallbackFunctionOptionalAnyArg", "TestObject", 1, info.Length()), info.GetIsolate());
5802 return; 5856 return;
5803 } 5857 }
5804 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5858 TestObject* impl = V8TestObject::toImpl(info.Holder());
5805 ScriptValue anyCallbackFunctionOptionalAnyArgArg; 5859 ScriptValue anyCallbackFunctionOptionalAnyArgArg;
5806 { 5860 {
5861 if (!info[0]->IsFunction()) {
5862 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodAnyCallbackFunctionOptionalAnyArg", "TestObject", "The callback provided as parameter 1 is not a function."));
5863 return;
5864 }
5807 anyCallbackFunctionOptionalAnyArgArg = ScriptValue(ScriptState::current( info.GetIsolate()), info[0]); 5865 anyCallbackFunctionOptionalAnyArgArg = ScriptValue(ScriptState::current( info.GetIsolate()), info[0]);
5808 } 5866 }
5809 impl->voidMethodAnyCallbackFunctionOptionalAnyArg(anyCallbackFunctionOptiona lAnyArgArg); 5867 impl->voidMethodAnyCallbackFunctionOptionalAnyArg(anyCallbackFunctionOptiona lAnyArgArg);
5810 } 5868 }
5811 5869
5812 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethodCallback(const v8:: FunctionCallbackInfo<v8::Value>& info) 5870 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethodCallback(const v8:: FunctionCallbackInfo<v8::Value>& info)
5813 { 5871 {
5814 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5872 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5815 TestObjectV8Internal::voidMethodAnyCallbackFunctionOptionalAnyArgMethod(info ); 5873 TestObjectV8Internal::voidMethodAnyCallbackFunctionOptionalAnyArgMethod(info );
5816 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5874 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
(...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after
8370 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8428 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
8371 TestObjectV8Internal::overloadedMethodJMethod(info); 8429 TestObjectV8Internal::overloadedMethodJMethod(info);
8372 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8430 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
8373 } 8431 }
8374 8432
8375 static void overloadedMethodK1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8433 static void overloadedMethodK1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
8376 { 8434 {
8377 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8435 TestObject* impl = V8TestObject::toImpl(info.Holder());
8378 ScriptValue functionArg; 8436 ScriptValue functionArg;
8379 { 8437 {
8438 if (!info[0]->IsFunction()) {
8439 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("overloadedMethodK", "TestObject", "The callback provided as parameter 1 is not a function."));
8440 return;
8441 }
8380 functionArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[ 0]); 8442 functionArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[ 0]);
8381 } 8443 }
8382 impl->overloadedMethodK(functionArg); 8444 impl->overloadedMethodK(functionArg);
8383 } 8445 }
8384 8446
8385 static void overloadedMethodK2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8447 static void overloadedMethodK2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
8386 { 8448 {
8387 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8449 TestObject* impl = V8TestObject::toImpl(info.Holder());
8388 V8StringResource<> stringArg; 8450 V8StringResource<> stringArg;
8389 { 8451 {
(...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after
10821 {"voidMethodShortArg", TestObjectV8Internal::voidMethodShortArgMethodCallbac k, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10883 {"voidMethodShortArg", TestObjectV8Internal::voidMethodShortArgMethodCallbac k, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10822 {"voidMethodUnsignedLongArg", TestObjectV8Internal::voidMethodUnsignedLongAr gMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10884 {"voidMethodUnsignedLongArg", TestObjectV8Internal::voidMethodUnsignedLongAr gMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10823 {"voidMethodUnsignedLongLongArg", TestObjectV8Internal::voidMethodUnsignedLo ngLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10885 {"voidMethodUnsignedLongLongArg", TestObjectV8Internal::voidMethodUnsignedLo ngLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10824 {"voidMethodUnsignedShortArg", TestObjectV8Internal::voidMethodUnsignedShort ArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10886 {"voidMethodUnsignedShortArg", TestObjectV8Internal::voidMethodUnsignedShort ArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10825 {"testInterfaceEmptyMethod", TestObjectV8Internal::testInterfaceEmptyMethodM ethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10887 {"testInterfaceEmptyMethod", TestObjectV8Internal::testInterfaceEmptyMethodM ethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
10826 {"voidMethodTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodTestInte rfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10888 {"voidMethodTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodTestInte rfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10827 {"voidMethodLongArgTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodL ongArgTestInterfaceEmptyArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAl lScripts}, 10889 {"voidMethodLongArgTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodL ongArgTestInterfaceEmptyArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAl lScripts},
10828 {"voidCallbackFunctionMethod", TestObjectV8Internal::voidCallbackFunctionMet hodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10890 {"voidCallbackFunctionMethod", TestObjectV8Internal::voidCallbackFunctionMet hodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
10829 {"anyCallbackFunctionOptionalAnyArgMethod", TestObjectV8Internal::anyCallbac kFunctionOptionalAnyArgMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedTo AllScripts}, 10891 {"anyCallbackFunctionOptionalAnyArgMethod", TestObjectV8Internal::anyCallbac kFunctionOptionalAnyArgMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedTo AllScripts},
10830 {"voidMethodVoidCallbackFunctionArg", TestObjectV8Internal::voidMethodVoidCa llbackFunctionArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10892 {"voidMethodVoidCallbackFunctionArg", TestObjectV8Internal::voidMethodVoidCa llbackFunctionArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10893 {"voidMethodOptionalVoidCallbackFunctionArg", TestObjectV8Internal::voidMeth odOptionalVoidCallbackFunctionArgMethodCallback, 0, 0, V8DOMConfiguration::Expos edToAllScripts},
10894 {"voidMethodNullableVoidCallbackFunctionArg", TestObjectV8Internal::voidMeth odNullableVoidCallbackFunctionArgMethodCallback, 0, 1, V8DOMConfiguration::Expos edToAllScripts},
10831 {"voidMethodAnyCallbackFunctionOptionalAnyArg", TestObjectV8Internal::voidMe thodAnyCallbackFunctionOptionalAnyArgMethodCallback, 0, 1, V8DOMConfiguration::E xposedToAllScripts}, 10895 {"voidMethodAnyCallbackFunctionOptionalAnyArg", TestObjectV8Internal::voidMe thodAnyCallbackFunctionOptionalAnyArgMethodCallback, 0, 1, V8DOMConfiguration::E xposedToAllScripts},
10832 {"anyMethod", TestObjectV8Internal::anyMethodMethodCallback, 0, 0, V8DOMConf iguration::ExposedToAllScripts}, 10896 {"anyMethod", TestObjectV8Internal::anyMethodMethodCallback, 0, 0, V8DOMConf iguration::ExposedToAllScripts},
10833 {"voidMethodEventTargetArg", TestObjectV8Internal::voidMethodEventTargetArgM ethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10897 {"voidMethodEventTargetArg", TestObjectV8Internal::voidMethodEventTargetArgM ethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10834 {"voidMethodAnyArg", TestObjectV8Internal::voidMethodAnyArgMethodCallback, 0 , 1, V8DOMConfiguration::ExposedToAllScripts}, 10898 {"voidMethodAnyArg", TestObjectV8Internal::voidMethodAnyArgMethodCallback, 0 , 1, V8DOMConfiguration::ExposedToAllScripts},
10835 {"voidMethodAttrArg", TestObjectV8Internal::voidMethodAttrArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10899 {"voidMethodAttrArg", TestObjectV8Internal::voidMethodAttrArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10836 {"voidMethodDocumentArg", TestObjectV8Internal::voidMethodDocumentArgMethodC allback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10900 {"voidMethodDocumentArg", TestObjectV8Internal::voidMethodDocumentArgMethodC allback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10837 {"voidMethodDocumentTypeArg", TestObjectV8Internal::voidMethodDocumentTypeAr gMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10901 {"voidMethodDocumentTypeArg", TestObjectV8Internal::voidMethodDocumentTypeAr gMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10838 {"voidMethodElementArg", TestObjectV8Internal::voidMethodElementArgMethodCal lback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10902 {"voidMethodElementArg", TestObjectV8Internal::voidMethodElementArgMethodCal lback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10839 {"voidMethodNodeArg", TestObjectV8Internal::voidMethodNodeArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10903 {"voidMethodNodeArg", TestObjectV8Internal::voidMethodNodeArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
10840 {"arrayBufferMethod", TestObjectV8Internal::arrayBufferMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10904 {"arrayBufferMethod", TestObjectV8Internal::arrayBufferMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
11667 return false; 11731 return false;
11668 11732
11669 ScriptState::Scope scope(scriptState); 11733 ScriptState::Scope scope(scriptState);
11670 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 11734 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
11671 11735
11672 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 11736 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
11673 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue)); 11737 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue));
11674 } 11738 }
11675 11739
11676 } // namespace blink 11740 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698