| 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 "webkit/plugins/ppapi/ppb_host_resolver_private_impl.h" | |
| 6 | |
| 7 #include "webkit/plugins/ppapi/host_globals.h" | |
| 8 #include "webkit/plugins/ppapi/plugin_delegate.h" | |
| 9 #include "webkit/plugins/ppapi/resource_helper.h" | |
| 10 | |
| 11 namespace webkit { | |
| 12 namespace ppapi { | |
| 13 | |
| 14 PPB_HostResolver_Private_Impl::PPB_HostResolver_Private_Impl( | |
| 15 PP_Instance instance) | |
| 16 : ::ppapi::PPB_HostResolver_Shared(instance) { | |
| 17 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | |
| 18 if (plugin_delegate) | |
| 19 plugin_delegate->RegisterHostResolver(this, host_resolver_id_); | |
| 20 } | |
| 21 | |
| 22 PPB_HostResolver_Private_Impl::~PPB_HostResolver_Private_Impl() { | |
| 23 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | |
| 24 if (plugin_delegate) | |
| 25 plugin_delegate->UnregisterHostResolver(host_resolver_id_); | |
| 26 } | |
| 27 | |
| 28 void PPB_HostResolver_Private_Impl::SendResolve( | |
| 29 const ::ppapi::HostPortPair& host_port, | |
| 30 const PP_HostResolver_Private_Hint* hint) { | |
| 31 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | |
| 32 if (!plugin_delegate) | |
| 33 return; | |
| 34 plugin_delegate->HostResolverResolve(host_resolver_id_, host_port, hint); | |
| 35 } | |
| 36 | |
| 37 } // namespace ppapi | |
| 38 } // namespace webkit | |
| OLD | NEW |