0
Files
src/ppapi/cpp/network_proxy.cc
Avi Drissman db497b3200 Update copyright headers in pdf/, ppapi/, printing/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c95.

No-Try: true
Bug: 1098010
Change-Id: I6ae92e5d7ccbf73b176588124b2f8b4067f805b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900575
Reviewed-by: Mark Mentovai <mark@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047628}
2022-09-15 19:47:28 +00:00

39 lines
959 B
C++

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/cpp/network_proxy.h"
#include "ppapi/c/ppb_network_proxy.h"
#include "ppapi/cpp/module_impl.h"
namespace pp {
namespace {
template <> const char* interface_name<PPB_NetworkProxy_1_0>() {
return PPB_NETWORKPROXY_INTERFACE_1_0;
}
} // namespace
// static
bool NetworkProxy::IsAvailable() {
return has_interface<PPB_NetworkProxy_1_0>();
}
// static
int32_t NetworkProxy::GetProxyForURL(
const InstanceHandle& instance,
const Var& url,
const CompletionCallbackWithOutput<Var>& callback) {
if (!has_interface<PPB_NetworkProxy_1_0>())
return callback.MayForce(PP_ERROR_NOINTERFACE);
return get_interface<PPB_NetworkProxy_1_0>()->GetProxyForURL(
instance.pp_instance(), url.pp_var(),
callback.output(), callback.pp_completion_callback());
}
} // namespace pp