| 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 #include "core/dom/DOMDataView.h" | 5 #include "core/dom/DOMDataView.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/DOMDataStore.h" | 7 #include "bindings/core/v8/DOMDataStore.h" |
| 8 #include "bindings/core/v8/V8ArrayBuffer.h" | 8 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 9 #include "platform/CheckedInt.h" | 9 #include "platform/CheckedInt.h" |
| 10 #include "wtf/ArrayBufferView.h" | 10 #include "wtf/typed_arrays/ArrayBufferView.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class DataView final : public ArrayBufferView { | 16 class DataView final : public ArrayBufferView { |
| 17 public: | 17 public: |
| 18 static PassRefPtr<DataView> create(ArrayBuffer* buffer, unsigned byteOffset,
unsigned byteLength) | 18 static PassRefPtr<DataView> create(ArrayBuffer* buffer, unsigned byteOffset,
unsigned byteLength) |
| 19 { | 19 { |
| 20 RELEASE_ASSERT(byteOffset <= buffer->byteLength()); | 20 RELEASE_ASSERT(byteOffset <= buffer->byteLength()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (v8Buffer.IsEmpty()) | 61 if (v8Buffer.IsEmpty()) |
| 62 return v8::Local<v8::Object>(); | 62 return v8::Local<v8::Object>(); |
| 63 DCHECK(v8Buffer->IsArrayBuffer()); | 63 DCHECK(v8Buffer->IsArrayBuffer()); |
| 64 | 64 |
| 65 v8::Local<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffe
r>(), byteOffset(), byteLength()); | 65 v8::Local<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffe
r>(), byteOffset(), byteLength()); |
| 66 | 66 |
| 67 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); | 67 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| OLD | NEW |