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

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

Issue 955413002: Log in Binding code for invalid enum type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
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 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 16 matching lines...) Expand all
27 #include "bindings/core/v8/V8TestInterfaceEmpty.h" 27 #include "bindings/core/v8/V8TestInterfaceEmpty.h"
28 #include "bindings/core/v8/V8Window.h" 28 #include "bindings/core/v8/V8Window.h"
29 #include "bindings/tests/idls/core/TestImplements2.h" 29 #include "bindings/tests/idls/core/TestImplements2.h"
30 #include "bindings/tests/idls/core/TestImplements3Implementation.h" 30 #include "bindings/tests/idls/core/TestImplements3Implementation.h"
31 #include "bindings/tests/idls/core/TestPartialInterface.h" 31 #include "bindings/tests/idls/core/TestPartialInterface.h"
32 #include "bindings/tests/idls/core/TestPartialInterfaceImplementation.h" 32 #include "bindings/tests/idls/core/TestPartialInterfaceImplementation.h"
33 #include "core/dom/ContextFeatures.h" 33 #include "core/dom/ContextFeatures.h"
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "core/frame/UseCounter.h" 36 #include "core/frame/UseCounter.h"
37 #include "core/inspector/ConsoleMessage.h"
37 #include "platform/RuntimeEnabledFeatures.h" 38 #include "platform/RuntimeEnabledFeatures.h"
38 #include "platform/ScriptForbiddenScope.h" 39 #include "platform/ScriptForbiddenScope.h"
39 #include "platform/TraceEvent.h" 40 #include "platform/TraceEvent.h"
40 #include "wtf/GetPtr.h" 41 #include "wtf/GetPtr.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 43
43 namespace blink { 44 namespace blink {
44 45
45 WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8Test Interface::domTemplate, V8TestInterface::refObject, V8TestInterface::derefObject , V8TestInterface::trace, V8TestInterface::toActiveDOMObject, V8TestInterface::v isitDOMWrapper, V8TestInterface::installConditionallyEnabledMethods, V8TestInter face::installConditionallyEnabledProperties, "TestInterface", &V8TestInterfaceEm pty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeIn fo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo:: Dependent, WrapperTypeInfo::RefCountedObject }; 46 WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8Test Interface::domTemplate, V8TestInterface::refObject, V8TestInterface::derefObject , V8TestInterface::trace, V8TestInterface::toActiveDOMObject, V8TestInterface::v isitDOMWrapper, V8TestInterface::installConditionallyEnabledMethods, V8TestInter face::installConditionallyEnabledProperties, "TestInterface", &V8TestInterfaceEm pty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeIn fo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo:: Dependent, WrapperTypeInfo::RefCountedObject };
46 47
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 275 }
275 276
276 static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 277 static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
277 { 278 {
278 v8::Local<v8::Object> holder = info.Holder(); 279 v8::Local<v8::Object> holder = info.Holder();
279 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 280 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
280 V8StringResource<> cppValue = v8Value; 281 V8StringResource<> cppValue = v8Value;
281 if (!cppValue.prepare()) 282 if (!cppValue.prepare())
282 return; 283 return;
283 String string = cppValue; 284 String string = cppValue;
284 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st ring == "EnumValue3")) 285 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st ring == "EnumValue3")) {
286 currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMes sage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + stri ng + "' is not a valid value of type 'TestEnum'."));
285 return; 287 return;
288 }
286 impl->setTestEnumAttribute(cppValue); 289 impl->setTestEnumAttribute(cppValue);
287 } 290 }
288 291
289 static void testEnumAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 292 static void testEnumAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
290 { 293 {
291 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 294 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
292 TestInterfaceImplementationV8Internal::testEnumAttributeAttributeSetter(v8Va lue, info); 295 TestInterfaceImplementationV8Internal::testEnumAttributeAttributeSetter(v8Va lue, info);
293 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 296 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
294 } 297 }
295 298
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 956
954 #if ENABLE(PARTIAL_CONDITION) 957 #if ENABLE(PARTIAL_CONDITION)
955 static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 958 static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
956 { 959 {
957 v8::Local<v8::Object> holder = info.Holder(); 960 v8::Local<v8::Object> holder = info.Holder();
958 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 961 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
959 V8StringResource<> cppValue = v8Value; 962 V8StringResource<> cppValue = v8Value;
960 if (!cppValue.prepare()) 963 if (!cppValue.prepare())
961 return; 964 return;
962 String string = cppValue; 965 String string = cppValue;
963 if (!(string == "foo" || string == "bar")) 966 if (!(string == "foo" || string == "bar")) {
967 currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMes sage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + stri ng + "' is not a valid value of type 'PartialEnumType'."));
964 return; 968 return;
969 }
965 TestPartialInterface::setPartialPartialEnumTypeAttribute(*impl, cppValue); 970 TestPartialInterface::setPartialPartialEnumTypeAttribute(*impl, cppValue);
966 } 971 }
967 #endif // ENABLE(PARTIAL_CONDITION) 972 #endif // ENABLE(PARTIAL_CONDITION)
968 973
969 #if ENABLE(PARTIAL_CONDITION) 974 #if ENABLE(PARTIAL_CONDITION)
970 static void partialPartialEnumTypeAttributeAttributeSetterCallback(v8::Local<v8: :Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info ) 975 static void partialPartialEnumTypeAttributeAttributeSetterCallback(v8::Local<v8: :Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info )
971 { 976 {
972 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 977 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
973 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttrib uteSetter(v8Value, info); 978 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttrib uteSetter(v8Value, info);
974 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 979 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2544 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2549 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&))
2545 { 2550 {
2546 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; 2551 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method;
2547 } 2552 }
2548 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2553 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
2549 { 2554 {
2550 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; 2555 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method;
2551 } 2556 }
2552 } // namespace blink 2557 } // namespace blink
2553 #endif // ENABLE(CONDITION) 2558 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698