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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrTestInterfaceEmpty.h

Issue 1961883002: Generate separate files for union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
(Empty)
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
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 TestInterfaceOrTestInterfaceEmpty_h
8 #define TestInterfaceOrTestInterfaceEmpty_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 "core/CoreExport.h"
14 #include "platform/heap/Handle.h"
15
16 namespace blink {
17
18 class TestInterfaceEmpty;
19 class TestInterfaceImplementation;
20
21 class CORE_EXPORT TestInterfaceOrTestInterfaceEmpty final {
22 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
23 public:
24 TestInterfaceOrTestInterfaceEmpty();
25 bool isNull() const { return m_type == SpecificTypeNone; }
26
27 bool isTestInterface() const { return m_type == SpecificTypeTestInterface; }
28 TestInterfaceImplementation* getAsTestInterface() const;
29 void setTestInterface(TestInterfaceImplementation*);
30 static TestInterfaceOrTestInterfaceEmpty fromTestInterface(TestInterfaceImpl ementation*);
31
32 bool isTestInterfaceEmpty() const { return m_type == SpecificTypeTestInterfa ceEmpty; }
33 TestInterfaceEmpty* getAsTestInterfaceEmpty() const;
34 void setTestInterfaceEmpty(TestInterfaceEmpty*);
35 static TestInterfaceOrTestInterfaceEmpty fromTestInterfaceEmpty(TestInterfac eEmpty*);
36
37 TestInterfaceOrTestInterfaceEmpty(const TestInterfaceOrTestInterfaceEmpty&);
38 ~TestInterfaceOrTestInterfaceEmpty();
39 TestInterfaceOrTestInterfaceEmpty& operator=(const TestInterfaceOrTestInterf aceEmpty&);
40 DECLARE_TRACE();
41
42 private:
43 enum SpecificTypes {
44 SpecificTypeNone,
45 SpecificTypeTestInterface,
46 SpecificTypeTestInterfaceEmpty,
47 };
48 SpecificTypes m_type;
49
50 Member<TestInterfaceImplementation> m_testInterface;
51 Member<TestInterfaceEmpty> m_testInterfaceEmpty;
52
53 friend CORE_EXPORT v8::Local<v8::Value> toV8(const TestInterfaceOrTestInterf aceEmpty&, v8::Local<v8::Object>, v8::Isolate*);
54 };
55
56 class V8TestInterfaceOrTestInterfaceEmpty final {
57 public:
58 CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, TestInter faceOrTestInterfaceEmpty&, UnionTypeConversionMode, ExceptionState&);
59 };
60
61 CORE_EXPORT v8::Local<v8::Value> toV8(const TestInterfaceOrTestInterfaceEmpty&, v8::Local<v8::Object>, v8::Isolate*);
62
63 template <class CallbackInfo>
64 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceOrTe stInterfaceEmpty& impl)
65 {
66 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
67 }
68
69 template <>
70 struct NativeValueTraits<TestInterfaceOrTestInterfaceEmpty> {
71 CORE_EXPORT static TestInterfaceOrTestInterfaceEmpty nativeValue(v8::Isolate *, v8::Local<v8::Value>, ExceptionState&);
72 };
73
74 } // namespace blink
75
76 // We need to set canInitializeWithMemset=true because HeapVector supports
77 // items that can initialize with memset or have a vtable. It is safe to
78 // set canInitializeWithMemset=true for a union type object in practice.
79 // See https://codereview.chromium.org/1118993002/#msg5 for more details.
80 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::TestInterfaceOrTestInterfaceEm pty);
81
82 #endif // TestInterfaceOrTestInterfaceEmpty_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698