| 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 #ifndef DOMArrayBuffer_h | 5 #ifndef DOMArrayBuffer_h |
| 6 #define DOMArrayBuffer_h | 6 #define DOMArrayBuffer_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/dom/DOMArrayBufferBase.h" | 9 #include "core/dom/DOMArrayBufferBase.h" |
| 10 #include "platform/wtf/typed_arrays/ArrayBuffer.h" | 10 #include "platform/wtf/typed_arrays/ArrayBuffer.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 static DOMArrayBuffer* CreateUninitializedOrNull(unsigned num_elements, | 34 static DOMArrayBuffer* CreateUninitializedOrNull(unsigned num_elements, |
| 35 unsigned element_byte_size); | 35 unsigned element_byte_size); |
| 36 | 36 |
| 37 DOMArrayBuffer* Slice(int begin, int end) const { | 37 DOMArrayBuffer* Slice(int begin, int end) const { |
| 38 return Create(Buffer()->Slice(begin, end)); | 38 return Create(Buffer()->Slice(begin, end)); |
| 39 } | 39 } |
| 40 DOMArrayBuffer* Slice(int begin) const { | 40 DOMArrayBuffer* Slice(int begin) const { |
| 41 return Create(Buffer()->Slice(begin)); | 41 return Create(Buffer()->Slice(begin)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool IsNeuterable(v8::Isolate*); |
| 45 |
| 46 // Transfer the ArrayBuffer if it is neuterable, otherwise make a copy and |
| 47 // transfer that. |
| 48 bool Transfer(v8::Isolate*, WTF::ArrayBufferContents& result); |
| 49 |
| 44 v8::Local<v8::Object> Wrap(v8::Isolate*, | 50 v8::Local<v8::Object> Wrap(v8::Isolate*, |
| 45 v8::Local<v8::Object> creation_context) override; | 51 v8::Local<v8::Object> creation_context) override; |
| 46 | 52 |
| 47 private: | 53 private: |
| 48 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer) | 54 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer) |
| 49 : DOMArrayBufferBase(std::move(buffer)) {} | 55 : DOMArrayBufferBase(std::move(buffer)) {} |
| 50 }; | 56 }; |
| 51 | 57 |
| 52 } // namespace blink | 58 } // namespace blink |
| 53 | 59 |
| 54 #endif // DOMArrayBuffer_h | 60 #endif // DOMArrayBuffer_h |
| OLD | NEW |