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

Unified Diff: components/keyed_service/core/keyed_service_base_factory.cc

Issue 2910053002: Replace deprecated base::NonThreadSafe in components/keyed_service in favor of SequenceChecker. (Closed)
Patch Set: add matching keyed_service\ios tweaks Created 3 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: components/keyed_service/core/keyed_service_base_factory.cc
diff --git a/components/keyed_service/core/keyed_service_base_factory.cc b/components/keyed_service/core/keyed_service_base_factory.cc
index 48643305759bcc97660622b7d38adfefcfbbbdfa..773b1f941c915493e959005042c7df7008581f0a 100644
--- a/components/keyed_service/core/keyed_service_base_factory.cc
+++ b/components/keyed_service/core/keyed_service_base_factory.cc
@@ -53,6 +53,7 @@ KeyedServiceBaseFactory::KeyedServiceBaseFactory(const char* service_name,
}
KeyedServiceBaseFactory::~KeyedServiceBaseFactory() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
dependency_manager_->RemoveComponent(this);
}
@@ -88,7 +89,7 @@ void KeyedServiceBaseFactory::AssertContextWasntDestroyed(
}
void KeyedServiceBaseFactory::MarkContextLive(base::SupportsUserData* context) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
dependency_manager_->MarkContextLive(context);
}
@@ -104,7 +105,7 @@ void KeyedServiceBaseFactory::ContextDestroyed(
base::SupportsUserData* context) {
// While object destruction can be customized in ways where the object is
// only dereferenced, this still must run on the UI thread.
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
registered_preferences_.erase(context);
}

Powered by Google App Engine
This is Rietveld 408576698