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

Unified Diff: components/arc/arc_service_manager.cc

Issue 2547163002: Add thread checker calls to all ArcServiceManager methods (Closed)
Patch Set: address comment 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..c8718242774ea13ed33c0567b2434af2bd22d20c 100644
--- a/components/arc/arc_service_manager.cc
+++ b/components/arc/arc_service_manager.cc
@@ -58,7 +58,10 @@ ArcServiceManager* ArcServiceManager::Get() {
// static
bool ArcServiceManager::IsInitialized() {
- return g_arc_service_manager;
+ if (!g_arc_service_manager)
+ return false;
+ DCHECK(g_arc_service_manager->thread_checker_.CalledOnValidThread());
+ return true;
}
ArcBridgeService* ArcServiceManager::arc_bridge_service() {
@@ -72,19 +75,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