OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/host_array_buffer_var.h" | 5 #include "webkit/plugins/ppapi/host_array_buffer_var.h" |
6 | 6 |
7 using ppapi::ArrayBufferVar; | 7 using ppapi::ArrayBufferVar; |
8 using WebKit::WebArrayBuffer; | 8 using WebKit::WebArrayBuffer; |
9 | 9 |
10 namespace webkit { | 10 namespace webkit { |
11 namespace ppapi { | 11 namespace ppapi { |
12 | 12 |
13 HostArrayBufferVar::HostArrayBufferVar(uint32 size_in_bytes) | 13 HostArrayBufferVar::HostArrayBufferVar(uint32 size_in_bytes) |
14 : buffer_(WebArrayBuffer::create(size_in_bytes, 1 /* element_size */)) { | 14 : buffer_(WebArrayBuffer::create(size_in_bytes, 1 /* element_size */)) { |
15 } | 15 } |
16 | 16 |
17 HostArrayBufferVar::HostArrayBufferVar(const WebArrayBuffer& buffer) | 17 HostArrayBufferVar::HostArrayBufferVar(const WebArrayBuffer& buffer) |
18 : buffer_(buffer) { | 18 : buffer_(buffer) { |
19 } | 19 } |
20 | 20 |
21 HostArrayBufferVar::~HostArrayBufferVar() { | 21 HostArrayBufferVar::~HostArrayBufferVar() { |
22 } | 22 } |
23 | 23 |
24 void* HostArrayBufferVar::Map() { | 24 void* HostArrayBufferVar::Map() { |
25 return buffer_.data(); | 25 return buffer_.data(); |
26 } | 26 } |
27 | 27 |
| 28 void HostArrayBufferVar::Unmap() { |
| 29 // We do not used shared memory on the host side. Nothing to do. |
| 30 } |
| 31 |
28 uint32 HostArrayBufferVar::ByteLength() { | 32 uint32 HostArrayBufferVar::ByteLength() { |
29 return buffer_.byteLength(); | 33 return buffer_.byteLength(); |
30 } | 34 } |
31 | 35 |
32 } // namespace ppapi | 36 } // namespace ppapi |
33 } // namespace webkit | 37 } // namespace webkit |
34 | 38 |
OLD | NEW |