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

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

Issue 1061503008: [chrome/browser/local_discovery] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_utility.cc
diff --git a/chrome/browser/local_discovery/service_discovery_client_utility.cc b/chrome/browser/local_discovery/service_discovery_client_utility.cc
index 9e2d5d719a072ac6fb097ce28e3df5ab99fd5cfc..356ee8cff58676564113b37f03f91711578f5839 100644
--- a/chrome/browser/local_discovery/service_discovery_client_utility.cc
+++ b/chrome/browser/local_discovery/service_discovery_client_utility.cc
@@ -21,7 +21,7 @@ const int kReportSuccessAfterSeconds = 10;
scoped_ptr<ServiceWatcher> ServiceDiscoveryClientUtility::CreateServiceWatcher(
const std::string& service_type,
const ServiceWatcher::UpdatedCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return host_client_->CreateServiceWatcher(service_type, callback);
}
@@ -29,7 +29,7 @@ scoped_ptr<ServiceResolver>
ServiceDiscoveryClientUtility::CreateServiceResolver(
const std::string& service_name,
const ServiceResolver::ResolveCompleteCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return host_client_->CreateServiceResolver(service_name, callback);
}
@@ -38,7 +38,7 @@ ServiceDiscoveryClientUtility::CreateLocalDomainResolver(
const std::string& domain,
net::AddressFamily address_family,
const LocalDomainResolver::IPAddressCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return host_client_->CreateLocalDomainResolver(domain, address_family,
callback);
}
@@ -46,27 +46,27 @@ ServiceDiscoveryClientUtility::CreateLocalDomainResolver(
ServiceDiscoveryClientUtility::ServiceDiscoveryClientUtility()
: restart_attempts_(kMaxRestartAttempts),
weak_ptr_factory_(this) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
StartNewClient();
}
ServiceDiscoveryClientUtility::~ServiceDiscoveryClientUtility() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
host_client_->Shutdown();
}
void ServiceDiscoveryClientUtility::OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Only network changes resets kMaxRestartAttempts.
restart_attempts_ = kMaxRestartAttempts;
ScheduleStartNewClient();
}
void ServiceDiscoveryClientUtility::ScheduleStartNewClient() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
host_client_->Shutdown();
weak_ptr_factory_.InvalidateWeakPtrs();
base::MessageLoop::current()->PostDelayedTask(
@@ -77,7 +77,7 @@ void ServiceDiscoveryClientUtility::ScheduleStartNewClient() {
}
void ServiceDiscoveryClientUtility::StartNewClient() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_refptr<ServiceDiscoveryHostClient> old_client = host_client_;
if ((restart_attempts_--) > 0) {
host_client_ = new ServiceDiscoveryHostClient();

Powered by Google App Engine
This is Rietveld 408576698