| OLD | NEW |
| 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. | 5 // This file has been auto-generated by code_generator_v8.py. |
| 6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
| 7 | 7 |
| 8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/union_container.h.tmpl | 9 // third_party/WebKit/Source/bindings/templates/union_container.h.tmpl |
| 10 | 10 |
| 11 // clang-format off | 11 // clang-format off |
| 12 #ifndef TestInterface2OrUint8Array_h | 12 #ifndef TestInterface2OrUint8Array_h |
| 13 #define TestInterface2OrUint8Array_h | 13 #define TestInterface2OrUint8Array_h |
| 14 | 14 |
| 15 #include "bindings/core/v8/Dictionary.h" | 15 #include "bindings/core/v8/Dictionary.h" |
| 16 #include "bindings/core/v8/ExceptionState.h" | 16 #include "bindings/core/v8/ExceptionState.h" |
| 17 #include "bindings/core/v8/NativeValueTraits.h" | 17 #include "bindings/core/v8/NativeValueTraits.h" |
| 18 #include "bindings/core/v8/V8ArrayBufferView.h" | 18 #include "bindings/core/v8/V8ArrayBufferView.h" |
| 19 #include "bindings/core/v8/V8Binding.h" | 19 #include "bindings/core/v8/V8Binding.h" |
| 20 #include "bindings/core/v8/V8Uint8Array.h" | 20 #include "bindings/core/v8/V8Uint8Array.h" |
| 21 #include "core/CoreExport.h" | 21 #include "core/CoreExport.h" |
| 22 #include "core/dom/FlexibleArrayBufferView.h" | 22 #include "core/dom/FlexibleArrayBufferView.h" |
| 23 #include "core/dom/NotShared.h" |
| 23 #include "platform/heap/Handle.h" | 24 #include "platform/heap/Handle.h" |
| 24 | 25 |
| 25 namespace blink { | 26 namespace blink { |
| 26 | 27 |
| 27 class TestInterface2; | 28 class TestInterface2; |
| 28 | 29 |
| 29 class CORE_EXPORT TestInterface2OrUint8Array final { | 30 class CORE_EXPORT TestInterface2OrUint8Array final { |
| 30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 31 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 31 public: | 32 public: |
| 32 TestInterface2OrUint8Array(); | 33 TestInterface2OrUint8Array(); |
| 33 bool isNull() const { return m_type == SpecificTypeNone; } | 34 bool isNull() const { return m_type == SpecificTypeNone; } |
| 34 | 35 |
| 35 bool isTestInterface2() const { return m_type == SpecificTypeTestInterface2; } | 36 bool isTestInterface2() const { return m_type == SpecificTypeTestInterface2; } |
| 36 TestInterface2* getAsTestInterface2() const; | 37 TestInterface2* getAsTestInterface2() const; |
| 37 void setTestInterface2(TestInterface2*); | 38 void setTestInterface2(TestInterface2*); |
| 38 static TestInterface2OrUint8Array fromTestInterface2(TestInterface2*); | 39 static TestInterface2OrUint8Array fromTestInterface2(TestInterface2*); |
| 39 | 40 |
| 40 bool isUint8Array() const { return m_type == SpecificTypeUint8Array; } | 41 bool isUint8Array() const { return m_type == SpecificTypeUint8Array; } |
| 41 DOMUint8Array* getAsUint8Array() const; | 42 NotShared<DOMUint8Array> getAsUint8Array() const; |
| 42 void setUint8Array(DOMUint8Array*); | 43 void setUint8Array(NotShared<DOMUint8Array>); |
| 43 static TestInterface2OrUint8Array fromUint8Array(DOMUint8Array*); | 44 static TestInterface2OrUint8Array fromUint8Array(NotShared<DOMUint8Array>); |
| 44 | 45 |
| 45 TestInterface2OrUint8Array(const TestInterface2OrUint8Array&); | 46 TestInterface2OrUint8Array(const TestInterface2OrUint8Array&); |
| 46 ~TestInterface2OrUint8Array(); | 47 ~TestInterface2OrUint8Array(); |
| 47 TestInterface2OrUint8Array& operator=(const TestInterface2OrUint8Array&); | 48 TestInterface2OrUint8Array& operator=(const TestInterface2OrUint8Array&); |
| 48 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 enum SpecificTypes { | 52 enum SpecificTypes { |
| 52 SpecificTypeNone, | 53 SpecificTypeNone, |
| 53 SpecificTypeTestInterface2, | 54 SpecificTypeTestInterface2, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 91 |
| 91 } // namespace blink | 92 } // namespace blink |
| 92 | 93 |
| 93 // We need to set canInitializeWithMemset=true because HeapVector supports | 94 // We need to set canInitializeWithMemset=true because HeapVector supports |
| 94 // items that can initialize with memset or have a vtable. It is safe to | 95 // items that can initialize with memset or have a vtable. It is safe to |
| 95 // set canInitializeWithMemset=true for a union type object in practice. | 96 // set canInitializeWithMemset=true for a union type object in practice. |
| 96 // See https://codereview.chromium.org/1118993002/#msg5 for more details. | 97 // See https://codereview.chromium.org/1118993002/#msg5 for more details. |
| 97 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::TestInterface2OrUint8Array); | 98 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::TestInterface2OrUint8Array); |
| 98 | 99 |
| 99 #endif // TestInterface2OrUint8Array_h | 100 #endif // TestInterface2OrUint8Array_h |
| OLD | NEW |