Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ppapi / proxy / host_resolver_private_resource.cc
blob10ff06a938258404e67512301fc36d0ca5e82a19
1 // Copyright (c) 2012 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.
5 #include "ppapi/proxy/host_resolver_private_resource.h"
7 #include "ppapi/proxy/net_address_resource.h"
8 #include "ppapi/shared_impl/tracked_callback.h"
10 namespace ppapi {
11 namespace proxy {
13 HostResolverPrivateResource::HostResolverPrivateResource(Connection connection,
14 PP_Instance instance)
15 : HostResolverResourceBase(connection, instance, true) {
18 HostResolverPrivateResource::~HostResolverPrivateResource() {
21 thunk::PPB_HostResolver_Private_API*
22 HostResolverPrivateResource::AsPPB_HostResolver_Private_API() {
23 return this;
26 int32_t HostResolverPrivateResource::Resolve(
27 const char* host,
28 uint16_t port,
29 const PP_HostResolver_Private_Hint* hint,
30 scoped_refptr<TrackedCallback> callback) {
31 return ResolveImpl(host, port, hint, callback);
34 PP_Var HostResolverPrivateResource::GetCanonicalName() {
35 return GetCanonicalNameImpl();
38 uint32_t HostResolverPrivateResource::GetSize() {
39 return GetSizeImpl();
42 bool HostResolverPrivateResource::GetNetAddress(
43 uint32_t index,
44 PP_NetAddress_Private* address) {
45 if (!address)
46 return false;
48 scoped_refptr<NetAddressResource> addr_resource = GetNetAddressImpl(index);
49 if (!addr_resource.get())
50 return false;
52 *address = addr_resource->GetNetAddressPrivate();
53 return true;
56 } // namespace proxy
57 } // namespace ppapi