Chromium Code Reviews| Index: content/browser/renderer_host/pepper/pepper_host_resolver_private_shared.h |
| diff --git a/content/browser/renderer_host/pepper/pepper_host_resolver_private_shared.h b/content/browser/renderer_host/pepper/pepper_host_resolver_private_shared.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..aa584e0bb4d4034f3bba33861c6f93d8cdae8ba8 |
| --- /dev/null |
| +++ b/content/browser/renderer_host/pepper/pepper_host_resolver_private_shared.h |
| @@ -0,0 +1,68 @@ |
| +// 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_SHARED_H_ |
| +#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_HOST_RESOLVER_PRIVATE_SHARED_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "ppapi/host/host_message_context.h" |
| + |
| +struct PP_HostResolver_Private_Hint; |
| +struct PP_NetAddress_Private; |
| + |
| +namespace net { |
| +class AddressList; |
| +class HostResolver; |
| +} |
| + |
| +namespace ppapi { |
| +struct HostPortPair; |
| +} |
| + |
| +namespace content { |
| + |
| +class PepperHostResolverPrivateShared { |
|
yzshen1
2012/12/20 20:00:20
What not merging this into the host?
ygorshenin1
2012/12/21 12:53:26
Done.
|
| + public: |
| + struct BoundInfo { |
| + explicit BoundInfo(const ppapi::host::ReplyMessageContext& reply_context) |
| + : reply_context(reply_context) { |
| + } |
| + |
| + ppapi::host::ReplyMessageContext reply_context; |
| + }; |
| + |
| + PepperHostResolverPrivateShared(); |
| + virtual ~PepperHostResolverPrivateShared(); |
| + |
| + void HostResolverResolve(const BoundInfo& bound_info, |
| + const ppapi::HostPortPair& host_port, |
| + const PP_HostResolver_Private_Hint& hint); |
| + |
| + virtual void HostResolverSendReply( |
| + bool succeeded, |
| + const std::string& canonical_name, |
| + const std::vector<PP_NetAddress_Private>& net_address_list, |
| + const BoundInfo& bound_info) = 0; |
| + |
| + virtual void HostResolverSendError(const BoundInfo& bound_info) = 0; |
| + |
| + virtual net::HostResolver* GetHostResolver() = 0; |
| + |
| +private: |
| + void OnLookupFinished(int result, |
| + const net::AddressList& addresses, |
| + const BoundInfo& bound_info); |
| + |
| + base::WeakPtrFactory<PepperHostResolverPrivateShared> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PepperHostResolverPrivateShared); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_HOST_RESOLVER_PRIVATE_SHARED_H_ |