cashew: SeviceManager: remove incorrect assert In ServiceManager::ClearDefaultCellularService, we have the following assert: DCHECK(GetService(default_cellular_service_->GetPath()) != NULL); This checks that we can look up the service pointed to by |default_cellular_service_| with GetService, meaning that it's in our |services_| collection. The intent was to check that |default_cellular_service_| points to a valid service before we attempt to interact with it, but this check is inappropriate, because it is not always true that the default service is in the |services_| collection. In OnServicesUpdate, it's possible for ClearDefaultCellularService to be called after the default service has been moved from |services_| to |old_services| in preparation for its deletion. In this scenario, GetService will fail to locate it and trip the assert even though |default_cellular_service_| still points to a valid Service object. Resolution: Remove the assert. Our expectation was incorrect. BUG=chromium-os:8935 TEST=Manual testing on device Change-Id: I941b9dd06985b92737f553b215924792c7748575 Review URL: http://codereview.chromium.org/4746002
diff --git a/src/service_manager.cc b/src/service_manager.cc index 2e8a964..484f08c 100644 --- a/src/service_manager.cc +++ b/src/service_manager.cc
@@ -377,7 +377,6 @@ void ServiceManager::ClearDefaultCellularService() { DLOG(INFO) << "ClearDefaultCellularService"; if (default_cellular_service_ != NULL) { - DCHECK(GetService(default_cellular_service_->GetPath()) != NULL); DCHECK(default_cellular_service_->IsDefaultService()); default_cellular_service_->OnDefaultServiceUpdate(false); default_cellular_service_ = NULL;