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