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

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

Issue 134683007: IDL compiler: sync Python to r166680 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Order Created 6 years, 10 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
(Empty)
1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29 */
30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32
33 #ifndef V8TestInterfaceGarbageCollected_h
34 #define V8TestInterfaceGarbageCollected_h
35
36 #include "bindings/tests/idls/TestInterfaceGarbageCollected.h"
37 #include "bindings/v8/V8Binding.h"
38 #include "bindings/v8/V8DOMWrapper.h"
39 #include "bindings/v8/WrapperTypeInfo.h"
40 #include "heap/Handle.h"
41
42 namespace WebCore {
43
44 class V8TestInterfaceGarbageCollected {
45 public:
46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor ldType);
48 static TestInterfaceGarbageCollected* toNative(v8::Handle<v8::Object> object )
49 {
50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
51 }
52 static const WrapperTypeInfo wrapperTypeInfo;
53 static void derefObject(void*);
54 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
55 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + 0;
56 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1 ;
57 static inline void* toInternalPointer(TestInterfaceGarbageCollected* impl)
58 {
59 return impl;
60 }
61
62 static inline TestInterfaceGarbageCollected* fromInternalPointer(void* objec t)
63 {
64 return static_cast<TestInterfaceGarbageCollected*>(object);
65 }
66 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI nterfaceGarbageCollected*, v8::Isolate*) { }
67 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol ate*) { }
68
69 private:
70 friend v8::Handle<v8::Object> wrap(TestInterfaceGarbageCollected*, v8::Handl e<v8::Object> creationContext, v8::Isolate*);
71 static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInter faceGarbageCollected>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
72 };
73
74 template<>
75 class WrapperTypeTraits<TestInterfaceGarbageCollected > {
76 public:
77 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceGar bageCollected::wrapperTypeInfo; }
78 };
79
80 inline v8::Handle<v8::Object> wrap(TestInterfaceGarbageCollected* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
81 {
82 ASSERT(impl);
83 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceGarbageCollected>(impl, isolate));
84 return V8TestInterfaceGarbageCollected::createWrapper(impl, creationContext, isolate);
85 }
86
87 inline v8::Handle<v8::Value> toV8(TestInterfaceGarbageCollected* impl, v8::Handl e<v8::Object> creationContext, v8::Isolate* isolate)
88 {
89 if (UNLIKELY(!impl))
90 return v8::Null(isolate);
91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceGarb ageCollected>(impl, isolate);
92 if (!wrapper.IsEmpty())
93 return wrapper;
94 return wrap(impl, creationContext, isolate);
95 }
96
97 template<typename CallbackInfo>
98 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceGarb ageCollected* impl)
99 {
100 if (UNLIKELY(!impl)) {
101 v8SetReturnValueNull(callbackInfo);
102 return;
103 }
104 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceGarbageCollected> (callbackInfo.GetReturnValue(), impl))
105 return;
106 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
107 v8SetReturnValue(callbackInfo, wrapper);
108 }
109
110 template<typename CallbackInfo>
111 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI nterfaceGarbageCollected* impl)
112 {
113 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
114 if (UNLIKELY(!impl)) {
115 v8SetReturnValueNull(callbackInfo);
116 return;
117 }
118 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceGarba geCollected>(callbackInfo.GetReturnValue(), impl))
119 return;
120 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate());
121 v8SetReturnValue(callbackInfo, wrapper);
122 }
123
124 template<class CallbackInfo, class Wrappable>
125 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface GarbageCollected* impl, Wrappable* wrappable)
126 {
127 if (UNLIKELY(!impl)) {
128 v8SetReturnValueNull(callbackInfo);
129 return;
130 }
131 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceGarbageCollec ted>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
132 return;
133 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
134 v8SetReturnValue(callbackInfo, wrapper);
135 }
136
137 inline v8::Handle<v8::Value> toV8(PassRefPtrWillBeRawPtr<TestInterfaceGarbageCol lected> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
138 {
139 return toV8(impl.get(), creationContext, isolate);
140 }
141
142 template<class CallbackInfo>
143 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtrWillBeR awPtr<TestInterfaceGarbageCollected> impl)
144 {
145 v8SetReturnValue(callbackInfo, impl.get());
146 }
147
148 template<class CallbackInfo>
149 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtrWillBeRawPtr<TestInterfaceGarbageCollected> impl)
150 {
151 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
152 }
153
154 template<class CallbackInfo, class Wrappable>
155 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtrWil lBeRawPtr<TestInterfaceGarbageCollected> impl, Wrappable* wrappable)
156 {
157 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
158 }
159
160 }
161 #endif // V8TestInterfaceGarbageCollected_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestObjectPython.idl ('k') | Source/bindings/tests/results/V8TestInterfaceGarbageCollected.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698