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

Side by Side Diff: Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.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 TestInterfaceGarbageCollectedOrString_h
8 #define TestInterfaceGarbageCollectedOrString_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/V8TestInterfaceGarbageCollected.h"
14 #include "platform/heap/Handle.h"
15
16 namespace blink {
17
18 class TestInterfaceGarbageCollectedOrString final {
19 ALLOW_ONLY_INLINE_ALLOCATION();
20 public:
21 TestInterfaceGarbageCollectedOrString();
22 bool isNull() const { return m_type == SpecificTypeNone; }
23
24 bool isTestInterfaceGarbageCollected() const { return m_type == SpecificType TestInterfaceGarbageCollected; }
25 TestInterfaceGarbageCollected* getAsTestInterfaceGarbageCollected() const;
26 void setTestInterfaceGarbageCollected(TestInterfaceGarbageCollected*);
27 static TestInterfaceGarbageCollectedOrString fromTestInterfaceGarbageCollect ed(TestInterfaceGarbageCollected*);
28
29 bool isString() const { return m_type == SpecificTypeString; }
30 String getAsString() const;
31 void setString(String);
32 static TestInterfaceGarbageCollectedOrString fromString(String);
33
34 DECLARE_TRACE();
35
36 private:
37 enum SpecificTypes {
38 SpecificTypeNone,
39 SpecificTypeTestInterfaceGarbageCollected,
40 SpecificTypeString,
41 };
42 SpecificTypes m_type;
43
44 Member<TestInterfaceGarbageCollected> m_testInterfaceGarbageCollected;
45 String m_string;
46
47 friend v8::Local<v8::Value> toV8(const TestInterfaceGarbageCollectedOrString &, v8::Local<v8::Object>, v8::Isolate*);
48 };
49
50 class V8TestInterfaceGarbageCollectedOrString final {
51 public:
52 static void toImpl(v8::Isolate*, v8::Local<v8::Value>, TestInterfaceGarbageC ollectedOrString&, ExceptionState&);
53 };
54
55 v8::Local<v8::Value> toV8(const TestInterfaceGarbageCollectedOrString&, v8::Loca l<v8::Object>, v8::Isolate*);
56
57 template <class CallbackInfo>
58 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceGarb ageCollectedOrString& impl)
59 {
60 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
61 }
62
63 template <>
64 struct NativeValueTraits<TestInterfaceGarbageCollectedOrString> {
65 static TestInterfaceGarbageCollectedOrString nativeValue(const v8::Local<v8: :Value>&, v8::Isolate*, ExceptionState&);
66 };
67
68 } // namespace blink
69
70 #endif // TestInterfaceGarbageCollectedOrString_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698