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 DOMDataView_h | 5 #ifndef DOMDataView_h |
6 #define DOMDataView_h | 6 #define DOMDataView_h |
7 | 7 |
8 #include "core/dom/DOMArrayBufferView.h" | 8 #include "core/dom/DOMArrayBufferView.h" |
9 #include "core/html/canvas/DataView.h" | 9 #include "core/html/canvas/DataView.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class DOMDataView final : public DOMArrayBufferView { | 13 class DOMDataView final : public DOMArrayBufferView { |
14 DEFINE_WRAPPERTYPEINFO(); | 14 DEFINE_WRAPPERTYPEINFO(); |
15 public: | 15 public: |
16 typedef char ValueType; | 16 typedef char ValueType; |
17 | 17 |
18 static PassRefPtr<DOMDataView> create(PassRefPtr<DOMArrayBuffer>, unsigned b
yteOffset, unsigned byteLength); | 18 static PassRefPtr<DOMDataView> create(PassRefPtr<DOMArrayBuffer>, unsigned b
yteOffset, unsigned byteLength); |
19 | 19 |
20 const DataView* view() const { return static_cast<const DataView*>(DOMArrayB
ufferView::view()); } | 20 const DataView* view() const { return static_cast<const DataView*>(DOMArrayB
ufferView::view()); } |
21 DataView* view() { return static_cast<DataView*>(DOMArrayBufferView::view())
; } | 21 DataView* view() { return static_cast<DataView*>(DOMArrayBufferView::view())
; } |
22 | 22 |
23 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; | 23 virtual v8::Local<v8::Object> wrap(v8::Local<v8::Object> creationContext, v8
::Isolate*) override; |
24 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap
perTypeInfo*, v8::Handle<v8::Object> wrapper) override; | 24 virtual v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const Wrapp
erTypeInfo*, v8::Local<v8::Object> wrapper) override; |
25 | 25 |
26 private: | 26 private: |
27 DOMDataView(PassRefPtr<DataView> dataView, PassRefPtr<DOMArrayBuffer> domArr
ayBuffer) | 27 DOMDataView(PassRefPtr<DataView> dataView, PassRefPtr<DOMArrayBuffer> domArr
ayBuffer) |
28 : DOMArrayBufferView(dataView, domArrayBuffer) { } | 28 : DOMArrayBufferView(dataView, domArrayBuffer) { } |
29 }; | 29 }; |
30 | 30 |
31 } // namespace blink | 31 } // namespace blink |
32 | 32 |
33 #endif // DOMDataView_h | 33 #endif // DOMDataView_h |
OLD | NEW |