Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc

Issue 1553333002: Move cloud print specific files out of local_discovery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveprn
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_impl.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/local_discovery/privet_http_impl.h" 8 #include "chrome/browser/printing/cloud_print/privet_http_impl.h"
9 9
10 namespace local_discovery { 10 namespace cloud_print {
11 11
12 PrivetHTTPAsynchronousFactoryImpl::PrivetHTTPAsynchronousFactoryImpl( 12 PrivetHTTPAsynchronousFactoryImpl::PrivetHTTPAsynchronousFactoryImpl(
13 net::URLRequestContextGetter* request_context) 13 net::URLRequestContextGetter* request_context)
14 : request_context_(request_context) { 14 : request_context_(request_context) {
15 } 15 }
16 16
17 PrivetHTTPAsynchronousFactoryImpl::~PrivetHTTPAsynchronousFactoryImpl() { 17 PrivetHTTPAsynchronousFactoryImpl::~PrivetHTTPAsynchronousFactoryImpl() {
18 } 18 }
19 19
20 scoped_ptr<PrivetHTTPResolution> 20 scoped_ptr<PrivetHTTPResolution>
21 PrivetHTTPAsynchronousFactoryImpl::CreatePrivetHTTP( 21 PrivetHTTPAsynchronousFactoryImpl::CreatePrivetHTTP(
22 const std::string& service_name) { 22 const std::string& service_name) {
23 return scoped_ptr<PrivetHTTPResolution>( 23 return scoped_ptr<PrivetHTTPResolution>(
24 new ResolutionImpl(service_name, request_context_.get())); 24 new ResolutionImpl(service_name, request_context_.get()));
25 } 25 }
26 26
27 PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolutionImpl( 27 PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolutionImpl(
28 const std::string& service_name, 28 const std::string& service_name,
29 net::URLRequestContextGetter* request_context) 29 net::URLRequestContextGetter* request_context)
30 : name_(service_name), 30 : name_(service_name),
31 request_context_(request_context), 31 request_context_(request_context),
32 endpoint_resolver_(new EndpointResolver()) {} 32 endpoint_resolver_(new local_discovery::EndpointResolver()) {}
33 33
34 PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::~ResolutionImpl() { 34 PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::~ResolutionImpl() {
35 } 35 }
36 36
37 const std::string& 37 const std::string&
38 PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::GetName() { 38 PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::GetName() {
39 return name_; 39 return name_;
40 } 40 }
41 41
42 void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::Start( 42 void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::Start(
(...skipping 15 matching lines...) Expand all
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().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 local_discovery 68 } // namespace cloud_print
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698