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/printing/cloud_print/privet_http_asynchronous_factory_i
mpl.h" | 5 #include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_i
mpl.h" |
6 | 6 |
7 #include "chrome/browser/local_discovery/endpoint_resolver.h" | 7 #include "chrome/browser/local_discovery/endpoint_resolver.h" |
8 #include "chrome/browser/printing/cloud_print/privet_http_impl.h" | 8 #include "chrome/browser/printing/cloud_print/privet_http_impl.h" |
9 | 9 |
10 namespace cloud_print { | 10 namespace cloud_print { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const net::HostPortPair& address, | 50 const net::HostPortPair& address, |
51 const ResultCallback& callback) { | 51 const ResultCallback& callback) { |
52 endpoint_resolver_->Start(address, | 52 endpoint_resolver_->Start(address, |
53 base::Bind(&ResolutionImpl::ResolveComplete, | 53 base::Bind(&ResolutionImpl::ResolveComplete, |
54 base::Unretained(this), callback)); | 54 base::Unretained(this), callback)); |
55 } | 55 } |
56 | 56 |
57 void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolveComplete( | 57 void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolveComplete( |
58 const ResultCallback& callback, | 58 const ResultCallback& callback, |
59 const net::IPEndPoint& endpoint) { | 59 const net::IPEndPoint& endpoint) { |
60 if (endpoint.address().empty()) | 60 if (endpoint.address_number().empty()) |
61 return callback.Run(scoped_ptr<PrivetHTTPClient>()); | 61 return callback.Run(scoped_ptr<PrivetHTTPClient>()); |
62 | 62 |
63 net::HostPortPair new_address = net::HostPortPair::FromIPEndPoint(endpoint); | 63 net::HostPortPair new_address = net::HostPortPair::FromIPEndPoint(endpoint); |
64 callback.Run(scoped_ptr<PrivetHTTPClient>( | 64 callback.Run(scoped_ptr<PrivetHTTPClient>( |
65 new PrivetHTTPClientImpl(name_, new_address, request_context_.get()))); | 65 new PrivetHTTPClientImpl(name_, new_address, request_context_.get()))); |
66 } | 66 } |
67 | 67 |
68 } // namespace cloud_print | 68 } // namespace cloud_print |
OLD | NEW |