Chromium Code Reviews| 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) : ::ppapi::PPB_HostResolver_Shared(instance) { | |
|
brettw
2012/02/28 17:02:50
Only put initializers at the end of the line if ev
ygorshenin1
2012/02/29 14:02:37
Done.
| |
| 16 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | |
| 17 if (plugin_delegate) | |
| 18 plugin_delegate->RegisterHostResolver(this, host_resolver_id_); | |
| 19 } | |
| 20 | |
| 21 PPB_HostResolver_Private_Impl::~PPB_HostResolver_Private_Impl() { | |
| 22 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | |
| 23 if (plugin_delegate) | |
| 24 plugin_delegate->UnregisterHostResolver(host_resolver_id_); | |
| 25 } | |
| 26 | |
| 27 PP_Resource PPB_HostResolver_Private_Impl::CreateResource( | |
| 28 PP_Instance instance) { | |
| 29 return (new PPB_HostResolver_Private_Impl(instance))->GetReference(); | |
| 30 } | |
| 31 | |
| 32 void PPB_HostResolver_Private_Impl::SendResolve( | |
| 33 const std::string& host, | |
| 34 uint16_t port, | |
| 35 const PP_HostResolver_Private_Hint* hint) { | |
| 36 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | |
| 37 if (!plugin_delegate) | |
| 38 return; | |
| 39 plugin_delegate->HostResolverResolve(host_resolver_id_, host, port, hint); | |
| 40 } | |
| 41 | |
| 42 } // namespace ppapi | |
| 43 } // namespace webkit | |
| OLD | NEW |