| 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 StringOrArrayBufferOrArrayBufferView_h | 12 #ifndef StringOrArrayBufferOrArrayBufferView_h |
| 13 #define StringOrArrayBufferOrArrayBufferView_h | 13 #define StringOrArrayBufferOrArrayBufferView_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/V8Binding.h" | 18 #include "bindings/core/v8/V8Binding.h" |
| 18 #include "core/CoreExport.h" | 19 #include "core/CoreExport.h" |
| 19 #include "platform/heap/Handle.h" | 20 #include "platform/heap/Handle.h" |
| 20 | 21 |
| 21 namespace blink { | 22 namespace blink { |
| 22 | 23 |
| 23 class TestArrayBuffer; | 24 class TestArrayBuffer; |
| 24 class TestArrayBufferView; | 25 class TestArrayBufferView; |
| 25 | 26 |
| 26 class CORE_EXPORT StringOrArrayBufferOrArrayBufferView final { | 27 class CORE_EXPORT StringOrArrayBufferOrArrayBufferView final { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.
GetIsolate())); | 78 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.
GetIsolate())); |
| 78 } | 79 } |
| 79 | 80 |
| 80 template <class CallbackInfo> | 81 template <class CallbackInfo> |
| 81 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, StringOrArrayBuff
erOrArrayBufferView& impl, v8::Local<v8::Object> creationContext) { | 82 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, StringOrArrayBuff
erOrArrayBufferView& impl, v8::Local<v8::Object> creationContext) { |
| 82 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso
late())); | 83 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso
late())); |
| 83 } | 84 } |
| 84 | 85 |
| 85 template <> | 86 template <> |
| 86 struct NativeValueTraits<StringOrArrayBufferOrArrayBufferView> { | 87 struct NativeValueTraits<StringOrArrayBufferOrArrayBufferView> { |
| 88 using ImplType = StringOrArrayBufferOrArrayBufferView; |
| 87 CORE_EXPORT static StringOrArrayBufferOrArrayBufferView nativeValue(v8::Isolat
e*, v8::Local<v8::Value>, ExceptionState&); | 89 CORE_EXPORT static StringOrArrayBufferOrArrayBufferView nativeValue(v8::Isolat
e*, v8::Local<v8::Value>, ExceptionState&); |
| 88 }; | 90 }; |
| 89 | 91 |
| 92 template <> |
| 93 struct V8TypeOf<StringOrArrayBufferOrArrayBufferView> { |
| 94 typedef V8StringOrArrayBufferOrArrayBufferView Type; |
| 95 }; |
| 96 |
| 90 } // namespace blink | 97 } // namespace blink |
| 91 | 98 |
| 92 // We need to set canInitializeWithMemset=true because HeapVector supports | 99 // We need to set canInitializeWithMemset=true because HeapVector supports |
| 93 // items that can initialize with memset or have a vtable. It is safe to | 100 // items that can initialize with memset or have a vtable. It is safe to |
| 94 // set canInitializeWithMemset=true for a union type object in practice. | 101 // set canInitializeWithMemset=true for a union type object in practice. |
| 95 // See https://codereview.chromium.org/1118993002/#msg5 for more details. | 102 // See https://codereview.chromium.org/1118993002/#msg5 for more details. |
| 96 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::StringOrArrayBufferOrArrayBuff
erView); | 103 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::StringOrArrayBufferOrArrayBuff
erView); |
| 97 | 104 |
| 98 #endif // StringOrArrayBufferOrArrayBufferView_h | 105 #endif // StringOrArrayBufferOrArrayBufferView_h |
| OLD | NEW |