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

Unified Diff: components/arc/arc_service_manager.cc

Issue 2547163002: Add thread checker calls to all ArcServiceManager methods (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_service_manager.cc
diff --git a/components/arc/arc_service_manager.cc b/components/arc/arc_service_manager.cc
index 9642d9f40d16801672933118e22b7cc1851aa1b3..b9e1e8f9fdbddd02d589f73aacb13680e6e05d36 100644
--- a/components/arc/arc_service_manager.cc
+++ b/components/arc/arc_service_manager.cc
@@ -58,6 +58,8 @@ ArcServiceManager* ArcServiceManager::Get() {
// static
bool ArcServiceManager::IsInitialized() {
Yusuke Sato 2016/12/02 21:06:54 FYI, this method was introduced for https://codere
Luis Héctor Chávez 2016/12/02 22:18:08 Not at the moment :(
+ DCHECK(!g_arc_service_manager ||
Yusuke Sato 2016/12/02 21:06:54 This DCHECK does not detect wrong threading when g
Luis Héctor Chávez 2016/12/02 22:18:08 This is fine. We have a similar problem in ArcBrid
Yusuke Sato 2016/12/02 22:27:28 Thanks, done.
+ g_arc_service_manager->thread_checker_.CalledOnValidThread());
return g_arc_service_manager;
}
@@ -72,19 +74,23 @@ void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) {
}
void ArcServiceManager::AddObserver(Observer* observer) {
+ DCHECK(thread_checker_.CalledOnValidThread());
observer_list_.AddObserver(observer);
}
void ArcServiceManager::RemoveObserver(Observer* observer) {
+ DCHECK(thread_checker_.CalledOnValidThread());
observer_list_.RemoveObserver(observer);
}
void ArcServiceManager::OnAppsUpdated() {
+ DCHECK(thread_checker_.CalledOnValidThread());
for (auto& observer : observer_list_)
observer.OnAppsUpdated();
}
void ArcServiceManager::Shutdown() {
+ DCHECK(thread_checker_.CalledOnValidThread());
icon_loader_ = nullptr;
activity_resolver_ = nullptr;
services_.clear();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698