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 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h" | 5 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h" |
6 | 6 |
7 #include "chrome/browser/local_discovery/privet_http_impl.h" | 7 #include "chrome/browser/local_discovery/privet_http_impl.h" |
8 | 8 |
9 namespace local_discovery { | 9 namespace local_discovery { |
10 | 10 |
11 PrivetHTTPAsynchronousFactoryMac::PrivetHTTPAsynchronousFactoryMac( | 11 PrivetHTTPAsynchronousFactoryMac::PrivetHTTPAsynchronousFactoryMac( |
12 net::URLRequestContextGetter* request_context) | 12 net::URLRequestContextGetter* request_context) |
13 : request_context_(request_context) {} | 13 : request_context_(request_context) { |
| 14 } |
14 | 15 |
15 PrivetHTTPAsynchronousFactoryMac::~PrivetHTTPAsynchronousFactoryMac() {} | 16 PrivetHTTPAsynchronousFactoryMac::~PrivetHTTPAsynchronousFactoryMac() { |
| 17 } |
16 | 18 |
17 scoped_ptr<PrivetHTTPResolution> | 19 scoped_ptr<PrivetHTTPResolution> |
18 PrivetHTTPAsynchronousFactoryMac::CreatePrivetHTTP( | 20 PrivetHTTPAsynchronousFactoryMac::CreatePrivetHTTP( |
19 const std::string& name, | 21 const std::string& name, |
20 const net::HostPortPair& address, | 22 const net::HostPortPair& address, |
21 const ResultCallback& callback) { | 23 const ResultCallback& callback) { |
22 return scoped_ptr<PrivetHTTPResolution>( | 24 return scoped_ptr<PrivetHTTPResolution>( |
23 new ResolutionMac(request_context_, name, address, callback)); | 25 new ResolutionMac(request_context_, name, address, callback)); |
24 } | 26 } |
25 | 27 |
26 PrivetHTTPAsynchronousFactoryMac::ResolutionMac::ResolutionMac( | 28 PrivetHTTPAsynchronousFactoryMac::ResolutionMac::ResolutionMac( |
27 net::URLRequestContextGetter* request_context, | 29 net::URLRequestContextGetter* request_context, |
28 const std::string& name, | 30 const std::string& name, |
29 const net::HostPortPair& host_port, | 31 const net::HostPortPair& host_port, |
30 const ResultCallback& callback) | 32 const ResultCallback& callback) |
31 : request_context_(request_context), | 33 : request_context_(request_context), |
32 name_(name), | 34 name_(name), |
33 host_port_(host_port), | 35 host_port_(host_port), |
34 callback_(callback) {} | 36 callback_(callback) { |
| 37 } |
35 | 38 |
36 PrivetHTTPAsynchronousFactoryMac::ResolutionMac::~ResolutionMac() {} | 39 PrivetHTTPAsynchronousFactoryMac::ResolutionMac::~ResolutionMac() { |
| 40 } |
37 | 41 |
38 void PrivetHTTPAsynchronousFactoryMac::ResolutionMac::Start() { | 42 void PrivetHTTPAsynchronousFactoryMac::ResolutionMac::Start() { |
39 callback_.Run(scoped_ptr<PrivetHTTPClient>( | 43 callback_.Run(scoped_ptr<PrivetHTTPClient>( |
40 new PrivetHTTPClientImpl(name_, host_port_, request_context_))); | 44 new PrivetHTTPClientImpl(name_, host_port_, request_context_))); |
41 } | 45 } |
42 | 46 |
43 const std::string& PrivetHTTPAsynchronousFactoryMac::ResolutionMac::GetName() { | 47 const std::string& PrivetHTTPAsynchronousFactoryMac::ResolutionMac::GetName() { |
44 return name_; | 48 return name_; |
45 } | 49 } |
46 | 50 |
47 } // namespace local_discovery | 51 } // namespace local_discovery |
OLD | NEW |