Avi Drissman | db497b3 | 2022-09-15 19:47:28 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [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_NETWORK_PROXY_RESOURCE_H_ |
| 6 | #define PPAPI_PROXY_NETWORK_PROXY_RESOURCE_H_ |
| 7 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [diff] [blame] | 10 | #include "ppapi/proxy/plugin_resource.h" |
| 11 | #include "ppapi/proxy/ppapi_proxy_export.h" |
| 12 | #include "ppapi/thunk/ppb_network_proxy_api.h" |
| 13 | |
| 14 | namespace ppapi { |
| 15 | namespace proxy { |
| 16 | |
| 17 | // The proxy-side resource for PPB_NetworkProxy. |
| 18 | class PPAPI_PROXY_EXPORT NetworkProxyResource |
| 19 | : public PluginResource, |
| 20 | public thunk::PPB_NetworkProxy_API { |
| 21 | public: |
| 22 | NetworkProxyResource(Connection connection, PP_Instance instance); |
Peter Boström | 3d5b3cb | 2021-09-23 21:35:45 | [diff] [blame] | 23 | |
| 24 | NetworkProxyResource(const NetworkProxyResource&) = delete; |
| 25 | NetworkProxyResource& operator=(const NetworkProxyResource&) = delete; |
| 26 | |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 27 | ~NetworkProxyResource() override; |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [diff] [blame] | 28 | |
| 29 | private: |
| 30 | // Resource implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 31 | thunk::PPB_NetworkProxy_API* AsPPB_NetworkProxy_API() override; |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [diff] [blame] | 32 | |
| 33 | // PPB_NetworkProxy_API implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 34 | int32_t GetProxyForURL( |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [diff] [blame] | 35 | PP_Instance instance, |
| 36 | PP_Var url, |
| 37 | PP_Var* proxy_string, |
mostynb | 699af3c | 2014-10-06 18:03:34 | [diff] [blame] | 38 | scoped_refptr<TrackedCallback> callback) override; |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [diff] [blame] | 39 | |
| 40 | void OnPluginMsgGetProxyForURLReply(PP_Var* proxy_string_out_param, |
| 41 | scoped_refptr<TrackedCallback> callback, |
| 42 | const ResourceMessageReplyParams& params, |
| 43 | const std::string& proxy_string); |
[email protected] | 226dea4 | 2013-06-24 21:05:36 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | } // namespace proxy |
| 47 | } // namespace ppapi |
| 48 | |
| 49 | #endif // PPAPI_PROXY_NETWORK_PROXY_RESOURCE_H_ |