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

Unified Diff: ppapi/proxy/host_resolver_private_resource.cc

Issue 11411357: PPB_HostResolver_Private is switched to the new Pepper proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed MockPluginDelegate. Created 8 years 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: ppapi/proxy/host_resolver_private_resource.cc
diff --git a/ppapi/proxy/host_resolver_private_resource.cc b/ppapi/proxy/host_resolver_private_resource.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1ff4370b9174020e41eb64a05aa708475e5cc468
--- /dev/null
+++ b/ppapi/proxy/host_resolver_private_resource.cc
@@ -0,0 +1,46 @@
+// 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 "ppapi/proxy/host_resolver_private_resource.h"
+
+#include "ppapi/proxy/ppapi_messages.h"
+
+namespace ppapi {
+namespace proxy {
+
+HostResolverPrivateResource::HostResolverPrivateResource(Connection connection,
+ PP_Instance instance)
+ : PluginResource(connection, instance) {
+ SendCreate(BROWSER, PpapiHostMsg_HostResolverPrivate_Create());
+}
+
+HostResolverPrivateResource::~HostResolverPrivateResource() {
+}
+
+thunk::PPB_HostResolver_Private_API*
+HostResolverPrivateResource::AsPPB_HostResolver_Private_API() {
+ return this;
+}
+
+void HostResolverPrivateResource::SendResolve(
+ const HostPortPair& host_port,
+ const PP_HostResolver_Private_Hint* hint) {
+ PpapiHostMsg_HostResolverPrivate_Resolve msg(host_port, *hint);
+ Call<PpapiPluginMsg_HostResolverPrivate_ResolveReply>(
+ BROWSER,
+ msg,
+ base::Bind(&HostResolverPrivateResource::OnPluginMsgResolveReply,
+ base::Unretained(this)));
+}
+
+void HostResolverPrivateResource::OnPluginMsgResolveReply(
+ const ResourceMessageReplyParams& params,
+ bool succeeded,
+ const std::string& canonical_name,
+ const std::vector<PP_NetAddress_Private>& net_address_list) {
+ OnResolveCompleted(succeeded, canonical_name, net_address_list);
+}
+
+} // namespace proxy
+} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698