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

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

Issue 114813006: IDL compiler: [SetReference] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: gclw Created 7 years 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 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32 32
33 #ifndef V8TestInterfacePython2_h 33 #ifndef V8TestInterfacePython3_h
34 #define V8TestInterfacePython2_h 34 #define V8TestInterfacePython3_h
35 35
36 #include "bindings/tests/idls/TestInterfacePython2.h" 36 #include "bindings/tests/idls/TestInterfacePython3.h"
37 #include "bindings/v8/V8Binding.h" 37 #include "bindings/v8/V8Binding.h"
38 #include "bindings/v8/V8DOMWrapper.h" 38 #include "bindings/v8/V8DOMWrapper.h"
39 #include "bindings/v8/WrapperTypeInfo.h" 39 #include "bindings/v8/WrapperTypeInfo.h"
40 40
41 namespace WebCore { 41 namespace WebCore {
42 42
43 class V8TestInterfacePython2 { 43 class V8TestInterfacePython3 {
44 public: 44 public:
45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e); 45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
46 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); 46 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor ldType); 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor ldType);
48 static TestInterfacePython2* toNative(v8::Handle<v8::Object> object) 48 static TestInterfacePython3* toNative(v8::Handle<v8::Object> object)
49 { 49 {
50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex)); 50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
51 } 51 }
52 static void derefObject(void*); 52 static void derefObject(void*);
53 static const WrapperTypeInfo wrapperTypeInfo; 53 static const WrapperTypeInfo wrapperTypeInfo;
54 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is olate*); 54 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is olate*);
55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ; 55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
56 static inline void* toInternalPointer(TestInterfacePython2* impl) 56 static inline void* toInternalPointer(TestInterfacePython3* impl)
57 { 57 {
58 return impl; 58 return impl;
59 } 59 }
60 60
61 static inline TestInterfacePython2* fromInternalPointer(void* object) 61 static inline TestInterfacePython3* fromInternalPointer(void* object)
62 { 62 {
63 return static_cast<TestInterfacePython2*>(object); 63 return static_cast<TestInterfacePython3*>(object);
64 } 64 }
65 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI nterfacePython2*, v8::Isolate*) { } 65 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI nterfacePython3*, v8::Isolate*) { }
66 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol ate*) { } 66 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol ate*) { }
67 67
68 private: 68 private:
69 friend v8::Handle<v8::Object> wrap(TestInterfacePython2*, v8::Handle<v8::Obj ect> creationContext, v8::Isolate*); 69 friend v8::Handle<v8::Object> wrap(TestInterfacePython3*, v8::Handle<v8::Obj ect> creationContext, v8::Isolate*);
70 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfacePython2> , v8::Handle<v8::Object> creationContext, v8::Isolate*); 70 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfacePython3> , v8::Handle<v8::Object> creationContext, v8::Isolate*);
71 }; 71 };
72 72
73 template<> 73 template<>
74 class WrapperTypeTraits<TestInterfacePython2 > { 74 class WrapperTypeTraits<TestInterfacePython3 > {
75 public: 75 public:
76 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfacePyt hon2::wrapperTypeInfo; } 76 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfacePyt hon3::wrapperTypeInfo; }
77 }; 77 };
78 78
79 v8::Handle<v8::Object> wrap(TestInterfacePython2* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate*); 79 inline v8::Handle<v8::Object> wrap(TestInterfacePython3* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
80 {
81 ASSERT(impl);
82 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfacePython3>(impl, isolate) );
83 return V8TestInterfacePython3::createWrapper(impl, creationContext, isolate) ;
84 }
80 85
81 inline v8::Handle<v8::Value> toV8(TestInterfacePython2* impl, v8::Handle<v8::Obj ect> creationContext, v8::Isolate* isolate) 86 inline v8::Handle<v8::Value> toV8(TestInterfacePython3* impl, v8::Handle<v8::Obj ect> creationContext, v8::Isolate* isolate)
82 { 87 {
83 if (UNLIKELY(!impl)) 88 if (UNLIKELY(!impl))
84 return v8::Null(isolate); 89 return v8::Null(isolate);
85 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfacePyth on2>(impl, isolate); 90 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfacePyth on3>(impl, isolate);
86 if (!wrapper.IsEmpty()) 91 if (!wrapper.IsEmpty())
87 return wrapper; 92 return wrapper;
88 return wrap(impl, creationContext, isolate); 93 return wrap(impl, creationContext, isolate);
89 } 94 }
90 95
91 template<typename CallbackInfo> 96 template<typename CallbackInfo>
92 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePyth on2* impl) 97 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePyth on3* impl)
93 { 98 {
94 if (UNLIKELY(!impl)) { 99 if (UNLIKELY(!impl)) {
95 v8SetReturnValueNull(callbackInfo); 100 v8SetReturnValueNull(callbackInfo);
96 return; 101 return;
97 } 102 }
98 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfacePython2>(callback Info.GetReturnValue(), impl)) 103 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfacePython3>(callback Info.GetReturnValue(), impl))
99 return; 104 return;
100 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate()); 105 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
101 v8SetReturnValue(callbackInfo, wrapper); 106 v8SetReturnValue(callbackInfo, wrapper);
102 } 107 }
103 108
104 template<typename CallbackInfo> 109 template<typename CallbackInfo>
105 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI nterfacePython2* impl) 110 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI nterfacePython3* impl)
106 { 111 {
107 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); 112 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
108 if (UNLIKELY(!impl)) { 113 if (UNLIKELY(!impl)) {
109 v8SetReturnValueNull(callbackInfo); 114 v8SetReturnValueNull(callbackInfo);
110 return; 115 return;
111 } 116 }
112 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfacePytho n2>(callbackInfo.GetReturnValue(), impl)) 117 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfacePytho n3>(callbackInfo.GetReturnValue(), impl))
113 return; 118 return;
114 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate()); 119 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate());
115 v8SetReturnValue(callbackInfo, wrapper); 120 v8SetReturnValue(callbackInfo, wrapper);
116 } 121 }
117 122
118 template<class CallbackInfo, class Wrappable> 123 template<class CallbackInfo, class Wrappable>
119 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface Python2* impl, Wrappable* wrappable) 124 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface Python3* impl, Wrappable* wrappable)
120 { 125 {
121 if (UNLIKELY(!impl)) { 126 if (UNLIKELY(!impl)) {
122 v8SetReturnValueNull(callbackInfo); 127 v8SetReturnValueNull(callbackInfo);
123 return; 128 return;
124 } 129 }
125 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfacePython2>(call backInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) 130 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfacePython3>(call backInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
126 return; 131 return;
127 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate()); 132 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
128 v8SetReturnValue(callbackInfo, wrapper); 133 v8SetReturnValue(callbackInfo, wrapper);
129 } 134 }
130 135
131 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePython2 > impl, v8::Ha ndle<v8::Object> creationContext, v8::Isolate* isolate) 136 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePython3 > impl, v8::Ha ndle<v8::Object> creationContext, v8::Isolate* isolate)
132 { 137 {
133 return toV8(impl.get(), creationContext, isolate); 138 return toV8(impl.get(), creationContext, isolate);
134 } 139 }
135 140
136 template<class CallbackInfo> 141 template<class CallbackInfo>
137 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn terfacePython2 > impl) 142 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn terfacePython3 > impl)
138 { 143 {
139 v8SetReturnValue(callbackInfo, impl.get()); 144 v8SetReturnValue(callbackInfo, impl.get());
140 } 145 }
141 146
142 template<class CallbackInfo> 147 template<class CallbackInfo>
143 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestInterfacePython2 > impl) 148 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestInterfacePython3 > impl)
144 { 149 {
145 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); 150 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
146 } 151 }
147 152
148 template<class CallbackInfo, class Wrappable> 153 template<class CallbackInfo, class Wrappable>
149 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stInterfacePython2 > impl, Wrappable* wrappable) 154 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stInterfacePython3 > impl, Wrappable* wrappable)
150 { 155 {
151 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 156 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
152 } 157 }
153 158
154 } 159 }
155 #endif // V8TestInterfacePython2_h 160 #endif // V8TestInterfacePython3_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfacePython2.cpp ('k') | Source/bindings/tests/results/V8TestInterfacePython3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698