[email protected] | 6a160e7 | 2011-05-04 20:23:45 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [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_PPP_INSTANCE_PROXY_H_ | ||||
6 | #define PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ | ||||
7 | |||||
dcheng | ced9224 | 2016-04-07 00:00:12 | [diff] [blame] | 8 | #include <memory> |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 9 | #include <string> |
10 | #include <vector> | ||||
11 | |||||
12 | #include "ppapi/c/pp_instance.h" | ||||
13 | #include "ppapi/c/pp_resource.h" | ||||
14 | #include "ppapi/c/pp_var.h" | ||||
15 | #include "ppapi/proxy/interface_proxy.h" | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 16 | #include "ppapi/shared_impl/host_resource.h" |
[email protected] | 912f3d6c | 2011-06-29 18:26:36 | [diff] [blame] | 17 | #include "ppapi/shared_impl/ppp_instance_combined.h" |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 18 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 19 | namespace ppapi { |
[email protected] | e8f07ac | 2012-01-03 17:43:36 | [diff] [blame] | 20 | |
[email protected] | 47cb253f | 2013-05-16 01:50:40 | [diff] [blame] | 21 | struct URLResponseInfoData; |
[email protected] | e8f07ac | 2012-01-03 17:43:36 | [diff] [blame] | 22 | struct ViewData; |
23 | |||||
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 24 | namespace proxy { |
25 | |||||
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 26 | class PPP_Instance_Proxy : public InterfaceProxy { |
27 | public: | ||||
[email protected] | 0a6d5f6 | 2011-11-11 08:04:07 | [diff] [blame] | 28 | explicit PPP_Instance_Proxy(Dispatcher* dispatcher); |
Lei Zhang | 94f57fe3 | 2017-08-30 23:58:24 | [diff] [blame] | 29 | ~PPP_Instance_Proxy() override; |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 30 | |
[email protected] | e8f07ac | 2012-01-03 17:43:36 | [diff] [blame] | 31 | static const PPP_Instance* GetInstanceInterface(); |
[email protected] | 912f3d6c | 2011-06-29 18:26:36 | [diff] [blame] | 32 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 33 | PPP_Instance_Combined* ppp_instance_target() const { |
[email protected] | 912f3d6c | 2011-06-29 18:26:36 | [diff] [blame] | 34 | return combined_interface_.get(); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 35 | } |
36 | |||||
37 | // InterfaceProxy implementation. | ||||
Lei Zhang | 94f57fe3 | 2017-08-30 23:58:24 | [diff] [blame] | 38 | bool OnMessageReceived(const IPC::Message& msg) override; |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 39 | |
40 | private: | ||||
41 | // Message handlers. | ||||
[email protected] | e8f07ac | 2012-01-03 17:43:36 | [diff] [blame] | 42 | void OnPluginMsgDidCreate(PP_Instance instance, |
43 | const std::vector<std::string>& argn, | ||||
44 | const std::vector<std::string>& argv, | ||||
45 | PP_Bool* result); | ||||
46 | void OnPluginMsgDidDestroy(PP_Instance instance); | ||||
47 | void OnPluginMsgDidChangeView(PP_Instance instance, | ||||
48 | const ViewData& new_data, | ||||
49 | PP_Bool flash_fullscreen); | ||||
50 | void OnPluginMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus); | ||||
51 | void OnPluginMsgHandleDocumentLoad(PP_Instance instance, | ||||
[email protected] | 47cb253f | 2013-05-16 01:50:40 | [diff] [blame] | 52 | int pending_loader_host_id, |
53 | const URLResponseInfoData& data); | ||||
54 | |||||
dcheng | ced9224 | 2016-04-07 00:00:12 | [diff] [blame] | 55 | std::unique_ptr<PPP_Instance_Combined> combined_interface_; |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 56 | }; |
57 | |||||
58 | } // namespace proxy | ||||
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 59 | } // namespace ppapi |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 60 | |
61 | #endif // PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ |