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

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

Issue 24053003: Support partial interface for test support idls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use one InterfaceDependencies.txt file Created 7 years, 3 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 /* 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,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21 #ifndef V8TestInterface_h 21 #ifndef V8TestSupportTestInterface_h
22 #define V8TestInterface_h 22 #define V8TestSupportTestInterface_h
23 23
24 #if ENABLE(Condition1) || ENABLE(Condition2) 24 #include "bindings/tests/idls/testing/TestSupportTestInterface.h"
25 #include "bindings/tests/idls/TestInterface.h"
26 #include "bindings/v8/V8Binding.h" 25 #include "bindings/v8/V8Binding.h"
27 #include "bindings/v8/V8DOMWrapper.h" 26 #include "bindings/v8/V8DOMWrapper.h"
28 #include "bindings/v8/WrapperTypeInfo.h" 27 #include "bindings/v8/WrapperTypeInfo.h"
29 28
30 namespace WebCore { 29 namespace WebCore {
31 30
32 class V8TestInterface { 31 class V8TestSupportTestInterface {
33 public: 32 public:
34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e); 33 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); 34 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType); 35 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType);
37 static TestInterface* toNative(v8::Handle<v8::Object> object) 36 static TestSupportTestInterface* toNative(v8::Handle<v8::Object> object)
38 { 37 {
39 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex)); 38 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
40 } 39 }
41 static void derefObject(void*); 40 static void derefObject(void*);
42 static WrapperTypeInfo info; 41 static WrapperTypeInfo info;
43 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
44 #if ENABLE(Condition22) || ENABLE(Condition23)
45 static void implementsMethod3MethodCustom(const v8::FunctionCallbackInfo<v8: :Value>&);
46 #endif // ENABLE(Condition22) || ENABLE(Condition23)
47 #if ENABLE(Condition11) || ENABLE(Condition12) 42 #if ENABLE(Condition11) || ENABLE(Condition12)
48 static void supplementalMethod3MethodCustom(const v8::FunctionCallbackInfo<v 8::Value>&); 43 static void supplementalMethod3MethodCustom(const v8::FunctionCallbackInfo<v 8::Value>&);
49 #endif // ENABLE(Condition11) || ENABLE(Condition12) 44 #endif // ENABLE(Condition11) || ENABLE(Condition12)
50 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
51 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V alue>, const v8::PropertyCallbackInfo<v8::Value>&);
52 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ; 45 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
53 static inline void* toInternalPointer(TestInterface* impl) 46 static inline void* toInternalPointer(TestSupportTestInterface* impl)
54 { 47 {
55 return impl; 48 return impl;
56 } 49 }
57 50
58 static inline TestInterface* fromInternalPointer(void* object) 51 static inline TestSupportTestInterface* fromInternalPointer(void* object)
59 { 52 {
60 return static_cast<TestInterface*>(object); 53 return static_cast<TestSupportTestInterface*>(object);
61 } 54 }
62 static void installPerContextProperties(v8::Handle<v8::Object>, TestInterfac e*, v8::Isolate*); 55 static void installPerContextProperties(v8::Handle<v8::Object>, TestSupportT estInterface*, v8::Isolate*);
63 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { } 56 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
64 57
65 private: 58 private:
66 friend v8::Handle<v8::Object> wrap(TestInterface*, v8::Handle<v8::Object> cr eationContext, v8::Isolate*); 59 friend v8::Handle<v8::Object> wrap(TestSupportTestInterface*, v8::Handle<v8: :Object> creationContext, v8::Isolate*);
67 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface>, v8::H andle<v8::Object> creationContext, v8::Isolate*); 60 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSupportTestInterf ace>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
68 }; 61 };
69 62
70 template<> 63 template<>
71 class WrapperTypeTraits<TestInterface > { 64 class WrapperTypeTraits<TestSupportTestInterface > {
72 public: 65 public:
73 static WrapperTypeInfo* info() { return &V8TestInterface::info; } 66 static WrapperTypeInfo* info() { return &V8TestSupportTestInterface::info; }
74 }; 67 };
75 68
76 inline v8::Handle<v8::Object> wrap(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 69 inline v8::Handle<v8::Object> wrap(TestSupportTestInterface* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
77 { 70 {
78 ASSERT(impl); 71 ASSERT(impl);
79 ASSERT(!DOMDataStore::containsWrapper<V8TestInterface>(impl, isolate)); 72 ASSERT(!DOMDataStore::containsWrapper<V8TestSupportTestInterface>(impl, isol ate));
80 return V8TestInterface::createWrapper(impl, creationContext, isolate); 73 return V8TestSupportTestInterface::createWrapper(impl, creationContext, isol ate);
81 } 74 }
82 75
83 inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 76 inline v8::Handle<v8::Value> toV8(TestSupportTestInterface* impl, v8::Handle<v8: :Object> creationContext, v8::Isolate* isolate)
84 { 77 {
85 if (UNLIKELY(!impl)) 78 if (UNLIKELY(!impl))
86 return v8NullWithCheck(isolate); 79 return v8NullWithCheck(isolate);
87 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface>(im pl, isolate); 80 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSupportTestIn terface>(impl, isolate);
88 if (!wrapper.IsEmpty()) 81 if (!wrapper.IsEmpty())
89 return wrapper; 82 return wrapper;
90 return wrap(impl, creationContext, isolate); 83 return wrap(impl, creationContext, isolate);
91 } 84 }
92 85
93 template<typename CallbackInfo> 86 template<typename CallbackInfo>
94 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterface* im pl, v8::Handle<v8::Object> creationContext) 87 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSupportTestIn terface* impl, v8::Handle<v8::Object> creationContext)
95 { 88 {
96 if (UNLIKELY(!impl)) { 89 if (UNLIKELY(!impl)) {
97 v8SetReturnValueNull(callbackInfo); 90 v8SetReturnValueNull(callbackInfo);
98 return; 91 return;
99 } 92 }
100 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterface>(callbackInfo.Ge tReturnValue(), impl)) 93 if (DOMDataStore::setReturnValueFromWrapper<V8TestSupportTestInterface>(call backInfo.GetReturnValue(), impl))
101 return; 94 return;
102 v8::Handle<v8::Object> wrapper = wrap(impl, creationContext, callbackInfo.Ge tIsolate()); 95 v8::Handle<v8::Object> wrapper = wrap(impl, creationContext, callbackInfo.Ge tIsolate());
103 v8SetReturnValue(callbackInfo, wrapper); 96 v8SetReturnValue(callbackInfo, wrapper);
104 } 97 }
105 98
106 template<typename CallbackInfo> 99 template<typename CallbackInfo>
107 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI nterface* impl, v8::Handle<v8::Object> creationContext) 100 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestS upportTestInterface* impl, v8::Handle<v8::Object> creationContext)
108 { 101 {
109 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); 102 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
110 if (UNLIKELY(!impl)) { 103 if (UNLIKELY(!impl)) {
111 v8SetReturnValueNull(callbackInfo); 104 v8SetReturnValueNull(callbackInfo);
112 return; 105 return;
113 } 106 }
114 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterface>(cal lbackInfo.GetReturnValue(), impl)) 107 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSupportTestInt erface>(callbackInfo.GetReturnValue(), impl))
115 return; 108 return;
116 v8::Handle<v8::Value> wrapper = wrap(impl, creationContext, callbackInfo.Get Isolate()); 109 v8::Handle<v8::Value> wrapper = wrap(impl, creationContext, callbackInfo.Get Isolate());
117 v8SetReturnValue(callbackInfo, wrapper); 110 v8SetReturnValue(callbackInfo, wrapper);
118 } 111 }
119 112
120 template<class CallbackInfo, class Wrappable> 113 template<class CallbackInfo, class Wrappable>
121 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface * impl, Wrappable* wrappable) 114 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSupportTe stInterface* impl, Wrappable* wrappable)
122 { 115 {
123 if (UNLIKELY(!impl)) { 116 if (UNLIKELY(!impl)) {
124 v8SetReturnValueNull(callbackInfo); 117 v8SetReturnValueNull(callbackInfo);
125 return; 118 return;
126 } 119 }
127 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterface>(callbackInf o.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) 120 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSupportTestInterface>( callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
128 return; 121 return;
129 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate()); 122 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
130 v8SetReturnValue(callbackInfo, wrapper); 123 v8SetReturnValue(callbackInfo, wrapper);
131 } 124 }
132 125
133 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface > impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 126 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSupportTestInterface > impl, v8 ::Handle<v8::Object> creationContext, v8::Isolate* isolate)
134 { 127 {
135 return toV8(impl.get(), creationContext, isolate); 128 return toV8(impl.get(), creationContext, isolate);
136 } 129 }
137 130
138 template<class CallbackInfo> 131 template<class CallbackInfo>
139 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn terface > impl, v8::Handle<v8::Object> creationContext) 132 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSu pportTestInterface > impl, v8::Handle<v8::Object> creationContext)
140 { 133 {
141 v8SetReturnValue(callbackInfo, impl.get(), creationContext); 134 v8SetReturnValue(callbackInfo, impl.get(), creationContext);
142 } 135 }
143 136
144 template<class CallbackInfo> 137 template<class CallbackInfo>
145 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestInterface > impl, v8::Handle<v8::Object> creationContext) 138 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestSupportTestInterface > impl, v8::Handle<v8::Object> creationContext)
146 { 139 {
147 v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext); 140 v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext);
148 } 141 }
149 142
150 template<class CallbackInfo, class Wrappable> 143 template<class CallbackInfo, class Wrappable>
151 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stInterface > impl, Wrappable* wrappable) 144 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stSupportTestInterface > impl, Wrappable* wrappable)
152 { 145 {
153 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 146 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
154 } 147 }
155 148
156 } 149 }
157 150
158 #endif // ENABLE(Condition1) || ENABLE(Condition2) 151 #endif // V8TestSupportTestInterface_h
159
160 #endif // V8TestInterface_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698