Index: webkit/plugins/ppapi/ppb_host_resolver_private_impl.cc |
diff --git a/webkit/plugins/ppapi/ppb_host_resolver_private_impl.cc b/webkit/plugins/ppapi/ppb_host_resolver_private_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7c51eb6d0435f04843f5ed7ce075d608a80da8be |
--- /dev/null |
+++ b/webkit/plugins/ppapi/ppb_host_resolver_private_impl.cc |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "webkit/plugins/ppapi/ppb_host_resolver_private_impl.h" |
+ |
+#include "webkit/plugins/ppapi/host_globals.h" |
+#include "webkit/plugins/ppapi/plugin_delegate.h" |
+#include "webkit/plugins/ppapi/resource_helper.h" |
+ |
+namespace webkit { |
+namespace ppapi { |
+ |
+PPB_HostResolver_Private_Impl::PPB_HostResolver_Private_Impl( |
+ 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.
|
+ PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
+ if (plugin_delegate) |
+ plugin_delegate->RegisterHostResolver(this, host_resolver_id_); |
+} |
+ |
+PPB_HostResolver_Private_Impl::~PPB_HostResolver_Private_Impl() { |
+ PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
+ if (plugin_delegate) |
+ plugin_delegate->UnregisterHostResolver(host_resolver_id_); |
+} |
+ |
+PP_Resource PPB_HostResolver_Private_Impl::CreateResource( |
+ PP_Instance instance) { |
+ return (new PPB_HostResolver_Private_Impl(instance))->GetReference(); |
+} |
+ |
+void PPB_HostResolver_Private_Impl::SendResolve( |
+ const std::string& host, |
+ uint16_t port, |
+ const PP_HostResolver_Private_Hint* hint) { |
+ PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
+ if (!plugin_delegate) |
+ return; |
+ plugin_delegate->HostResolverResolve(host_resolver_id_, host, port, hint); |
+} |
+ |
+} // namespace ppapi |
+} // namespace webkit |