OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/callback.h" |
| 12 #include "content/common/content_export.h" |
| 13 |
| 14 namespace content { |
| 15 class PepperVpnProviderResourceHostProxy; |
| 16 |
| 17 // Describes interface for communication with an external VpnService. |
| 18 // All the methods below can only be called on the UI thread. |
| 19 class CONTENT_EXPORT VpnServiceProxy { |
| 20 public: |
| 21 using SuccessCallback = base::Closure; |
| 22 using FailureCallback = |
| 23 base::Callback<void(const std::string& error_name, |
| 24 const std::string& error_message)>; |
| 25 |
| 26 virtual ~VpnServiceProxy() {} |
| 27 |
| 28 // Binds an existing VPN connection in the VpnService. Registers with the |
| 29 // VpnService the Resource host back-end. |
| 30 virtual void Bind(const std::string& host_id, |
| 31 const std::string& configuration_id, |
| 32 const std::string& configuration_name, |
| 33 const SuccessCallback& success, |
| 34 const FailureCallback& failure, |
| 35 std::unique_ptr<PepperVpnProviderResourceHostProxy> |
| 36 pepper_vpn_provider_proxy) = 0; |
| 37 |
| 38 // Sends an IP packet to the VpnService. |
| 39 virtual void SendPacket(const std::string& host_id, |
| 40 const std::vector<char>& data, |
| 41 const SuccessCallback& success, |
| 42 const FailureCallback& failure) = 0; |
| 43 }; |
| 44 |
| 45 } // namespace content |
| 46 |
| 47 #endif // CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_ |
OLD | NEW |