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

Unified Diff: chrome/browser/local_discovery/service_discovery_client_mac.mm

Issue 1127553002: [chrome/browser/local_discovery] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Build break : Dependency in components/wifi classes Created 5 years, 7 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/service_discovery_client_mac.mm
diff --git a/chrome/browser/local_discovery/service_discovery_client_mac.mm b/chrome/browser/local_discovery/service_discovery_client_mac.mm
index 59c2c81ca7859797bcfb4a6dc7b454d938d0c613..6047d2f61cc1c4ebdc6a2fdc5b93759f95f8ce4c 100644
--- a/chrome/browser/local_discovery/service_discovery_client_mac.mm
+++ b/chrome/browser/local_discovery/service_discovery_client_mac.mm
@@ -10,6 +10,8 @@
#include "base/memory/singleton.h"
#include "base/metrics/histogram.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
using local_discovery::ServiceWatcherImplMac;
@@ -157,12 +159,13 @@ void ServiceDiscoveryClientMac::StartThreadIfNotStarted() {
ServiceWatcherImplMac::NetServiceBrowserContainer::NetServiceBrowserContainer(
const std::string& service_type,
const ServiceWatcher::UpdatedCallback& callback,
- scoped_refptr<base::MessageLoopProxy> service_discovery_runner)
+ scoped_refptr<base::SingleThreadTaskRunner> service_discovery_runner)
: service_type_(service_type),
callback_(callback),
- callback_runner_(base::MessageLoopProxy::current()),
+ callback_runner_(base::ThreadTaskRunnerHandle::Get()),
service_discovery_runner_(service_discovery_runner),
- weak_factory_(this) {}
+ weak_factory_(this) {
+}
ServiceWatcherImplMac::NetServiceBrowserContainer::
~NetServiceBrowserContainer() {
@@ -226,7 +229,7 @@ void ServiceWatcherImplMac::NetServiceBrowserContainer::DeleteSoon() {
ServiceWatcherImplMac::ServiceWatcherImplMac(
const std::string& service_type,
const ServiceWatcher::UpdatedCallback& callback,
- scoped_refptr<base::MessageLoopProxy> service_discovery_runner)
+ scoped_refptr<base::SingleThreadTaskRunner> service_discovery_runner)
: service_type_(service_type),
callback_(callback),
started_(false),
@@ -273,12 +276,13 @@ void ServiceWatcherImplMac::OnServicesUpdate(ServiceWatcher::UpdateType update,
ServiceResolverImplMac::NetServiceContainer::NetServiceContainer(
const std::string& service_name,
const ServiceResolver::ResolveCompleteCallback& callback,
- scoped_refptr<base::MessageLoopProxy> service_discovery_runner)
+ scoped_refptr<base::SingleThreadTaskRunner> service_discovery_runner)
: service_name_(service_name),
callback_(callback),
- callback_runner_(base::MessageLoopProxy::current()),
+ callback_runner_(base::ThreadTaskRunnerHandle::Get()),
service_discovery_runner_(service_discovery_runner),
- weak_factory_(this) {}
+ weak_factory_(this) {
+}
ServiceResolverImplMac::NetServiceContainer::~NetServiceContainer() {
DCHECK(IsOnServiceDiscoveryThread());
@@ -366,7 +370,7 @@ void ServiceResolverImplMac::NetServiceContainer::SetServiceForTesting(
ServiceResolverImplMac::ServiceResolverImplMac(
const std::string& service_name,
const ServiceResolver::ResolveCompleteCallback& callback,
- scoped_refptr<base::MessageLoopProxy> service_discovery_runner)
+ scoped_refptr<base::SingleThreadTaskRunner> service_discovery_runner)
: service_name_(service_name),
callback_(callback),
has_resolved_(false),

Powered by Google App Engine
This is Rietveld 408576698