[email protected] | 25651387 | 2012-01-05 15:41:52 | [diff] [blame] | 1 | // Copyright (c) 2012 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] | 7310b16 | 2013-11-25 22:39:15 | [diff] [blame] | 11 | #include "ppapi/c/private/ppb_testing_private.h" |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 12 | #include "ppapi/proxy/interface_proxy.h" |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 13 | #include "ppapi/shared_impl/host_resource.h" |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 14 | |
15 | struct PP_Point; | ||||
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 16 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 17 | namespace ppapi { |
[email protected] | ed33e2e | 2011-11-20 21:18:07 | [diff] [blame] | 18 | |
19 | struct InputEventData; | ||||
20 | |||||
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 21 | namespace proxy { |
22 | |||||
23 | class PPB_Testing_Proxy : public InterfaceProxy { | ||||
24 | public: | ||||
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 25 | PPB_Testing_Proxy(Dispatcher* dispatcher); |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 26 | virtual ~PPB_Testing_Proxy(); |
27 | |||||
[email protected] | 637fc4cd | 2013-12-06 22:08:15 | [diff] [blame] | 28 | static const PPB_Testing_Private* GetProxyInterface(); |
[email protected] | 465faa2 | 2011-02-08 16:31:46 | [diff] [blame] | 29 | |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 30 | // InterfaceProxy implementation. |
[email protected] | a95986a8 | 2010-12-24 06:19:28 | [diff] [blame] | 31 | virtual bool OnMessageReceived(const IPC::Message& msg); |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 32 | |
33 | private: | ||||
34 | // Message handlers. | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 35 | void OnMsgReadImageData(const ppapi::HostResource& device_context_2d, |
36 | const ppapi::HostResource& image, | ||||
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 37 | const PP_Point& top_left, |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 38 | PP_Bool* result); |
[email protected] | 7358d57 | 2011-02-15 18:44:40 | [diff] [blame] | 39 | void OnMsgRunMessageLoop(PP_Instance instance); |
40 | void OnMsgQuitMessageLoop(PP_Instance instance); | ||||
[email protected] | 4614f19 | 2011-01-21 00:26:43 | [diff] [blame] | 41 | void OnMsgGetLiveObjectsForInstance(PP_Instance instance, uint32_t* result); |
tommycli | ee0a49b | 2015-05-05 19:40:49 | [diff] [blame^] | 42 | void OnMsgPostPowerSaverStatus(PP_Instance instance); |
43 | void OnMsgSubscribeToPowerSaverNotifications(PP_Instance instance); | ||||
[email protected] | ed33e2e | 2011-11-20 21:18:07 | [diff] [blame] | 44 | void OnMsgSimulateInputEvent(PP_Instance instance, |
45 | const ppapi::InputEventData& input_event); | ||||
[email protected] | 38f428f1 | 2013-04-19 14:46:05 | [diff] [blame] | 46 | void OnMsgSetMinimumArrayBufferSizeForShmem(uint32_t threshold); |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 47 | |
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 48 | // When this proxy is in the host side, this value caches the interface |
49 | // pointer so we don't have to retrieve it from the dispatcher each time. | ||||
50 | // In the plugin, this value is always NULL. | ||||
[email protected] | 7310b16 | 2013-11-25 22:39:15 | [diff] [blame] | 51 | const PPB_Testing_Private* ppb_testing_impl_; |
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 52 | |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 53 | DISALLOW_COPY_AND_ASSIGN(PPB_Testing_Proxy); |
54 | }; | ||||
55 | |||||
56 | } // namespace proxy | ||||
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 57 | } // namespace ppapi |
[email protected] | 1054c07 | 2010-11-05 22:52:48 | [diff] [blame] | 58 | |
59 | #endif // PPAPI_PROXY_PPB_TESTING_PROXY_H_ |