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_PROXY_PLUGIN_ARRAY_BUFFER_VAR_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_ARRAY_BUFFER_VAR_H_ |
6 #define PPAPI_PROXY_PLUGIN_ARRAY_BUFFER_VAR_H_ | 6 #define PPAPI_PROXY_PLUGIN_ARRAY_BUFFER_VAR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
12 #include "ppapi/shared_impl/var.h" | 12 #include "ppapi/shared_impl/var.h" |
13 | 13 |
14 namespace ppapi { | 14 namespace ppapi { |
15 | 15 |
16 // Represents a plugin-side ArrayBufferVar. In the plugin process, it's | 16 // Represents a plugin-side ArrayBufferVar. In the plugin process, it's |
17 // owned as a vector. | 17 // owned as a vector. |
18 class PluginArrayBufferVar : public ArrayBufferVar { | 18 class PluginArrayBufferVar : public ArrayBufferVar { |
19 public: | 19 public: |
20 explicit PluginArrayBufferVar(uint32 size_in_bytes); | 20 explicit PluginArrayBufferVar(uint32 size_in_bytes); |
21 virtual ~PluginArrayBufferVar(); | 21 virtual ~PluginArrayBufferVar(); |
22 | 22 |
23 // ArrayBufferVar implementation. | 23 // ArrayBufferVar implementation. |
24 virtual void* Map() OVERRIDE; | 24 virtual void* Map() OVERRIDE; |
| 25 virtual void Unmap() OVERRIDE; |
25 virtual uint32 ByteLength() OVERRIDE; | 26 virtual uint32 ByteLength() OVERRIDE; |
26 | 27 |
27 private: | 28 private: |
28 // TODO(dmichael): Use shared memory for this. | 29 // TODO(dmichael): Use shared memory for this. |
29 std::vector<uint8> buffer_; | 30 std::vector<uint8> buffer_; |
30 | 31 |
31 DISALLOW_COPY_AND_ASSIGN(PluginArrayBufferVar); | 32 DISALLOW_COPY_AND_ASSIGN(PluginArrayBufferVar); |
32 }; | 33 }; |
33 | 34 |
34 } // namespace ppapi | 35 } // namespace ppapi |
35 | 36 |
36 #endif // PPAPI_PROXY_PLUGIN_ARRAY_BUFFER_VAR_H_ | 37 #endif // PPAPI_PROXY_PLUGIN_ARRAY_BUFFER_VAR_H_ |
OLD | NEW |