OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 class HostPortPair; | 14 class HostPortPair; |
15 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
16 } | 16 } |
17 | 17 |
18 namespace local_discovery { | 18 namespace local_discovery { |
19 | 19 |
20 class PrivetHTTPClient; | 20 class PrivetHTTPClient; |
21 | 21 |
22 class PrivetHTTPResolution { | 22 class PrivetHTTPResolution { |
23 public: | 23 public: |
| 24 using ResultCallback = base::Callback<void(scoped_ptr<PrivetHTTPClient>)>; |
| 25 |
24 virtual ~PrivetHTTPResolution() {} | 26 virtual ~PrivetHTTPResolution() {} |
25 virtual void Start() = 0; | 27 |
| 28 virtual void Start(const net::HostPortPair& address, |
| 29 const ResultCallback& callback) = 0; |
| 30 |
26 virtual const std::string& GetName() = 0; | 31 virtual const std::string& GetName() = 0; |
27 }; | 32 }; |
28 | 33 |
29 class PrivetHTTPAsynchronousFactory { | 34 class PrivetHTTPAsynchronousFactory { |
30 public: | 35 public: |
31 typedef base::Callback<void(scoped_ptr<PrivetHTTPClient>)> ResultCallback; | 36 using ResultCallback = PrivetHTTPResolution::ResultCallback; |
32 | 37 |
33 virtual ~PrivetHTTPAsynchronousFactory() {} | 38 virtual ~PrivetHTTPAsynchronousFactory() {} |
34 | 39 |
35 static scoped_ptr<PrivetHTTPAsynchronousFactory> CreateInstance( | 40 static scoped_ptr<PrivetHTTPAsynchronousFactory> CreateInstance( |
36 net::URLRequestContextGetter* request_context); | 41 net::URLRequestContextGetter* request_context); |
37 | 42 |
38 virtual scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( | 43 virtual scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( |
39 const std::string& name, | 44 const std::string& service_name) = 0; |
40 const net::HostPortPair& address, | |
41 const ResultCallback& callback) = 0; | |
42 }; | 45 }; |
43 | 46 |
44 } // namespace local_discovery | 47 } // namespace local_discovery |
45 | 48 |
46 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ | 49 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ |
OLD | NEW |