[email protected] | 4614f19 | 2011-01-21 00:26:43 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 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_PROXY_PPB_TESTING_PROXY_H_ | ||||
6 | #define PPAPI_PROXY_PPB_TESTING_PROXY_H_ | ||||
7 | |||||
8 | #include "base/basictypes.h" | ||||
[email protected] | 4614f19 | 2011-01-21 00:26:43 | [diff] [blame] | 9 | #include "ppapi/c/pp_instance.h" |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 10 | #include "ppapi/c/pp_resource.h" |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 11 | #include "ppapi/proxy/interface_proxy.h" |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 12 | #include "ppapi/shared_impl/host_resource.h" |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 13 | |
14 | struct PP_Point; | ||||
15 | struct PPB_Testing_Dev; | ||||
16 | |||||
17 | namespace pp { | ||||
18 | namespace proxy { | ||||
19 | |||||
20 | class PPB_Testing_Proxy : public InterfaceProxy { | ||||
21 | public: | ||||
22 | PPB_Testing_Proxy(Dispatcher* dispatcher, const void* target_interface); | ||||
23 | virtual ~PPB_Testing_Proxy(); | ||||
24 | |||||
[email protected] | 465faa2 | 2011-02-08 16:31:46 | [diff] [blame] | 25 | static const Info* GetInfo(); |
26 | |||||
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 27 | const PPB_Testing_Dev* ppb_testing_target() const { |
28 | return static_cast<const PPB_Testing_Dev*>(target_interface()); | ||||
29 | } | ||||
30 | |||||
31 | // InterfaceProxy implementation. | ||||
[email protected] | a95986a8 | 2010-12-24 06:19:28 | [diff] [blame] | 32 | virtual bool OnMessageReceived(const IPC::Message& msg); |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 33 | |
34 | private: | ||||
35 | // Message handlers. | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 36 | void OnMsgReadImageData(const ppapi::HostResource& device_context_2d, |
37 | const ppapi::HostResource& image, | ||||
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 38 | const PP_Point& top_left, |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 39 | PP_Bool* result); |
[email protected] | 7358d57 | 2011-02-15 18:44:40 | [diff] [blame] | 40 | void OnMsgRunMessageLoop(PP_Instance instance); |
41 | void OnMsgQuitMessageLoop(PP_Instance instance); | ||||
[email protected] | 4614f19 | 2011-01-21 00:26:43 | [diff] [blame] | 42 | void OnMsgGetLiveObjectsForInstance(PP_Instance instance, uint32_t* result); |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 43 | |
44 | DISALLOW_COPY_AND_ASSIGN(PPB_Testing_Proxy); | ||||
45 | }; | ||||
46 | |||||
47 | } // namespace proxy | ||||
48 | } // namespace pp | ||||
49 | |||||
50 | #endif // PPAPI_PROXY_PPB_TESTING_PROXY_H_ |