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

Side by Side Diff: Source/bindings/tests/results/core/NodeOrNodeList.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 NodeOrNodeList_h
8 #define NodeOrNodeList_h
9
10 #include "bindings/core/v8/Dictionary.h"
11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/V8Binding.h"
13 #include "bindings/core/v8/V8Node.h"
14 #include "bindings/core/v8/V8NodeList.h"
15 #include "core/dom/NameNodeList.h"
16 #include "core/dom/NodeList.h"
17 #include "core/dom/StaticNodeList.h"
18 #include "core/html/LabelsNodeList.h"
19 #include "platform/heap/Handle.h"
20
21 namespace blink {
22
23 class NodeOrNodeList final {
24 ALLOW_ONLY_INLINE_ALLOCATION();
25 public:
26 NodeOrNodeList();
27 bool isNull() const { return m_type == SpecificTypeNone; }
28
29 bool isNode() const { return m_type == SpecificTypeNode; }
30 PassRefPtrWillBeRawPtr<Node> getAsNode() const;
31 void setNode(PassRefPtrWillBeRawPtr<Node>);
32 static NodeOrNodeList fromNode(PassRefPtrWillBeRawPtr<Node>);
33
34 bool isNodeList() const { return m_type == SpecificTypeNodeList; }
35 PassRefPtrWillBeRawPtr<NodeList> getAsNodeList() const;
36 void setNodeList(PassRefPtrWillBeRawPtr<NodeList>);
37 static NodeOrNodeList fromNodeList(PassRefPtrWillBeRawPtr<NodeList>);
38
39 DECLARE_TRACE();
40
41 private:
42 enum SpecificTypes {
43 SpecificTypeNone,
44 SpecificTypeNode,
45 SpecificTypeNodeList,
46 };
47 SpecificTypes m_type;
48
49 RefPtrWillBeMember<Node> m_node;
50 RefPtrWillBeMember<NodeList> m_nodeList;
51
52 friend v8::Local<v8::Value> toV8(const NodeOrNodeList&, v8::Local<v8::Object >, v8::Isolate*);
53 };
54
55 class V8NodeOrNodeList final {
56 public:
57 static void toImpl(v8::Isolate*, v8::Local<v8::Value>, NodeOrNodeList&, Exce ptionState&);
58 };
59
60 v8::Local<v8::Value> toV8(const NodeOrNodeList&, v8::Local<v8::Object>, v8::Isol ate*);
61
62 template <class CallbackInfo>
63 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, NodeOrNodeList& i mpl)
64 {
65 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
66 }
67
68 template <>
69 struct NativeValueTraits<NodeOrNodeList> {
70 static NodeOrNodeList nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&);
71 };
72
73 } // namespace blink
74
75 #endif // NodeOrNodeList_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/DoubleOrString.cpp ('k') | Source/bindings/tests/results/core/NodeOrNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698