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