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

Unified Diff: content/browser/renderer_host/pepper/pepper_host_resolver_private_host.h

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: content/browser/renderer_host/pepper/pepper_host_resolver_private_host.h
diff --git a/content/browser/renderer_host/pepper/pepper_host_resolver_private_host.h b/content/browser/renderer_host/pepper/pepper_host_resolver_private_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..705b616db374eadb8253b1af5e85930b66de3e2c
--- /dev/null
+++ b/content/browser/renderer_host/pepper/pepper_host_resolver_private_host.h
@@ -0,0 +1,66 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_HOST_RESOLVER_PRIVATE_HOST_H_
+#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_HOST_RESOLVER_PRIVATE_HOST_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
+#include "content/browser/renderer_host/pepper/pepper_host_resolver_private_shared.h"
+#include "content/common/content_export.h"
+#include "ppapi/host/resource_host.h"
+
+namespace content {
+
+class BrowserPpapiHost;
+class ResourceContext;
+
+class CONTENT_EXPORT PepperHostResolverPrivateHost
+ : public ppapi::host::ResourceHost,
+ public PepperHostResolverPrivateShared {
+public:
+ PepperHostResolverPrivateHost(
+ BrowserPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+ virtual ~PepperHostResolverPrivateHost();
+
+ // ppapi::host::ResourceHost implementation.
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ // PepperHostResolverPrivateShared implementation.
+ virtual void HostResolverSendReply(
+ bool succeeded,
+ const std::string& canonical_name,
+ const std::vector<PP_NetAddress_Private>& net_address_list,
+ const BoundInfo& bound_info) OVERRIDE;
+ virtual void HostResolverSendError(const BoundInfo& bound_info) OVERRIDE;
+ virtual net::HostResolver* GetHostResolver() OVERRIDE;
+
+private:
+ void SetHostResolver(ResourceContext* resource_context);
+
+ int32_t OnMsgResolve(const ppapi::host::HostMessageContext* context,
+ const ppapi::HostPortPair& host_port,
+ const PP_HostResolver_Private_Hint& hint);
+
+ void Resolve(const ppapi::host::ReplyMessageContext& context,
+ const ppapi::HostPortPair& host_port,
+ const PP_HostResolver_Private_Hint& hint);
+
+ bool host_resolver_is_ready() const { return host_resolver_is_ready_; }
+
+ net::HostResolver* host_resolver_;
+ bool host_resolver_is_ready_;
+
+ base::WeakPtrFactory<PepperHostResolverPrivateHost> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperHostResolverPrivateHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_HOST_RESOLVER_PRIVATE_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698