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