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

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

Issue 24053003: Support partial interface for test support idls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: patch Created 7 years, 2 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
(Empty)
1 /*
2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
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
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20
21 #ifndef V8SupportTestInterface_h
22 #define V8SupportTestInterface_h
23
24 #include "bindings/tests/idls/testing/SupportTestInterface.h"
25 #include "bindings/v8/V8Binding.h"
26 #include "bindings/v8/V8DOMWrapper.h"
27 #include "bindings/v8/WrapperTypeInfo.h"
28
29 namespace WebCore {
30
31 class V8SupportTestInterface {
32 public:
33 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
34 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
35 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType);
36 static SupportTestInterface* toNative(v8::Handle<v8::Object> object)
37 {
38 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
39 }
40 static void derefObject(void*);
41 static WrapperTypeInfo info;
42 #if ENABLE(Condition11) || ENABLE(Condition12)
43 static void supplementalMethod3MethodCustom(const v8::FunctionCallbackInfo<v 8::Value>&);
44 #endif // ENABLE(Condition11) || ENABLE(Condition12)
45 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
46 static inline void* toInternalPointer(SupportTestInterface* impl)
47 {
48 return impl;
49 }
50
51 static inline SupportTestInterface* fromInternalPointer(void* object)
52 {
53 return static_cast<SupportTestInterface*>(object);
54 }
55 static void installPerContextProperties(v8::Handle<v8::Object>, SupportTestI nterface*, v8::Isolate*) { }
56 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
57
58 private:
59 friend v8::Handle<v8::Object> wrap(SupportTestInterface*, v8::Handle<v8::Obj ect> creationContext, v8::Isolate*);
60 static v8::Handle<v8::Object> createWrapper(PassRefPtr<SupportTestInterface> , v8::Handle<v8::Object> creationContext, v8::Isolate*);
61 };
62
63 template<>
64 class WrapperTypeTraits<SupportTestInterface > {
65 public:
66 static WrapperTypeInfo* info() { return &V8SupportTestInterface::info; }
67 };
68
69 inline v8::Handle<v8::Object> wrap(SupportTestInterface* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
70 {
71 ASSERT(impl);
72 ASSERT(!DOMDataStore::containsWrapper<V8SupportTestInterface>(impl, isolate) );
73 return V8SupportTestInterface::createWrapper(impl, creationContext, isolate) ;
74 }
75
76 inline v8::Handle<v8::Value> toV8(SupportTestInterface* impl, v8::Handle<v8::Obj ect> creationContext, v8::Isolate* isolate)
77 {
78 if (UNLIKELY(!impl))
79 return v8NullWithCheck(isolate);
80 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8SupportTestInterf ace>(impl, isolate);
81 if (!wrapper.IsEmpty())
82 return wrapper;
83 return wrap(impl, creationContext, isolate);
84 }
85
86 template<typename CallbackInfo>
87 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, SupportTestInterf ace* impl, v8::Handle<v8::Object> creationContext)
88 {
89 if (UNLIKELY(!impl)) {
90 v8SetReturnValueNull(callbackInfo);
91 return;
92 }
93 if (DOMDataStore::setReturnValueFromWrapper<V8SupportTestInterface>(callback Info.GetReturnValue(), impl))
94 return;
95 v8::Handle<v8::Object> wrapper = wrap(impl, creationContext, callbackInfo.Ge tIsolate());
96 v8SetReturnValue(callbackInfo, wrapper);
97 }
98
99 template<typename CallbackInfo>
100 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Suppo rtTestInterface* impl, v8::Handle<v8::Object> creationContext)
101 {
102 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
103 if (UNLIKELY(!impl)) {
104 v8SetReturnValueNull(callbackInfo);
105 return;
106 }
107 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8SupportTestInterfa ce>(callbackInfo.GetReturnValue(), impl))
108 return;
109 v8::Handle<v8::Value> wrapper = wrap(impl, creationContext, callbackInfo.Get Isolate());
110 v8SetReturnValue(callbackInfo, wrapper);
111 }
112
113 template<class CallbackInfo, class Wrappable>
114 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, SupportTestIn terface* impl, Wrappable* wrappable)
115 {
116 if (UNLIKELY(!impl)) {
117 v8SetReturnValueNull(callbackInfo);
118 return;
119 }
120 if (DOMDataStore::setReturnValueFromWrapperFast<V8SupportTestInterface>(call backInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
121 return;
122 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
123 v8SetReturnValue(callbackInfo, wrapper);
124 }
125
126 inline v8::Handle<v8::Value> toV8(PassRefPtr<SupportTestInterface > impl, v8::Ha ndle<v8::Object> creationContext, v8::Isolate* isolate)
127 {
128 return toV8(impl.get(), creationContext, isolate);
129 }
130
131 template<class CallbackInfo>
132 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<Suppor tTestInterface > impl, v8::Handle<v8::Object> creationContext)
133 {
134 v8SetReturnValue(callbackInfo, impl.get(), creationContext);
135 }
136
137 template<class CallbackInfo>
138 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<SupportTestInterface > impl, v8::Handle<v8::Object> creationContext)
139 {
140 v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext);
141 }
142
143 template<class CallbackInfo, class Wrappable>
144 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Su pportTestInterface > impl, Wrappable* wrappable)
145 {
146 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
147 }
148
149 }
150
151 #endif // V8SupportTestInterface_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698