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

Unified Diff: chrome/common/local_discovery/service_discovery_client_impl.cc

Issue 1167163002: chrome: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing message_loop.h includes. Created 5 years, 6 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/common/local_discovery/service_discovery_client_impl.cc
diff --git a/chrome/common/local_discovery/service_discovery_client_impl.cc b/chrome/common/local_discovery/service_discovery_client_impl.cc
index c86f72652261b749ef3373b2edcc5d26751490b2..733e1666f16dad36de74113aa653cf3a2ddfdc2e 100644
--- a/chrome/common/local_discovery/service_discovery_client_impl.cc
+++ b/chrome/common/local_discovery/service_discovery_client_impl.cc
@@ -4,10 +4,12 @@
#include <utility>
+#include "base/location.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/common/local_discovery/service_discovery_client_impl.h"
#include "net/dns/dns_protocol.h"
#include "net/dns/record_rdata.h"
@@ -270,10 +272,9 @@ void ServiceWatcherImpl::DeferUpdate(ServiceWatcher::UpdateType update_type,
if (found != services_.end() && !found->second->update_pending()) {
found->second->set_update_pending(true);
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&ServiceWatcherImpl::DeliverDeferredUpdate, AsWeakPtr(),
- update_type, service_name));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ServiceWatcherImpl::DeliverDeferredUpdate,
+ AsWeakPtr(), update_type, service_name));
}
}
@@ -326,12 +327,10 @@ void ServiceWatcherImpl::OnNsecRecord(const std::string& name,
void ServiceWatcherImpl::ScheduleQuery(int timeout_seconds) {
if (timeout_seconds <= kMaxRequeryTimeSeconds) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&ServiceWatcherImpl::SendQuery,
- AsWeakPtr(),
- timeout_seconds * 2 /*next_timeout_seconds*/,
- false /*force_update*/),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&ServiceWatcherImpl::SendQuery, AsWeakPtr(),
+ timeout_seconds * 2 /*next_timeout_seconds*/,
+ false /*force_update*/),
base::TimeDelta::FromSeconds(timeout_seconds));
}
}
@@ -560,9 +559,8 @@ void LocalDomainResolverImpl::OnTransactionComplete(
&LocalDomainResolverImpl::SendResolvedAddresses,
base::Unretained(this)));
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- timeout_callback_.callback(),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, timeout_callback_.callback(),
base::TimeDelta::FromMilliseconds(kLocalDomainSecondAddressTimeoutMs));
} else if (transactions_finished_ == 2
|| address_family_ != net::ADDRESS_FAMILY_UNSPECIFIED) {

Powered by Google App Engine
This is Rietveld 408576698