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

Unified Diff: ppapi/cpp/dev/network_proxy_dev.cc

Issue 16819002: PPAPI: Introduce PPB_NetworkProxy_Dev (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 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
« no previous file with comments | « ppapi/cpp/dev/network_proxy_dev.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/network_proxy_dev.cc
diff --git a/ppapi/cpp/dev/network_proxy_dev.cc b/ppapi/cpp/dev/network_proxy_dev.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eb93731a579be577ccacbeb759d3ae7776334fc8
--- /dev/null
+++ b/ppapi/cpp/dev/network_proxy_dev.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 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.
+
+#include "ppapi/cpp/dev/network_proxy_dev.h"
+
+#include "ppapi/c/dev/ppb_network_proxy_dev.h"
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_NetworkProxy_Dev_0_1>() {
+ return PPB_NETWORKPROXY_DEV_INTERFACE_0_1;
+}
+
+} // namespace
+
+// static
+bool NetworkProxy::IsAvailable() {
+ return has_interface<PPB_NetworkProxy_Dev_0_1>();
+}
+
+// static
+int32_t NetworkProxy::GetProxyForURL(
+ const InstanceHandle& instance,
+ const Var& url,
+ const CompletionCallbackWithOutput<Var>& callback) {
+ if (!has_interface<PPB_NetworkProxy_Dev_0_1>())
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
+
+ return get_interface<PPB_NetworkProxy_Dev_0_1>()->GetProxyForURL(
+ instance.pp_instance(), url.pp_var(),
+ callback.output(), callback.pp_completion_callback());
+}
+
+} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/network_proxy_dev.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698