OLD | NEW |
1 // Copyright (c) 2010 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_PPB_IMAGE_DATA_PROXY_H_ | 5 #ifndef PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_module.h" | 11 #include "ppapi/c/pp_module.h" |
11 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
12 #include "ppapi/c/pp_size.h" | 13 #include "ppapi/c/pp_size.h" |
13 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
14 #include "ppapi/proxy/interface_proxy.h" | 15 #include "ppapi/proxy/interface_proxy.h" |
15 #include "ppapi/proxy/image_data.h" | 16 #include "ppapi/proxy/serialized_structs.h" |
16 | |
17 | 17 |
18 struct PPB_ImageData; | 18 struct PPB_ImageData; |
19 | 19 |
20 namespace pp { | 20 namespace pp { |
21 namespace proxy { | 21 namespace proxy { |
22 | 22 |
| 23 class HostResource; |
| 24 |
23 class PPB_ImageData_Proxy : public InterfaceProxy { | 25 class PPB_ImageData_Proxy : public InterfaceProxy { |
24 public: | 26 public: |
25 PPB_ImageData_Proxy(Dispatcher* dispatcher, const void* target_interface); | 27 PPB_ImageData_Proxy(Dispatcher* dispatcher, const void* target_interface); |
26 virtual ~PPB_ImageData_Proxy(); | 28 virtual ~PPB_ImageData_Proxy(); |
27 | 29 |
28 const PPB_ImageData* ppb_image_data_target() const { | 30 const PPB_ImageData* ppb_image_data_target() const { |
29 return static_cast<const PPB_ImageData*>(target_interface()); | 31 return static_cast<const PPB_ImageData*>(target_interface()); |
30 } | 32 } |
31 | 33 |
32 // InterfaceProxy implementation. | 34 // InterfaceProxy implementation. |
33 virtual const void* GetSourceInterface() const; | 35 virtual const void* GetSourceInterface() const; |
34 virtual InterfaceID GetInterfaceId() const; | 36 virtual InterfaceID GetInterfaceId() const; |
35 virtual bool OnMessageReceived(const IPC::Message& msg); | 37 virtual bool OnMessageReceived(const IPC::Message& msg); |
36 | 38 |
37 private: | 39 private: |
38 // Message handlers. | 40 // Message handlers. |
39 void OnMsgGetNativeImageDataFormat(int32* result); | 41 void OnMsgGetNativeImageDataFormat(int32* result); |
40 void OnMsgIsImageDataFormatSupported(int32 format, PP_Bool* result); | 42 void OnMsgIsImageDataFormatSupported(int32 format, PP_Bool* result); |
41 void OnMsgCreate(PP_Instance instance, | 43 void OnMsgCreate(PP_Instance instance, |
42 int32_t format, | 44 int32_t format, |
43 const PP_Size& size, | 45 const PP_Size& size, |
44 PP_Bool init_to_zero, | 46 PP_Bool init_to_zero, |
45 PP_Resource* result, | 47 HostResource* result, |
46 std::string* image_data_desc, | 48 std::string* image_data_desc, |
47 ImageHandle* result_image_handle); | 49 ImageHandle* result_image_handle); |
48 }; | 50 }; |
49 | 51 |
50 } // namespace proxy | 52 } // namespace proxy |
51 } // namespace pp | 53 } // namespace pp |
52 | 54 |
53 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 55 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
OLD | NEW |