[email protected] | 43a4020 | 2010-11-12 16:25:01 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef PPAPI_PPB_BUFFER_PROXY_H_ | ||||
6 | #define PPAPI_PPB_BUFFER_PROXY_H_ | ||||
7 | |||||
[email protected] | 859a7f3 | 2011-01-15 03:44:13 | [diff] [blame] | 8 | #include "ppapi/c/pp_instance.h" |
[email protected] | 43a4020 | 2010-11-12 16:25:01 | [diff] [blame] | 9 | #include "ppapi/proxy/interface_proxy.h" |
10 | |||||
11 | struct PPB_Buffer_Dev; | ||||
12 | |||||
13 | namespace pp { | ||||
14 | namespace proxy { | ||||
15 | |||||
[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 16 | class HostResource; |
17 | |||||
[email protected] | 43a4020 | 2010-11-12 16:25:01 | [diff] [blame] | 18 | class PPB_Buffer_Proxy : public InterfaceProxy { |
19 | public: | ||||
20 | PPB_Buffer_Proxy(Dispatcher* dispatcher, const void* target_interface); | ||||
21 | virtual ~PPB_Buffer_Proxy(); | ||||
22 | |||||
[email protected] | 465faa2 | 2011-02-08 16:31:46 | [diff] [blame] | 23 | static const Info* GetInfo(); |
24 | |||||
[email protected] | 9815108e | 2011-05-27 21:50:28 | [diff] [blame^] | 25 | static PP_Resource CreateProxyResource(PP_Instance instance, |
26 | uint32_t size); | ||||
27 | |||||
[email protected] | 43a4020 | 2010-11-12 16:25:01 | [diff] [blame] | 28 | const PPB_Buffer_Dev* ppb_buffer_target() const { |
29 | return static_cast<const PPB_Buffer_Dev*>(target_interface()); | ||||
30 | } | ||||
31 | |||||
32 | // InterfaceProxy implementation. | ||||
[email protected] | a95986a8 | 2010-12-24 06:19:28 | [diff] [blame] | 33 | virtual bool OnMessageReceived(const IPC::Message& msg); |
[email protected] | 43a4020 | 2010-11-12 16:25:01 | [diff] [blame] | 34 | |
35 | private: | ||||
36 | // Message handlers. | ||||
[email protected] | 859a7f3 | 2011-01-15 03:44:13 | [diff] [blame] | 37 | void OnMsgCreate(PP_Instance instance, |
[email protected] | 867b76d63 | 2010-12-02 00:09:07 | [diff] [blame] | 38 | uint32_t size, |
[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 39 | HostResource* result_resource, |
[email protected] | 867b76d63 | 2010-12-02 00:09:07 | [diff] [blame] | 40 | int* result_shm_handle); |
[email protected] | 43a4020 | 2010-11-12 16:25:01 | [diff] [blame] | 41 | }; |
42 | |||||
43 | } // namespace proxy | ||||
44 | } // namespace pp | ||||
45 | |||||
46 | #endif // PPAPI_PPB_BUFFER_PROXY_H_ |