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/NativeValueTraitsImpl.h" |
| 20 #include "bindings/core/v8/V8Binding.h" |
| 21 #include "core/CoreExport.h" |
| 22 #include "platform/heap/Handle.h" |
| 23 |
| 24 namespace blink { |
| 25 |
| 26 class CORE_EXPORT ByteStringSequenceSequenceOrByteStringByteStringRecord final { |
| 27 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 28 public: |
| 29 ByteStringSequenceSequenceOrByteStringByteStringRecord(); |
| 30 bool isNull() const { return m_type == SpecificTypeNone; } |
| 31 |
| 32 bool isByteStringSequenceSequence() const { return m_type == SpecificTypeByteS
tringSequenceSequence; } |
| 33 const Vector<Vector<String>>& getAsByteStringSequenceSequence() const; |
| 34 void setByteStringSequenceSequence(const Vector<Vector<String>>&); |
| 35 static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringSe
quenceSequence(const Vector<Vector<String>>&); |
| 36 |
| 37 bool isByteStringByteStringRecord() const { return m_type == SpecificTypeByteS
tringByteStringRecord; } |
| 38 const Vector<std::pair<String, String>>& getAsByteStringByteStringRecord() con
st; |
| 39 void setByteStringByteStringRecord(const Vector<std::pair<String, String>>&); |
| 40 static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringBy
teStringRecord(const Vector<std::pair<String, String>>&); |
| 41 |
| 42 ByteStringSequenceSequenceOrByteStringByteStringRecord(const ByteStringSequenc
eSequenceOrByteStringByteStringRecord&); |
| 43 ~ByteStringSequenceSequenceOrByteStringByteStringRecord(); |
| 44 ByteStringSequenceSequenceOrByteStringByteStringRecord& operator=(const ByteSt
ringSequenceSequenceOrByteStringByteStringRecord&); |
| 45 DECLARE_TRACE(); |
| 46 |
| 47 private: |
| 48 enum SpecificTypes { |
| 49 SpecificTypeNone, |
| 50 SpecificTypeByteStringSequenceSequence, |
| 51 SpecificTypeByteStringByteStringRecord, |
| 52 }; |
| 53 SpecificTypes m_type; |
| 54 |
| 55 Vector<Vector<String>> m_byteStringSequenceSequence; |
| 56 Vector<std::pair<String, String>> m_byteStringByteStringRecord; |
| 57 |
| 58 friend CORE_EXPORT v8::Local<v8::Value> ToV8(const ByteStringSequenceSequenceO
rByteStringByteStringRecord&, v8::Local<v8::Object>, v8::Isolate*); |
| 59 }; |
| 60 |
| 61 class V8ByteStringSequenceSequenceOrByteStringByteStringRecord final { |
| 62 public: |
| 63 CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, ByteStringS
equenceSequenceOrByteStringByteStringRecord&, UnionTypeConversionMode, Exception
State&); |
| 64 }; |
| 65 |
| 66 CORE_EXPORT v8::Local<v8::Value> ToV8(const ByteStringSequenceSequenceOrByteStri
ngByteStringRecord&, v8::Local<v8::Object>, v8::Isolate*); |
| 67 |
| 68 template <class CallbackInfo> |
| 69 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ByteStringSequenc
eSequenceOrByteStringByteStringRecord& impl) { |
| 70 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.
GetIsolate())); |
| 71 } |
| 72 |
| 73 template <class CallbackInfo> |
| 74 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ByteStringSequenc
eSequenceOrByteStringByteStringRecord& impl, v8::Local<v8::Object> creationConte
xt) { |
| 75 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso
late())); |
| 76 } |
| 77 |
| 78 template <> |
| 79 struct NativeValueTraits<ByteStringSequenceSequenceOrByteStringByteStringRecord>
: public NativeValueTraitsBase<ByteStringSequenceSequenceOrByteStringByteString
Record> { |
| 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 |