| 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 #include "content/public/browser/pepper_vpn_provider_resource_host_proxy.h" |
| 14 |
| 15 namespace content { |
| 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 // Binds an existing VPN connection in the VpnService. Registers with the |
| 27 // VpnService the Resource host back-end. |
| 28 virtual void Bind(const std::string& host_id, |
| 29 const std::string& configuration_id, |
| 30 const std::string& configuration_name, |
| 31 const SuccessCallback& success, |
| 32 const FailureCallback& failure, |
| 33 std::unique_ptr<PepperVpnProviderResourceHostProxy>) = 0; |
| 34 |
| 35 // Sends an IP packet to the VpnService. |
| 36 virtual void SendPacket(const std::string& host_id, |
| 37 const std::vector<char>& data, |
| 38 const SuccessCallback& success, |
| 39 const FailureCallback& failure) = 0; |
| 40 |
| 41 virtual ~VpnServiceProxy(){}; |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_ |
| OLD | NEW |