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 DOMArrayBufferView_h | 5 #ifndef DOMArrayBufferView_h |
6 #define DOMArrayBufferView_h | 6 #define DOMArrayBufferView_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/DOMArrayBuffer.h" | 9 #include "core/dom/DOMArrayBuffer.h" |
10 #include "wtf/ArrayBufferView.h" | 10 #include "wtf/ArrayBufferView.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const char* typeName() { return view()->typeName(); } | 43 const char* typeName() { return view()->typeName(); } |
44 void* baseAddress() const { return view()->baseAddress(); } | 44 void* baseAddress() const { return view()->baseAddress(); } |
45 unsigned byteOffset() const { return view()->byteOffset(); } | 45 unsigned byteOffset() const { return view()->byteOffset(); } |
46 unsigned byteLength() const { return view()->byteLength(); } | 46 unsigned byteLength() const { return view()->byteLength(); } |
47 | 47 |
48 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override | 48 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override |
49 { | 49 { |
50 ASSERT_NOT_REACHED(); | 50 ASSERT_NOT_REACHED(); |
51 return v8::Handle<v8::Object>(); | 51 return v8::Handle<v8::Object>(); |
52 } | 52 } |
53 virtual v8::Handle<v8::Object> associateWithWrapper(const WrapperTypeInfo*,
v8::Handle<v8::Object> wrapper, v8::Isolate*) override | 53 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap
perTypeInfo*, v8::Handle<v8::Object> wrapper) override |
54 { | 54 { |
55 ASSERT_NOT_REACHED(); | 55 ASSERT_NOT_REACHED(); |
56 return v8::Handle<v8::Object>(); | 56 return v8::Handle<v8::Object>(); |
57 } | 57 } |
58 | 58 |
59 protected: | 59 protected: |
60 explicit DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView) | 60 explicit DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView) |
61 : m_bufferView(bufferView) | 61 : m_bufferView(bufferView) |
62 { | 62 { |
63 ASSERT(m_bufferView); | 63 ASSERT(m_bufferView); |
64 } | 64 } |
65 DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView, PassRefPtr<D
OMArrayBuffer> domArrayBuffer) | 65 DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView, PassRefPtr<D
OMArrayBuffer> domArrayBuffer) |
66 : m_bufferView(bufferView), m_domArrayBuffer(domArrayBuffer) | 66 : m_bufferView(bufferView), m_domArrayBuffer(domArrayBuffer) |
67 { | 67 { |
68 ASSERT(m_bufferView); | 68 ASSERT(m_bufferView); |
69 ASSERT(m_domArrayBuffer); | 69 ASSERT(m_domArrayBuffer); |
70 ASSERT(m_domArrayBuffer->buffer() == m_bufferView->buffer()); | 70 ASSERT(m_domArrayBuffer->buffer() == m_bufferView->buffer()); |
71 } | 71 } |
72 | 72 |
73 private: | 73 private: |
74 RefPtr<WTF::ArrayBufferView> m_bufferView; | 74 RefPtr<WTF::ArrayBufferView> m_bufferView; |
75 mutable RefPtr<DOMArrayBuffer> m_domArrayBuffer; | 75 mutable RefPtr<DOMArrayBuffer> m_domArrayBuffer; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace blink | 78 } // namespace blink |
79 | 79 |
80 #endif // DOMArrayBufferView_h | 80 #endif // DOMArrayBufferView_h |
OLD | NEW |