OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "ppapi/proxy/host_resolver_private_resource.h" |
| 6 |
| 7 #include "ppapi/proxy/ppapi_messages.h" |
| 8 |
| 9 namespace ppapi { |
| 10 namespace proxy { |
| 11 |
| 12 HostResolverPrivateResource::HostResolverPrivateResource(Connection connection, |
| 13 PP_Instance instance) |
| 14 : PluginResource(connection, instance) { |
| 15 SendCreate(BROWSER, PpapiHostMsg_HostResolverPrivate_Create()); |
| 16 } |
| 17 |
| 18 HostResolverPrivateResource::~HostResolverPrivateResource() { |
| 19 } |
| 20 |
| 21 thunk::PPB_HostResolver_Private_API* |
| 22 HostResolverPrivateResource::AsPPB_HostResolver_Private_API() { |
| 23 return this; |
| 24 } |
| 25 |
| 26 void HostResolverPrivateResource::SendResolve( |
| 27 const HostPortPair& host_port, |
| 28 const PP_HostResolver_Private_Hint* hint) { |
| 29 PpapiHostMsg_HostResolverPrivate_Resolve msg(host_port, *hint); |
| 30 Call<PpapiPluginMsg_HostResolverPrivate_ResolveReply>( |
| 31 BROWSER, |
| 32 msg, |
| 33 base::Bind(&HostResolverPrivateResource::OnPluginMsgResolveReply, |
| 34 base::Unretained(this))); |
| 35 } |
| 36 |
| 37 void HostResolverPrivateResource::OnPluginMsgResolveReply( |
| 38 const ResourceMessageReplyParams& params, |
| 39 bool succeeded, |
| 40 const std::string& canonical_name, |
| 41 const std::vector<PP_NetAddress_Private>& net_address_list) { |
| 42 OnResolveCompleted(succeeded, canonical_name, net_address_list); |
| 43 } |
| 44 |
| 45 } // namespace proxy |
| 46 } // namespace ppapi |
OLD | NEW |