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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 1758113003: bindings: Makes not call installDOMClassTemplate twice for the same interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 "V8TestInterface5.h" 7 #include "V8TestInterface5.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 {"alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::always ExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedTo AllScripts, V8DOMConfiguration::OnInterface}, 833 {"alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::always ExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedTo AllScripts, V8DOMConfiguration::OnInterface},
834 {"voidMethodBooleanOrDOMStringArg", TestInterface5ImplementationV8Internal:: voidMethodBooleanOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguratio n::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, 834 {"voidMethodBooleanOrDOMStringArg", TestInterface5ImplementationV8Internal:: voidMethodBooleanOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguratio n::ExposedToAllScripts, V8DOMConfiguration::OnPrototype},
835 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration: :ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, 835 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration: :ExposedToAllScripts, V8DOMConfiguration::OnPrototype},
836 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, v 8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp e}, 836 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, v 8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp e},
837 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProt otype}, 837 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProt otype},
838 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0 , 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr ototype}, 838 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0 , 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr ototype},
839 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0 , 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr ototype}, 839 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0 , 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr ototype},
840 {"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback, 0, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::Exp osedToAllScripts, V8DOMConfiguration::OnPrototype}, 840 {"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback, 0, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::Exp osedToAllScripts, V8DOMConfiguration::OnPrototype},
841 }; 841 };
842 842
843 static void installV8TestInterface5Template(v8::Local<v8::FunctionTemplate> func tionTemplate, v8::Isolate* isolate) 843 static void installV8TestInterface5Template(v8::Local<v8::FunctionTemplate> inte rfaceTemplate, v8::Isolate* isolate)
844 { 844 {
845 functionTemplate->ReadOnlyPrototype(); 845 // Initialize the interface object's template.
846 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat e, V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTem plate(isolate), V8TestInterface5::internalFieldCount);
847 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe mplate);
848 ALLOW_UNUSED_LOCAL(signature);
849 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance Template();
850 ALLOW_UNUSED_LOCAL(instanceTemplate);
851 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy peTemplate();
852 ALLOW_UNUSED_LOCAL(prototypeTemplate);
853 // Register DOM constants, attributes and operations.
854 if (RuntimeEnabledFeatures::featureNameEnabled()) {
855 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constant s[] = {
856 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong },
857 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort},
858 };
859 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototy peTemplate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constant s));
860 V8DOMConfiguration::installAttributes(isolate, instanceTemplate, prototy peTemplate, V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attribu tes));
861 V8DOMConfiguration::installAccessors(isolate, instanceTemplate, prototyp eTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARRAY_LE NGTH(V8TestInterface5Accessors));
862 V8DOMConfiguration::installMethods(isolate, instanceTemplate, prototypeT emplate, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_LENGTH (V8TestInterface5Methods));
863 } // if (RuntimeEnabledFeatures::featureNameEnabled())
846 864
847 v8::Local<v8::Signature> defaultSignature; 865 // Indexed properties
848 if (!RuntimeEnabledFeatures::featureNameEnabled())
849 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfa ceEmpty::domTemplate(isolate), V8TestInterface5::internalFieldCount, 0, 0, 0, 0, 0, 0);
850 else
851 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfa ceEmpty::domTemplate(isolate), V8TestInterface5::internalFieldCount,
852 V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attribu tes),
853 V8TestInterface5Accessors, WTF_ARRAY_LENGTH(V8TestInterface5Accessor s),
854 V8TestInterface5Methods, WTF_ARRAY_LENGTH(V8TestInterface5Methods));
855 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
856 ALLOW_UNUSED_LOCAL(instanceTemplate);
857 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
858 ALLOW_UNUSED_LOCAL(prototypeTemplate);
859 V8DOMConfiguration::setClassString(isolate, prototypeTemplate, V8TestInterfa ce5::wrapperTypeInfo.interfaceName);
860 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[] = {
861 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong},
862 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort},
863 };
864 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants));
865 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInt erface5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5Im plementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5Implemen tationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<Test Interface5Implementation>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNo ne); 866 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInt erface5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5Im plementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5Implemen tationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<Test Interface5Implementation>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNo ne);
866 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); 867 instanceTemplate->SetHandler(indexedPropertyHandlerConfig);
868 // Named properties
867 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterfa ce5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5Implemen tationV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Int ernal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::named PropertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEn umeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>( int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFl ags::kNonMasking))); 869 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterfa ce5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5Implemen tationV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Int ernal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::named PropertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEn umeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>( int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFl ags::kNonMasking)));
868 instanceTemplate->SetHandler(namedPropertyHandlerConfig); 870 instanceTemplate->SetHandler(namedPropertyHandlerConfig);
871
872 // Iterator (@@iterator)
869 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIterator Configuration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Interna l::iteratorMethodCallback, 0, v8::DontDelete, V8DOMConfiguration::ExposedToAllSc ripts, V8DOMConfiguration::OnPrototype }; 873 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIterator Configuration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Interna l::iteratorMethodCallback, 0, v8::DontDelete, V8DOMConfiguration::ExposedToAllSc ripts, V8DOMConfiguration::OnPrototype };
870 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, symbolKeyedIteratorConfiguration); 874 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, signature, sym bolKeyedIteratorConfiguration);
871 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce5::legacyCallCustom); 875
876 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCusto m);
872 } 877 }
873 878
874 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola te) 879 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola te)
875 { 880 {
876 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), installV8TestInterface5Template); 881 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), installV8TestInterface5Template);
877 } 882 }
878 883
879 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is olate) 884 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is olate)
880 { 885 {
881 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e); 886 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 { 938 {
934 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); 939 scriptWrappable->toImpl<TestInterface5Implementation>()->ref();
935 } 940 }
936 941
937 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) 942 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable)
938 { 943 {
939 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); 944 scriptWrappable->toImpl<TestInterface5Implementation>()->deref();
940 } 945 }
941 946
942 } // namespace blink 947 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698