Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: webkit/plugins/ppapi/ppb_host_resolver_private_impl.cc

Issue 9455092: HostResolver is exposed to plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..9e63d3e463d8c20dda0656b7e0455f87bacc4c8a
--- /dev/null
+++ b/webkit/plugins/ppapi/ppb_host_resolver_private_impl.cc
@@ -0,0 +1,38 @@
+// 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) {
+ 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_);
+}
+
+void PPB_HostResolver_Private_Impl::SendResolve(
+ const ::ppapi::HostPortPair& host_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

Powered by Google App Engine
This is Rietveld 408576698