OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can | 2 // Use of this source code is governed by a BSD-style license that can |
3 // be found in the LICENSE file. | 3 // be found in the LICENSE file. |
4 | 4 |
5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_IMAGE_DATA_H_ | 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_IMAGE_DATA_H_ |
6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_IMAGE_DATA_H_ | 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_IMAGE_DATA_H_ |
7 | 7 |
8 #include "native_client/src/include/nacl_macros.h" | 8 #include "native_client/src/include/nacl_macros.h" |
9 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" | 9 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" |
10 #include "ppapi/c/ppb_image_data.h" | 10 #include "ppapi/c/ppb_image_data.h" |
11 | 11 |
12 namespace ppapi_proxy { | 12 namespace ppapi_proxy { |
13 | 13 |
14 // Implements the untrusted side of the PPB_ImageData interface. | 14 // Implements the untrusted side of the PPB_ImageData interface. |
15 class PluginImageData : public PluginResource { | 15 class PluginImageData : public PluginResource { |
16 public: | 16 public: |
17 PluginImageData(); | 17 PluginImageData(); |
| 18 virtual ~PluginImageData(); |
| 19 |
18 static const PPB_ImageData* GetInterface(); | 20 static const PPB_ImageData* GetInterface(); |
19 | 21 |
20 bool InitFromBrowserResource(PP_Resource resource); | 22 bool InitFromBrowserResource(PP_Resource resource); |
21 void* Map(); | 23 void* Map(); |
22 void Unmap(); | 24 void Unmap(); |
23 | 25 |
24 const PP_ImageDataDesc& desc() const { return desc_; } | 26 const PP_ImageDataDesc& desc() const { return desc_; } |
25 private: | 27 private: |
26 IMPLEMENT_RESOURCE(PluginImageData); | 28 IMPLEMENT_RESOURCE(PluginImageData); |
27 NACL_DISALLOW_COPY_AND_ASSIGN(PluginImageData); | 29 NACL_DISALLOW_COPY_AND_ASSIGN(PluginImageData); |
28 PP_ImageDataDesc desc_; | 30 PP_ImageDataDesc desc_; |
29 int shm_fd_; | 31 int shm_fd_; |
30 int32_t shm_size_; | 32 int32_t shm_size_; |
31 void* addr_; | 33 void* addr_; |
32 }; | 34 }; |
33 | 35 |
34 } // namespace ppapi_proxy | 36 } // namespace ppapi_proxy |
35 | 37 |
36 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_IMAGE_DATA_H_ | 38 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_IMAGE_DATA_H_ |
OLD | NEW |