Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1400)

Unified Diff: content/public/browser/vpn_service_proxy.h

Issue 1988613005: ppapi: PPB_VpnProvider: Implement Service Helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vpn-permission
Patch Set: Refactor patch. Communication now handled using ContentBrowserClient. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/vpn_service_proxy.h
diff --git a/content/public/browser/vpn_service_proxy.h b/content/public/browser/vpn_service_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..accf10026400261fded7dfd500bd6a74a731c228
--- /dev/null
+++ b/content/public/browser/vpn_service_proxy.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_
+#define CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_
+
+#include <memory>
+#include <vector>
+
+#include "base/callback.h"
+#include "content/common/content_export.h"
+#include "content/public/browser/pepper_vpn_provider_resource_host_proxy.h"
+
+namespace content {
+
+// Describes interface for communication with an external VpnService.
+// All the methods below can only be called on the UI thread.
+class CONTENT_EXPORT VpnServiceProxy {
+ public:
+ using SuccessCallback = base::Closure;
+ using FailureCallback =
+ base::Callback<void(const std::string& error_name,
+ const std::string& error_message)>;
+
+ // Binds an existing VPN connection in the VpnService. Registers with the
+ // VpnService the Resource host back-end.
+ virtual void Bind(const std::string& host_id,
+ const std::string& configuration_id,
+ const std::string& configuration_name,
+ const SuccessCallback& success,
+ const FailureCallback& failure,
+ std::unique_ptr<PepperVpnProviderResourceHostProxy>) = 0;
+
+ // Sends an IP packet to the VpnService.
+ virtual void SendPacket(const std::string& host_id,
+ const std::vector<char>& data,
+ const SuccessCallback& success,
+ const FailureCallback& failure) = 0;
+
+ virtual ~VpnServiceProxy(){};
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_VPN_SERVICE_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698