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

Unified Diff: chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc

Issue 959503003: Remove ServiceDiscoveryClient* from PrivetHTTPAsynchronousFactoryImpl interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixEstablish
Patch Set: Tue Feb 24 23:11:53 PST 2015 Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc
diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc b/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc
index 0bfa23a87232284b5840aa07bff4a6bb6fcd16b4..8a961aaeb1d23bfaf98f1cb3e2b6be62ea7db28d 100644
--- a/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc
+++ b/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/local_discovery/privet_http_impl.h"
+#include "chrome/browser/local_discovery/service_discovery_shared_client.h"
#include "chrome/common/chrome_switches.h"
namespace local_discovery {
@@ -28,10 +29,8 @@ std::string IPAddressToHostString(const net::IPAddressNumber& address) {
} // namespace
PrivetHTTPAsynchronousFactoryImpl::PrivetHTTPAsynchronousFactoryImpl(
- ServiceDiscoveryClient* service_discovery_client,
net::URLRequestContextGetter* request_context)
- : service_discovery_client_(service_discovery_client),
- request_context_(request_context) {
+ : request_context_(request_context) {
}
PrivetHTTPAsynchronousFactoryImpl::~PrivetHTTPAsynchronousFactoryImpl() {
@@ -43,33 +42,28 @@ PrivetHTTPAsynchronousFactoryImpl::CreatePrivetHTTP(
const net::HostPortPair& address,
const ResultCallback& callback) {
return scoped_ptr<PrivetHTTPResolution>(
- new ResolutionImpl(name,
- address,
- callback,
- service_discovery_client_,
- request_context_.get()));
+ new ResolutionImpl(name, address, callback, request_context_.get()));
}
PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolutionImpl(
const std::string& name,
const net::HostPortPair& address,
const ResultCallback& callback,
- ServiceDiscoveryClient* service_discovery_client,
net::URLRequestContextGetter* request_context)
: name_(name),
hostport_(address),
callback_(callback),
request_context_(request_context) {
- net::AddressFamily address_family = net::ADDRESS_FAMILY_UNSPECIFIED;
+ service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance();
+ net::AddressFamily address_family = net::ADDRESS_FAMILY_UNSPECIFIED;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kPrivetIPv6Only)) {
address_family = net::ADDRESS_FAMILY_IPV6;
}
- resolver_ = service_discovery_client->CreateLocalDomainResolver(
- address.host(),
- address_family,
+ resolver_ = service_discovery_client_->CreateLocalDomainResolver(
+ address.host(), address_family,
base::Bind(&ResolutionImpl::ResolveComplete, base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698