| Index: chrome/browser/local_discovery/privet_http_asynchronous_factory.h
|
| diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory.h b/chrome/browser/local_discovery/privet_http_asynchronous_factory.h
|
| index c02dbed35d73b28b074aa0c31b976c7451d28f67..2ebce27420c1e2c216ed79c4ec6aedfa523411ad 100644
|
| --- a/chrome/browser/local_discovery/privet_http_asynchronous_factory.h
|
| +++ b/chrome/browser/local_discovery/privet_http_asynchronous_factory.h
|
| @@ -7,67 +7,39 @@
|
|
|
| #include <string>
|
|
|
| -#include "chrome/browser/local_discovery/privet_http.h"
|
| -#include "chrome/browser/local_discovery/privet_http_impl.h"
|
| -#include "chrome/common/local_discovery/service_discovery_client.h"
|
| +#include "base/callback.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| +namespace net {
|
| +class HostPortPair;
|
| +class URLRequestContextGetter;
|
| +}
|
|
|
| namespace local_discovery {
|
|
|
| +class PrivetHTTPClient;
|
| +class ServiceDiscoveryClient;
|
| +
|
| +class PrivetHTTPResolution {
|
| + public:
|
| + virtual ~PrivetHTTPResolution() {}
|
| + virtual void Start() = 0;
|
| +};
|
| +
|
| class PrivetHTTPAsynchronousFactory {
|
| public:
|
| typedef base::Callback<void(scoped_ptr<PrivetHTTPClient>)> ResultCallback;
|
|
|
| - class Resolution {
|
| - public:
|
| - virtual ~Resolution() {}
|
| - virtual void Start() = 0;
|
| - };
|
| -
|
| virtual ~PrivetHTTPAsynchronousFactory() {}
|
|
|
| - virtual scoped_ptr<Resolution> CreatePrivetHTTP(
|
| - const std::string& name,
|
| - const net::HostPortPair& address,
|
| - const ResultCallback& callback) = 0;
|
| -};
|
| -
|
| -class PrivetHTTPAsynchronousFactoryImpl : public PrivetHTTPAsynchronousFactory {
|
| - public:
|
| - PrivetHTTPAsynchronousFactoryImpl(
|
| + static scoped_ptr<PrivetHTTPAsynchronousFactory> CreateInstance(
|
| ServiceDiscoveryClient* service_discovery_client,
|
| net::URLRequestContextGetter* request_context);
|
| - virtual ~PrivetHTTPAsynchronousFactoryImpl();
|
|
|
| - virtual scoped_ptr<Resolution> CreatePrivetHTTP(
|
| + virtual scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP(
|
| const std::string& name,
|
| const net::HostPortPair& address,
|
| - const ResultCallback& callback) OVERRIDE;
|
| -
|
| - private:
|
| - class ResolutionImpl : public Resolution {
|
| - public:
|
| - ResolutionImpl(const std::string& name,
|
| - const net::HostPortPair& address,
|
| - const ResultCallback& callback,
|
| - ServiceDiscoveryClient* service_discovery_client,
|
| - net::URLRequestContextGetter* request_context);
|
| - virtual ~ResolutionImpl();
|
| -
|
| - virtual void Start() OVERRIDE;
|
| - private:
|
| - void ResolveComplete(bool success,
|
| - const net::IPAddressNumber& address_ipv4,
|
| - const net::IPAddressNumber& address_ipv6);
|
| -
|
| - std::string name_;
|
| - scoped_ptr<LocalDomainResolver> resolver_;
|
| - net::HostPortPair hostport_;
|
| - ResultCallback callback_;
|
| - scoped_refptr<net::URLRequestContextGetter> request_context_;
|
| - };
|
| -
|
| - ServiceDiscoveryClient* service_discovery_client_;
|
| - scoped_refptr<net::URLRequestContextGetter> request_context_;
|
| + const ResultCallback& callback) = 0;
|
| };
|
|
|
| } // namespace local_discovery
|
|
|