OLD | NEW |
(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. |
| 6 // DO NOT MODIFY! |
| 7 |
| 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/union_container.h.tmpl |
| 10 |
| 11 // clang-format off |
| 12 #ifndef ByteStringSequenceSequenceOrByteStringByteStringRecord_h |
| 13 #define ByteStringSequenceSequenceOrByteStringByteStringRecord_h |
| 14 |
| 15 #include "bindings/core/v8/Dictionary.h" |
| 16 #include "bindings/core/v8/ExceptionState.h" |
| 17 #include "bindings/core/v8/IDLTypes.h" |
| 18 #include "bindings/core/v8/NativeValueTraits.h" |
| 19 #include "bindings/core/v8/V8Binding.h" |
| 20 #include "core/CoreExport.h" |
| 21 #include "platform/heap/Handle.h" |
| 22 |
| 23 namespace blink { |
| 24 |
| 25 class CORE_EXPORT ByteStringSequenceSequenceOrByteStringByteStringRecord final { |
| 26 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 27 public: |
| 28 ByteStringSequenceSequenceOrByteStringByteStringRecord(); |
| 29 bool isNull() const { return m_type == SpecificTypeNone; } |
| 30 |
| 31 bool isByteStringSequenceSequence() const { return m_type == SpecificTypeByteS
tringSequenceSequence; } |
| 32 const Vector<Vector<String>>& getAsByteStringSequenceSequence() const; |
| 33 void setByteStringSequenceSequence(const Vector<Vector<String>>&); |
| 34 static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringSe
quenceSequence(const Vector<Vector<String>>&); |
| 35 |
| 36 bool isByteStringByteStringRecord() const { return m_type == SpecificTypeByteS
tringByteStringRecord; } |
| 37 const Vector<std::pair<String, String>>& getAsByteStringByteStringRecord() con
st; |
| 38 void setByteStringByteStringRecord(const Vector<std::pair<String, String>>&); |
| 39 static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringBy
teStringRecord(const Vector<std::pair<String, String>>&); |
| 40 |
| 41 ByteStringSequenceSequenceOrByteStringByteStringRecord(const ByteStringSequenc
eSequenceOrByteStringByteStringRecord&); |
| 42 ~ByteStringSequenceSequenceOrByteStringByteStringRecord(); |
| 43 ByteStringSequenceSequenceOrByteStringByteStringRecord& operator=(const ByteSt
ringSequenceSequenceOrByteStringByteStringRecord&); |
| 44 DECLARE_TRACE(); |
| 45 |
| 46 private: |
| 47 enum SpecificTypes { |
| 48 SpecificTypeNone, |
| 49 SpecificTypeByteStringSequenceSequence, |
| 50 SpecificTypeByteStringByteStringRecord, |
| 51 }; |
| 52 SpecificTypes m_type; |
| 53 |
| 54 Vector<Vector<String>> m_byteStringSequenceSequence; |
| 55 Vector<std::pair<String, String>> m_byteStringByteStringRecord; |
| 56 |
| 57 friend CORE_EXPORT v8::Local<v8::Value> ToV8(const ByteStringSequenceSequenceO
rByteStringByteStringRecord&, v8::Local<v8::Object>, v8::Isolate*); |
| 58 }; |
| 59 |
| 60 class V8ByteStringSequenceSequenceOrByteStringByteStringRecord final { |
| 61 public: |
| 62 CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, ByteStringS
equenceSequenceOrByteStringByteStringRecord&, UnionTypeConversionMode, Exception
State&); |
| 63 }; |
| 64 |
| 65 CORE_EXPORT v8::Local<v8::Value> ToV8(const ByteStringSequenceSequenceOrByteStri
ngByteStringRecord&, v8::Local<v8::Object>, v8::Isolate*); |
| 66 |
| 67 template <class CallbackInfo> |
| 68 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ByteStringSequenc
eSequenceOrByteStringByteStringRecord& impl) { |
| 69 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.
GetIsolate())); |
| 70 } |
| 71 |
| 72 template <class CallbackInfo> |
| 73 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ByteStringSequenc
eSequenceOrByteStringByteStringRecord& impl, v8::Local<v8::Object> creationConte
xt) { |
| 74 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso
late())); |
| 75 } |
| 76 |
| 77 template <> |
| 78 struct NativeValueTraits<ByteStringSequenceSequenceOrByteStringByteStringRecord>
{ |
| 79 using ImplType = ByteStringSequenceSequenceOrByteStringByteStringRecord; |
| 80 CORE_EXPORT static ByteStringSequenceSequenceOrByteStringByteStringRecord nati
veValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); |
| 81 }; |
| 82 |
| 83 template <> |
| 84 struct V8TypeOf<ByteStringSequenceSequenceOrByteStringByteStringRecord> { |
| 85 typedef V8ByteStringSequenceSequenceOrByteStringByteStringRecord Type; |
| 86 }; |
| 87 |
| 88 } // namespace blink |
| 89 |
| 90 // We need to set canInitializeWithMemset=true because HeapVector supports |
| 91 // items that can initialize with memset or have a vtable. It is safe to |
| 92 // set canInitializeWithMemset=true for a union type object in practice. |
| 93 // See https://codereview.chromium.org/1118993002/#msg5 for more details. |
| 94 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::ByteStringSequenceSequenceOrBy
teStringByteStringRecord); |
| 95 |
| 96 #endif // ByteStringSequenceSequenceOrByteStringByteStringRecord_h |
OLD | NEW |