summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-15 03:38:52 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-15 03:38:52 +0000
commite3529624902a4f3286bdb5d463bb6ca6bb03470c (patch)
treebd6cea355c1875cf35be129758a1bf62954e6c6f
parente9a82042b509c4f65d1ed04321ef5daafc5c2dd6 (diff)
downloadchromium_src-e3529624902a4f3286bdb5d463bb6ca6bb03470c.zip
chromium_src-e3529624902a4f3286bdb5d463bb6ca6bb03470c.tar.gz
chromium_src-e3529624902a4f3286bdb5d463bb6ca6bb03470c.tar.bz2
Fixed formating and added io_runner_.
TBR=noamsml Review URL: https://chromiumcodereview.appspot.com/23707040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223273 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/local_discovery/service_discovery_host_client.cc26
-rw-r--r--chrome/browser/local_discovery/service_discovery_host_client.h1
-rw-r--r--chrome/utility/local_discovery/service_discovery_message_handler.cc3
3 files changed, 11 insertions, 19 deletions
diff --git a/chrome/browser/local_discovery/service_discovery_host_client.cc b/chrome/browser/local_discovery/service_discovery_host_client.cc
index 8492219..c37d4c0 100644
--- a/chrome/browser/local_discovery/service_discovery_host_client.cc
+++ b/chrome/browser/local_discovery/service_discovery_host_client.cc
@@ -44,8 +44,7 @@ class ServiceDiscoveryHostClient::ServiceWatcherProxy : public ServiceWatcher {
}
virtual void DiscoverNewServices(bool force_update) OVERRIDE {
- DVLOG(1) << "ServiceWatcher::DiscoverNewServices with id "
- << id_;
+ DVLOG(1) << "ServiceWatcher::DiscoverNewServices with id " << id_;
DCHECK(started_);
host_->Send(new LocalDiscoveryMsg_DiscoverServices(id_, force_update));
}
@@ -81,9 +80,7 @@ class ServiceDiscoveryHostClient::ServiceResolverProxy
}
virtual void StartResolving() OVERRIDE {
- DVLOG(1)
- << "ServiceResolverProxy::StartResolving with id "
- << id_;
+ DVLOG(1) << "ServiceResolverProxy::StartResolving with id " << id_;
DCHECK(!started_);
host_->Send(new LocalDiscoveryMsg_ResolveService(id_, service_name_));
started_ = true;
@@ -115,16 +112,14 @@ class ServiceDiscoveryHostClient::LocalDomainResolverProxy
}
virtual ~LocalDomainResolverProxy() {
- DVLOG(1) << "~LocalDomainResolverProxy with id "
- << id_;
+ DVLOG(1) << "~LocalDomainResolverProxy with id " << id_;
host_->UnregisterLocalDomainResolverCallback(id_);
if (started_)
host_->Send(new LocalDiscoveryMsg_DestroyLocalDomainResolver(id_));
}
virtual void Start() OVERRIDE {
- DVLOG(1) << "LocalDomainResolverProxy::Start with id "
- << id_;
+ DVLOG(1) << "LocalDomainResolverProxy::Start with id " << id_;
DCHECK(!started_);
host_->Send(new LocalDiscoveryMsg_ResolveLocalDomain(id_, domain_,
address_family_));
@@ -141,6 +136,7 @@ class ServiceDiscoveryHostClient::LocalDomainResolverProxy
ServiceDiscoveryHostClient::ServiceDiscoveryHostClient() : current_id_(0) {
callback_runner_ = base::MessageLoop::current()->message_loop_proxy();
+ io_runner_ = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}
ServiceDiscoveryHostClient::~ServiceDiscoveryHostClient() {
@@ -221,8 +217,7 @@ void ServiceDiscoveryHostClient::UnregisterLocalDomainResolverCallback(
void ServiceDiscoveryHostClient::Start() {
DCHECK(CalledOnValidThread());
net::NetworkChangeNotifier::AddIPAddressObserver(this);
- BrowserThread::PostTask(
- BrowserThread::IO,
+ io_runner_->PostTask(
FROM_HERE,
base::Bind(&ServiceDiscoveryHostClient::StartOnIOThread, this));
}
@@ -230,8 +225,7 @@ void ServiceDiscoveryHostClient::Start() {
void ServiceDiscoveryHostClient::Shutdown() {
net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
DCHECK(CalledOnValidThread());
- BrowserThread::PostTask(
- BrowserThread::IO,
+ io_runner_->PostTask(
FROM_HERE,
base::Bind(&ServiceDiscoveryHostClient::ShutdownOnIOThread, this));
}
@@ -279,8 +273,7 @@ void ServiceDiscoveryHostClient::RestartOnIOThread() {
void ServiceDiscoveryHostClient::Send(IPC::Message* msg) {
DCHECK(CalledOnValidThread());
- BrowserThread::PostTask(
- BrowserThread::IO,
+ io_runner_->PostTask(
FROM_HERE,
base::Bind(&ServiceDiscoveryHostClient::SendOnIOThread, this, msg));
}
@@ -292,8 +285,7 @@ void ServiceDiscoveryHostClient::SendOnIOThread(IPC::Message* msg) {
}
void ServiceDiscoveryHostClient::OnIPAddressChanged() {
- BrowserThread::PostTask(
- BrowserThread::IO,
+ io_runner_->PostTask(
FROM_HERE,
base::Bind(&ServiceDiscoveryHostClient::RestartOnIOThread, this));
diff --git a/chrome/browser/local_discovery/service_discovery_host_client.h b/chrome/browser/local_discovery/service_discovery_host_client.h
index 1e6a9bd..dbb7071 100644
--- a/chrome/browser/local_discovery/service_discovery_host_client.h
+++ b/chrome/browser/local_discovery/service_discovery_host_client.h
@@ -126,6 +126,7 @@ class ServiceDiscoveryHostClient
ResolverCallbacks service_resolver_callbacks_;
DomainResolverCallbacks domain_resolver_callbacks_;
scoped_refptr<base::TaskRunner> callback_runner_;
+ scoped_refptr<base::TaskRunner> io_runner_;
DISALLOW_COPY_AND_ASSIGN(ServiceDiscoveryHostClient);
};
diff --git a/chrome/utility/local_discovery/service_discovery_message_handler.cc b/chrome/utility/local_discovery/service_discovery_message_handler.cc
index 649272c..5b0ab95 100644
--- a/chrome/utility/local_discovery/service_discovery_message_handler.cc
+++ b/chrome/utility/local_discovery/service_discovery_message_handler.cc
@@ -396,8 +396,7 @@ void ServiceDiscoveryMessageHandler::OnServiceUpdated(
uint64 id,
ServiceWatcher::UpdateType update,
const std::string& name) {
- VLOG(1) << "OnServiceUpdated with id " << id
- << WatcherUpdateToString(update);
+ VLOG(1) << "OnServiceUpdated with id " << id << WatcherUpdateToString(update);
DCHECK(service_discovery_client_);
utility_task_runner_->PostTask(FROM_HERE,
base::Bind(&SendServiceUpdated, id, update, name));