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

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.h

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 5 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
OLDNEW
1 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
(...skipping 18 matching lines...) Expand all
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 class V8TestInterface { 32 class V8TestInterface {
33 public: 33 public:
34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e); 34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); 35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType); 36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType);
37 static TestInterface* toNative(v8::Handle<v8::Object> object) 37 static TestInterface* toNative(v8::Handle<v8::Object> object)
38 { 38 {
39 return reinterpret_cast<TestInterface*>(object->GetAlignedPointerFromInt ernalField(v8DOMWrapperObjectIndex)); 39 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
40 } 40 }
41 static void derefObject(void*); 41 static void derefObject(void*);
42 static WrapperTypeInfo info; 42 static WrapperTypeInfo info;
43 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); 43 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
44 #if ENABLE(Condition22) || ENABLE(Condition23) 44 #if ENABLE(Condition22) || ENABLE(Condition23)
45 static void implementsMethod3MethodCustom(const v8::FunctionCallbackInfo<v8: :Value>&); 45 static void implementsMethod3MethodCustom(const v8::FunctionCallbackInfo<v8: :Value>&);
46 #endif // ENABLE(Condition22) || ENABLE(Condition23) 46 #endif // ENABLE(Condition22) || ENABLE(Condition23)
47 #if ENABLE(Condition11) || ENABLE(Condition12) 47 #if ENABLE(Condition11) || ENABLE(Condition12)
48 static void supplementalMethod3MethodCustom(const v8::FunctionCallbackInfo<v 8::Value>&); 48 static void supplementalMethod3MethodCustom(const v8::FunctionCallbackInfo<v 8::Value>&);
49 #endif // ENABLE(Condition11) || ENABLE(Condition12) 49 #endif // ENABLE(Condition11) || ENABLE(Condition12)
50 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); 50 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
51 #if ENABLE(Condition22) || ENABLE(Condition23) 51 #if ENABLE(Condition22) || ENABLE(Condition23)
52 static void implementsStr3AttrGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>&); 52 static void implementsStr3AttrGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>&);
53 #endif // ENABLE(Condition22) || ENABLE(Condition23) 53 #endif // ENABLE(Condition22) || ENABLE(Condition23)
54 #if ENABLE(Condition22) || ENABLE(Condition23) 54 #if ENABLE(Condition22) || ENABLE(Condition23)
55 static void implementsStr3AttrSetterCustom(v8::Local<v8::String> name, v8::L ocal<v8::Value>, const v8::PropertyCallbackInfo<void>&); 55 static void implementsStr3AttrSetterCustom(v8::Local<v8::String> name, v8::L ocal<v8::Value>, const v8::PropertyCallbackInfo<void>&);
56 #endif // ENABLE(Condition22) || ENABLE(Condition23) 56 #endif // ENABLE(Condition22) || ENABLE(Condition23)
57 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V alue>, const v8::PropertyCallbackInfo<v8::Value>&); 57 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V alue>, const v8::PropertyCallbackInfo<v8::Value>&);
58 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ; 58 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
59 static inline void* toInternalPointer(TestInterface* impl)
60 {
61 return impl;
62 }
63
64 static inline TestInterface* fromInternalPointer(void* object)
65 {
66 return static_cast<TestInterface*>(object);
67 }
59 static void installPerContextProperties(v8::Handle<v8::Object>, TestInterfac e*, v8::Isolate*); 68 static void installPerContextProperties(v8::Handle<v8::Object>, TestInterfac e*, v8::Isolate*);
60 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { } 69 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
61 private: 70 private:
62 friend v8::Handle<v8::Object> wrap(TestInterface*, v8::Handle<v8::Object> cr eationContext, v8::Isolate*); 71 friend v8::Handle<v8::Object> wrap(TestInterface*, v8::Handle<v8::Object> cr eationContext, v8::Isolate*);
63 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface>, v8::H andle<v8::Object> creationContext, v8::Isolate*); 72 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface>, v8::H andle<v8::Object> creationContext, v8::Isolate*);
64 }; 73 };
65 74
66 template<> 75 template<>
67 class WrapperTypeTraits<TestInterface > { 76 class WrapperTypeTraits<TestInterface > {
68 public: 77 public:
69 static WrapperTypeInfo* info() { return &V8TestInterface::info; } 78 static WrapperTypeInfo* info() { return &V8TestInterface::info; }
70 }; 79 };
71 80
72 81
73 inline v8::Handle<v8::Object> wrap(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 82 inline v8::Handle<v8::Object> wrap(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
74 { 83 {
75 ASSERT(impl); 84 ASSERT(impl);
76 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); 85 ASSERT(DOMDataStore::getWrapper<V8TestInterface>(impl, isolate).IsEmpty());
77 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { 86 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) {
78 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl); 87 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl);
79 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 88 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have
80 // the same object de-ref functions, though, so use that as the basis of the check. 89 // the same object de-ref functions, though, so use that as the basis of the check.
81 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == V8TestInterface::info.derefObjectFunction); 90 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == V8TestInterface::info.derefObjectFunction);
82 } 91 }
83 return V8TestInterface::createWrapper(impl, creationContext, isolate); 92 return V8TestInterface::createWrapper(impl, creationContext, isolate);
84 } 93 }
85 94
86 inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 95 inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
87 { 96 {
88 if (UNLIKELY(!impl)) 97 if (UNLIKELY(!impl))
89 return v8NullWithCheck(isolate); 98 return v8NullWithCheck(isolate);
90 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); 99 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface>(im pl, isolate);
91 if (!wrapper.IsEmpty()) 100 if (!wrapper.IsEmpty())
92 return wrapper; 101 return wrapper;
93 return wrap(impl, creationContext, isolate); 102 return wrap(impl, creationContext, isolate);
94 } 103 }
95 104
96 inline v8::Handle<v8::Value> toV8ForMainWorld(TestInterface* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 105 inline v8::Handle<v8::Value> toV8ForMainWorld(TestInterface* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
97 { 106 {
98 ASSERT(worldType(isolate) == MainWorld); 107 ASSERT(worldType(isolate) == MainWorld);
99 if (UNLIKELY(!impl)) 108 if (UNLIKELY(!impl))
100 return v8NullWithCheck(isolate); 109 return v8NullWithCheck(isolate);
101 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); 110 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestI nterface>(impl);
102 if (!wrapper.IsEmpty()) 111 if (!wrapper.IsEmpty())
103 return wrapper; 112 return wrapper;
104 return wrap(impl, creationContext, isolate); 113 return wrap(impl, creationContext, isolate);
105 } 114 }
106 115
107 template<class HolderContainer, class Wrappable> 116 template<class HolderContainer, class Wrappable>
108 inline v8::Handle<v8::Value> toV8Fast(TestInterface* impl, const HolderContainer & container, Wrappable* wrappable) 117 inline v8::Handle<v8::Value> toV8Fast(TestInterface* impl, const HolderContainer & container, Wrappable* wrappable)
109 { 118 {
110 if (UNLIKELY(!impl)) 119 if (UNLIKELY(!impl))
111 return v8::Null(container.GetIsolate()); 120 return v8::Null(container.GetIsolate());
112 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe r, wrappable); 121 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestInterfac e>(impl, container, wrappable);
113 if (!wrapper.IsEmpty()) 122 if (!wrapper.IsEmpty())
114 return wrapper; 123 return wrapper;
115 return wrap(impl, container.Holder(), container.GetIsolate()); 124 return wrap(impl, container.Holder(), container.GetIsolate());
116 } 125 }
117 126
118 template<class HolderContainer, class Wrappable> 127 template<class HolderContainer, class Wrappable>
119 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestInterface* impl, const Hol derContainer& container, Wrappable* wrappable) 128 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestInterface* impl, const Hol derContainer& container, Wrappable* wrappable)
120 { 129 {
121 ASSERT(worldType(container.GetIsolate()) == MainWorld); 130 ASSERT(worldType(container.GetIsolate()) == MainWorld);
122 if (UNLIKELY(!impl)) 131 if (UNLIKELY(!impl))
123 return v8::Null(container.GetIsolate()); 132 return v8::Null(container.GetIsolate());
124 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); 133 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test Interface>(impl);
125 if (!wrapper.IsEmpty()) 134 if (!wrapper.IsEmpty())
126 return wrapper; 135 return wrapper;
127 return wrap(impl, container.Holder(), container.GetIsolate()); 136 return wrap(impl, container.Holder(), container.GetIsolate());
128 } 137 }
129 138
130 template<class HolderContainer, class Wrappable> 139 template<class HolderContainer, class Wrappable>
131 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestInterface > im pl, const HolderContainer& container, Wrappable* wrappable) 140 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestInterface > im pl, const HolderContainer& container, Wrappable* wrappable)
132 { 141 {
133 return toV8FastForMainWorld(impl.get(), container, wrappable); 142 return toV8FastForMainWorld(impl.get(), container, wrappable);
134 } 143 }
135 144
136 145
137 template<class HolderContainer, class Wrappable> 146 template<class HolderContainer, class Wrappable>
138 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestInterface > impl, const Ho lderContainer& container, Wrappable* wrappable) 147 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestInterface > impl, const Ho lderContainer& container, Wrappable* wrappable)
139 { 148 {
140 return toV8Fast(impl.get(), container, wrappable); 149 return toV8Fast(impl.get(), container, wrappable);
141 } 150 }
142 151
143 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 152 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
144 { 153 {
145 return toV8(impl.get(), creationContext, isolate); 154 return toV8(impl.get(), creationContext, isolate);
146 } 155 }
147 156
148 } 157 }
149 158
150 #endif // ENABLE(Condition1) || ENABLE(Condition2) 159 #endif // ENABLE(Condition1) || ENABLE(Condition2)
151 160
152 #endif // V8TestInterface_h 161 #endif // V8TestInterface_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestExtendedEvent.cpp ('k') | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698