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

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

Issue 953123003: IDL: Put generated union type containers in separate files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #ifndef ArrayBufferOrArrayBufferViewOrDictionary_h
8 #define ArrayBufferOrArrayBufferViewOrDictionary_h
9
10 #include "bindings/core/v8/Dictionary.h"
11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/V8ArrayBuffer.h"
13 #include "bindings/core/v8/V8ArrayBufferView.h"
14 #include "bindings/core/v8/V8Binding.h"
15 #include "platform/heap/Handle.h"
16
17 namespace blink {
18
19 class ArrayBufferOrArrayBufferViewOrDictionary final {
20 ALLOW_ONLY_INLINE_ALLOCATION();
21 public:
22 ArrayBufferOrArrayBufferViewOrDictionary();
23 bool isNull() const { return m_type == SpecificTypeNone; }
24
25 bool isArrayBuffer() const { return m_type == SpecificTypeArrayBuffer; }
26 PassRefPtr<TestArrayBuffer> getAsArrayBuffer() const;
27 void setArrayBuffer(PassRefPtr<TestArrayBuffer>);
28 static ArrayBufferOrArrayBufferViewOrDictionary fromArrayBuffer(PassRefPtr<T estArrayBuffer>);
29
30 bool isArrayBufferView() const { return m_type == SpecificTypeArrayBufferVie w; }
31 PassRefPtr<TestArrayBufferView> getAsArrayBufferView() const;
32 void setArrayBufferView(PassRefPtr<TestArrayBufferView>);
33 static ArrayBufferOrArrayBufferViewOrDictionary fromArrayBufferView(PassRefP tr<TestArrayBufferView>);
34
35 bool isDictionary() const { return m_type == SpecificTypeDictionary; }
36 Dictionary getAsDictionary() const;
37 void setDictionary(Dictionary);
38 static ArrayBufferOrArrayBufferViewOrDictionary fromDictionary(Dictionary);
39
40 private:
41 enum SpecificTypes {
42 SpecificTypeNone,
43 SpecificTypeArrayBuffer,
44 SpecificTypeArrayBufferView,
45 SpecificTypeDictionary,
46 };
47 SpecificTypes m_type;
48
49 RefPtr<TestArrayBuffer> m_arrayBuffer;
50 RefPtr<TestArrayBufferView> m_arrayBufferView;
51 Dictionary m_dictionary;
52
53 friend v8::Local<v8::Value> toV8(const ArrayBufferOrArrayBufferViewOrDiction ary&, v8::Local<v8::Object>, v8::Isolate*);
54 };
55
56 class V8ArrayBufferOrArrayBufferViewOrDictionary final {
57 public:
58 static void toImpl(v8::Isolate*, v8::Local<v8::Value>, ArrayBufferOrArrayBuf ferViewOrDictionary&, ExceptionState&);
59 };
60
61 v8::Local<v8::Value> toV8(const ArrayBufferOrArrayBufferViewOrDictionary&, v8::L ocal<v8::Object>, v8::Isolate*);
62
63 template <class CallbackInfo>
64 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ArrayBufferOrArra yBufferViewOrDictionary& impl)
65 {
66 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
67 }
68
69 template <>
70 struct NativeValueTraits<ArrayBufferOrArrayBufferViewOrDictionary> {
71 static ArrayBufferOrArrayBufferViewOrDictionary nativeValue(const v8::Local< v8::Value>&, v8::Isolate*, ExceptionState&);
72 };
73
74 } // namespace blink
75
76 #endif // ArrayBufferOrArrayBufferViewOrDictionary_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698