| 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 #ifndef PPAPI_WEBKIT_PLUGINS_PPAPI_HOST_ARRAY_BUFFER_VAR_H_ | 5 #ifndef PPAPI_WEBKIT_PLUGINS_PPAPI_HOST_ARRAY_BUFFER_VAR_H_ |
| 6 #define PPAPI_WEBKIT_PLUGINS_PPAPI_HOST_ARRAY_BUFFER_VAR_H_ | 6 #define PPAPI_WEBKIT_PLUGINS_PPAPI_HOST_ARRAY_BUFFER_VAR_H_ |
| 7 | 7 |
| 8 #include "ppapi/shared_impl/var.h" | 8 #include "ppapi/shared_impl/var.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebArrayBuffer.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebArrayBuffer.h" |
| 10 | 10 |
| 11 namespace webkit { | 11 namespace webkit { |
| 12 namespace ppapi { | 12 namespace ppapi { |
| 13 | 13 |
| 14 // Represents a host-side ArrayBufferVar. | 14 // Represents a host-side ArrayBufferVar. |
| 15 class HostArrayBufferVar : public ::ppapi::ArrayBufferVar { | 15 class HostArrayBufferVar : public ::ppapi::ArrayBufferVar { |
| 16 public: | 16 public: |
| 17 explicit HostArrayBufferVar(uint32 size_in_bytes); | 17 explicit HostArrayBufferVar(uint32 size_in_bytes); |
| 18 explicit HostArrayBufferVar(const WebKit::WebArrayBuffer& buffer); | 18 explicit HostArrayBufferVar(const WebKit::WebArrayBuffer& buffer); |
| 19 virtual ~HostArrayBufferVar(); | 19 virtual ~HostArrayBufferVar(); |
| 20 | 20 |
| 21 // ArrayBufferVar implementation. | 21 // ArrayBufferVar implementation. |
| 22 virtual void* Map() OVERRIDE; | 22 virtual void* Map() OVERRIDE; |
| 23 virtual void Unmap() OVERRIDE; |
| 23 virtual uint32 ByteLength() OVERRIDE; | 24 virtual uint32 ByteLength() OVERRIDE; |
| 24 | 25 |
| 25 WebKit::WebArrayBuffer& webkit_buffer() { return buffer_; } | 26 WebKit::WebArrayBuffer& webkit_buffer() { return buffer_; } |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 WebKit::WebArrayBuffer buffer_; | 29 WebKit::WebArrayBuffer buffer_; |
| 29 | 30 |
| 30 DISALLOW_COPY_AND_ASSIGN(HostArrayBufferVar); | 31 DISALLOW_COPY_AND_ASSIGN(HostArrayBufferVar); |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 } // namespace ppapi | 34 } // namespace ppapi |
| 34 } // namespace webkit | 35 } // namespace webkit |
| 35 | 36 |
| 36 #endif // PPAPI_WEBKIT_PLUGINS_PPAPI_HOST_ARRAY_BUFFER_VAR_H_ | 37 #endif // PPAPI_WEBKIT_PLUGINS_PPAPI_HOST_ARRAY_BUFFER_VAR_H_ |
| OLD | NEW |