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

Side by Side Diff: Source/bindings/tests/results/core/UnionTypesCore.h

Issue 1063253005: bindings: Use Visitor to collect union types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #ifndef UnionTypeCore_h 7 #ifndef UnionTypeCore_h
8 #define UnionTypeCore_h 8 #define UnionTypeCore_h
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, DoubleOrString& i mpl) 202 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, DoubleOrString& i mpl)
203 { 203 {
204 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate())); 204 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
205 } 205 }
206 206
207 template <> 207 template <>
208 struct NativeValueTraits<DoubleOrString> { 208 struct NativeValueTraits<DoubleOrString> {
209 static DoubleOrString nativeValue(v8::Isolate*, v8::Local<v8::Value>, Except ionState&); 209 static DoubleOrString nativeValue(v8::Isolate*, v8::Local<v8::Value>, Except ionState&);
210 }; 210 };
211 211
212 class CORE_EXPORT LongOrTestDictionary final {
213 ALLOW_ONLY_INLINE_ALLOCATION();
214 public:
215 LongOrTestDictionary();
216 bool isNull() const { return m_type == SpecificTypeNone; }
217
218 bool isLong() const { return m_type == SpecificTypeLong; }
219 int getAsLong() const;
220 void setLong(int);
221 static LongOrTestDictionary fromLong(int);
222
223 bool isTestDictionary() const { return m_type == SpecificTypeTestDictionary; }
224 TestDictionary getAsTestDictionary() const;
225 void setTestDictionary(TestDictionary);
226 static LongOrTestDictionary fromTestDictionary(TestDictionary);
227
228 #if COMPILER(MSVC) && defined(COMPONENT_BUILD) && LINK_CORE_MODULES_SEPARATELY
229 // Explicit declarations of copy constructor, destructor and operator=,
230 // because msvc automatically generates them if they are not declared in
231 // this header.
232 LongOrTestDictionary(const LongOrTestDictionary&);
233 ~LongOrTestDictionary();
234 LongOrTestDictionary& operator=(const LongOrTestDictionary&);
235 #endif
236 DECLARE_TRACE();
237
238 private:
239 enum SpecificTypes {
240 SpecificTypeNone,
241 SpecificTypeLong,
242 SpecificTypeTestDictionary,
243 };
244 SpecificTypes m_type;
245
246 int m_long;
247 TestDictionary m_testDictionary;
248
249 friend CORE_EXPORT v8::Local<v8::Value> toV8(const LongOrTestDictionary&, v8 ::Local<v8::Object>, v8::Isolate*);
250 };
251
252 class V8LongOrTestDictionary final {
253 public:
254 CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, LongOrTes tDictionary&, ExceptionState&);
255 };
256
257 CORE_EXPORT v8::Local<v8::Value> toV8(const LongOrTestDictionary&, v8::Local<v8: :Object>, v8::Isolate*);
258
259 template <class CallbackInfo>
260 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, LongOrTestDiction ary& impl)
261 {
262 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
263 }
264
265 template <>
266 struct NativeValueTraits<LongOrTestDictionary> {
267 static LongOrTestDictionary nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
268 };
269
212 class CORE_EXPORT NodeOrNodeList final { 270 class CORE_EXPORT NodeOrNodeList final {
213 ALLOW_ONLY_INLINE_ALLOCATION(); 271 ALLOW_ONLY_INLINE_ALLOCATION();
214 public: 272 public:
215 NodeOrNodeList(); 273 NodeOrNodeList();
216 bool isNull() const { return m_type == SpecificTypeNone; } 274 bool isNull() const { return m_type == SpecificTypeNone; }
217 275
218 bool isNode() const { return m_type == SpecificTypeNode; } 276 bool isNode() const { return m_type == SpecificTypeNode; }
219 PassRefPtrWillBeRawPtr<Node> getAsNode() const; 277 PassRefPtrWillBeRawPtr<Node> getAsNode() const;
220 void setNode(PassRefPtrWillBeRawPtr<Node>); 278 void setNode(PassRefPtrWillBeRawPtr<Node>);
221 static NodeOrNodeList fromNode(PassRefPtrWillBeRawPtr<Node>); 279 static NodeOrNodeList fromNode(PassRefPtrWillBeRawPtr<Node>);
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 { 902 {
845 if (isUndefinedOrNull(v8Value)) 903 if (isUndefinedOrNull(v8Value))
846 return; 904 return;
847 V8DoubleOrString::toImpl(isolate, v8Value, impl, exceptionState); 905 V8DoubleOrString::toImpl(isolate, v8Value, impl, exceptionState);
848 } 906 }
849 }; 907 };
850 908
851 } // namespace blink 909 } // namespace blink
852 910
853 #endif // UnionTypeCore_h 911 #endif // UnionTypeCore_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/core/TestInterfaceConstructor.idl ('k') | Source/bindings/tests/results/core/UnionTypesCore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698