| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_IMPL_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_IMP
L_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_IMPL_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_IMP
L_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/local_discovery/privet_http.h" | 9 #include "chrome/browser/printing/cloud_print/privet_http.h" |
| 10 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" | 10 #include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
" |
| 11 | 11 |
| 12 namespace local_discovery { | 12 namespace local_discovery { |
| 13 class EndpointResolver; |
| 14 } |
| 13 | 15 |
| 14 class EndpointResolver; | 16 namespace cloud_print { |
| 15 | 17 |
| 16 class PrivetHTTPAsynchronousFactoryImpl : public PrivetHTTPAsynchronousFactory { | 18 class PrivetHTTPAsynchronousFactoryImpl : public PrivetHTTPAsynchronousFactory { |
| 17 public: | 19 public: |
| 18 explicit PrivetHTTPAsynchronousFactoryImpl( | 20 explicit PrivetHTTPAsynchronousFactoryImpl( |
| 19 net::URLRequestContextGetter* request_context); | 21 net::URLRequestContextGetter* request_context); |
| 20 ~PrivetHTTPAsynchronousFactoryImpl() override; | 22 ~PrivetHTTPAsynchronousFactoryImpl() override; |
| 21 | 23 |
| 22 scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( | 24 scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( |
| 23 const std::string& service_name) override; | 25 const std::string& service_name) override; |
| 24 | 26 |
| 25 private: | 27 private: |
| 26 class ResolutionImpl : public PrivetHTTPResolution { | 28 class ResolutionImpl : public PrivetHTTPResolution { |
| 27 public: | 29 public: |
| 28 ResolutionImpl(const std::string& service_name, | 30 ResolutionImpl(const std::string& service_name, |
| 29 net::URLRequestContextGetter* request_context); | 31 net::URLRequestContextGetter* request_context); |
| 30 ~ResolutionImpl() override; | 32 ~ResolutionImpl() override; |
| 31 | 33 |
| 32 void Start(const ResultCallback& callback) override; | 34 void Start(const ResultCallback& callback) override; |
| 33 | 35 |
| 34 void Start(const net::HostPortPair& address, | 36 void Start(const net::HostPortPair& address, |
| 35 const ResultCallback& callback) override; | 37 const ResultCallback& callback) override; |
| 36 | 38 |
| 37 const std::string& GetName() override; | 39 const std::string& GetName() override; |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 void ResolveComplete(const ResultCallback& callback, | 42 void ResolveComplete(const ResultCallback& callback, |
| 41 const net::IPEndPoint& endpoint); | 43 const net::IPEndPoint& endpoint); |
| 42 std::string name_; | 44 std::string name_; |
| 43 scoped_refptr<net::URLRequestContextGetter> request_context_; | 45 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 44 scoped_ptr<EndpointResolver> endpoint_resolver_; | 46 scoped_ptr<local_discovery::EndpointResolver> endpoint_resolver_; |
| 45 | 47 |
| 46 DISALLOW_COPY_AND_ASSIGN(ResolutionImpl); | 48 DISALLOW_COPY_AND_ASSIGN(ResolutionImpl); |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 scoped_refptr<net::URLRequestContextGetter> request_context_; | 51 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 50 | 52 |
| 51 DISALLOW_COPY_AND_ASSIGN(PrivetHTTPAsynchronousFactoryImpl); | 53 DISALLOW_COPY_AND_ASSIGN(PrivetHTTPAsynchronousFactoryImpl); |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 } // namespace local_discovery | 56 } // namespace cloud_print |
| 55 | 57 |
| 56 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_IMPL_
H_ | 58 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_
IMPL_H_ |
| OLD | NEW |