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

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

Issue 1008353002: bindings: Reduces the binary size by reducing # of callback functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/tests/results/core/V8Uint8ClampedArray.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 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface5.h" 9 #include "V8TestInterface5.h"
10 10
11 #include "bindings/core/v8/ExceptionState.h" 11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/ScriptState.h" 12 #include "bindings/core/v8/ScriptState.h"
13 #include "bindings/core/v8/ScriptValue.h" 13 #include "bindings/core/v8/ScriptValue.h"
14 #include "bindings/core/v8/V8DOMConfiguration.h" 14 #include "bindings/core/v8/V8DOMConfiguration.h"
15 #include "bindings/core/v8/V8HiddenValue.h" 15 #include "bindings/core/v8/V8HiddenValue.h"
16 #include "bindings/core/v8/V8Iterator.h" 16 #include "bindings/core/v8/V8Iterator.h"
17 #include "bindings/core/v8/V8ObjectConstructor.h" 17 #include "bindings/core/v8/V8ObjectConstructor.h"
18 #include "bindings/core/v8/V8TestInterfaceEmpty.h" 18 #include "bindings/core/v8/V8TestInterfaceEmpty.h"
19 #include "bindings/modules/v8/UnionTypesModules.h" 19 #include "bindings/modules/v8/UnionTypesModules.h"
20 #include "bindings/modules/v8/V8TestInterface5.h" 20 #include "bindings/modules/v8/V8TestInterface5.h"
21 #include "core/dom/ContextFeatures.h" 21 #include "core/dom/ContextFeatures.h"
22 #include "core/dom/Document.h" 22 #include "core/dom/Document.h"
23 #include "platform/RuntimeEnabledFeatures.h" 23 #include "platform/RuntimeEnabledFeatures.h"
24 #include "platform/TraceEvent.h" 24 #include "platform/TraceEvent.h"
25 #include "wtf/GetPtr.h" 25 #include "wtf/GetPtr.h"
26 #include "wtf/RefPtr.h" 26 #include "wtf/RefPtr.h"
27 27
28 namespace blink { 28 namespace blink {
29 29
30 const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::d erefObject, V8TestInterface5::trace, V8TestInterface5::toActiveDOMObject, V8Test Interface5::visitDOMWrapper, V8TestInterface5::installConditionallyEnabledMethod s, V8TestInterface5::installConditionallyEnabledProperties, &V8TestInterfaceEmpt y::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo ::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::De pendent, WrapperTypeInfo::RefCountedObject }; 30 const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::d erefObject, V8TestInterface5::trace, V8TestInterface5::toActiveDOMObject, V8Test Interface5::visitDOMWrapper, V8TestInterface5::installConditionallyEnabledMethod s, V8TestInterface5::installConditionallyEnabledProperties, "TestInterface5", &V 8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototyp e, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, W rapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject };
31 31
32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e5Implementation.h. 32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e5Implementation.h.
33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
34 // bindings/core/v8/ScriptWrappable.h. 34 // bindings/core/v8/ScriptWrappable.h.
35 const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestI nterface5::wrapperTypeInfo; 35 const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestI nterface5::wrapperTypeInfo;
36 36
37 namespace TestInterface5ImplementationV8Internal { 37 namespace TestInterface5ImplementationV8Internal {
38 38
39 template<class CallbackInfo> 39 template<class CallbackInfo>
40 static void TestInterface5ImplementationForceSetAttributeOnThis(v8::Local<v8::Na me> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) 40 static void TestInterface5ImplementationForceSetAttributeOnThis(v8::Local<v8::Na me> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
41 { 41 {
42 ASSERT(info.This()->IsObject()); 42 ASSERT(info.This()->IsObject());
43 v8::Local<v8::Object>::Cast(info.This())->ForceSet(name, v8Value); 43 v8::Local<v8::Object>::Cast(info.This())->ForceSet(name, v8Value);
44 } 44 }
45 45
46 static void TestInterface5ImplementationConstructorAttributeSetterCallback(v8::L ocal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info)
47 {
48 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
49 do {
50 v8::Local<v8::Value> data = info.Data();
51 ASSERT(data->IsExternal());
52 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext());
53 if (!perContextData)
54 break;
55 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data);
56 if (!wrapperTypeInfo)
57 break;
58 TestInterface5ImplementationForceSetAttributeOnThis(v8String(info.GetIso late(), wrapperTypeInfo->interfaceName), v8Value, info);
59 } while (false); // do ... while (false) just for use of break
60 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
61 }
62
46 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info) 63 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info)
47 { 64 {
48 v8::Local<v8::Object> holder = info.Holder(); 65 v8::Local<v8::Object> holder = info.Holder();
49 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 66 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
50 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl ); 67 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl );
51 } 68 }
52 69
53 static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::Name>, c onst v8::PropertyCallbackInfo<v8::Value>& info) 70 static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::Name>, c onst v8::PropertyCallbackInfo<v8::Value>& info)
54 { 71 {
55 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 72 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 if (referencedName) { 912 if (referencedName) {
896 if (!DOMDataStore::containsWrapper(referencedName, isolate)) 913 if (!DOMDataStore::containsWrapper(referencedName, isolate))
897 referencedName->wrap(creationContext, isolate); 914 referencedName->wrap(creationContext, isolate);
898 DOMDataStore::setWrapperReference(wrapper, referencedName, isolate); 915 DOMDataStore::setWrapperReference(wrapper, referencedName, isolate);
899 } 916 }
900 setObjectGroup(isolate, scriptWrappable, wrapper); 917 setObjectGroup(isolate, scriptWrappable, wrapper);
901 } 918 }
902 919
903 static const V8DOMConfiguration::AttributeConfiguration V8TestInterface5Attribut es[] = { 920 static const V8DOMConfiguration::AttributeConfiguration V8TestInterface5Attribut es[] = {
904 {"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInter faceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::te stInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigurat ion::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 921 {"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInter faceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::te stInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigurat ion::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
905 {"testInterfaceConstructorAttribute", v8ConstructorAttributeGetterAsProperty , TestInterface5ImplementationV8Internal::testInterfaceConstructorAttributeAttri buteSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrappe rTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfigu ration::OnInstance}, 922 {"testInterfaceConstructorAttribute", v8ConstructorAttributeGetter, TestInte rface5ImplementationV8Internal::testInterfaceConstructorAttributeAttributeSetter Callback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo) , static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute >(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::On Instance},
906 {"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeA ttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScri pts, V8DOMConfiguration::OnInstance}, 923 {"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeA ttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScri pts, V8DOMConfiguration::OnInstance},
907 {"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAtt ributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttr ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts , V8DOMConfiguration::OnInstance}, 924 {"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAtt ributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttr ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts , V8DOMConfiguration::OnInstance},
908 {"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unre strictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8In ternal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast <v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 925 {"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unre strictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8In ternal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast <v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
909 {"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unres trictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Inte rnal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8D OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 926 {"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unres trictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Inte rnal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8D OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
910 {"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExp osedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::al waysExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigurat ion::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 927 {"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExp osedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::al waysExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigurat ion::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
911 }; 928 };
912 929
913 static const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { 930 static const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = {
914 {"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal:: voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::Exposed ToAllScripts}, 931 {"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal:: voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::Exposed ToAllScripts},
915 {"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::void MethodDoubleArgFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScr ipts}, 932 {"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::void MethodDoubleArgFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScr ipts},
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); 1061 scriptWrappable->toImpl<TestInterface5Implementation>()->ref();
1045 } 1062 }
1046 1063
1047 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) 1064 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable)
1048 { 1065 {
1049 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); 1066 scriptWrappable->toImpl<TestInterface5Implementation>()->deref();
1050 } 1067 }
1051 1068
1052 } // namespace blink 1069 } // namespace blink
1053 #endif // ENABLE(CONDITION) 1070 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698