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 "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/DOMArrayBufferDeallocationObserver.h" | 9 #include "core/dom/DOMArrayBufferDeallocationObserver.h" |
10 #include "wtf/ArrayBuffer.h" | 10 #include "wtf/ArrayBuffer.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 PassRefPtr<DOMArrayBuffer> slice(int begin, int end) const | 48 PassRefPtr<DOMArrayBuffer> slice(int begin, int end) const |
49 { | 49 { |
50 return create(buffer()->slice(begin, end)); | 50 return create(buffer()->slice(begin, end)); |
51 } | 51 } |
52 PassRefPtr<DOMArrayBuffer> slice(int begin) const | 52 PassRefPtr<DOMArrayBuffer> slice(int begin) const |
53 { | 53 { |
54 return create(buffer()->slice(begin)); | 54 return create(buffer()->slice(begin)); |
55 } | 55 } |
56 bool transfer(WTF::ArrayBufferContents& result) { return buffer()->transfer(
result); } | 56 bool transfer(WTF::ArrayBufferContents& result) { return buffer()->transfer(
result); } |
57 bool isNeutered() { return buffer()->isNeutered(); } | 57 bool isNeutered() { return buffer()->isNeutered(); } |
58 void setDeallocationObserver(DOMArrayBufferDeallocationObserver* observer) | 58 void setDeallocationObserver(DOMArrayBufferDeallocationObserver& observer) |
59 { | 59 { |
60 buffer()->setDeallocationObserver(observer); | 60 buffer()->setDeallocationObserver(observer); |
61 } | 61 } |
62 | 62 |
63 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; | 63 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; |
64 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap
perTypeInfo*, v8::Handle<v8::Object> wrapper) override; | 64 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap
perTypeInfo*, v8::Handle<v8::Object> wrapper) override; |
65 | 65 |
66 private: | 66 private: |
67 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer) | 67 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer) |
68 : m_buffer(buffer) | 68 : m_buffer(buffer) |
69 { | 69 { |
70 ASSERT(m_buffer); | 70 ASSERT(m_buffer); |
71 } | 71 } |
72 | 72 |
73 RefPtr<WTF::ArrayBuffer> m_buffer; | 73 RefPtr<WTF::ArrayBuffer> m_buffer; |
74 }; | 74 }; |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
77 | 77 |
78 #endif // DOMArrayBuffer_h | 78 #endif // DOMArrayBuffer_h |
OLD | NEW |