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

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

Issue 2749823002: Restore KeyedServiceFactory diagnostics for context use-after-destroy. (Closed)
Patch Set: Refactor SiteEngagementService tests. Created 3 years, 9 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 9f0991d7d6183ab7b58fbff10fe138053786de2d..48643305759bcc97660622b7d38adfefcfbbbdfa 100644
--- a/components/keyed_service/core/keyed_service_base_factory.cc
+++ b/components/keyed_service/core/keyed_service_base_factory.cc
@@ -79,19 +79,18 @@ KeyedServiceBaseFactory::GetAssociatedPrefRegistry(
return registry;
}
-#ifndef NDEBUG
void KeyedServiceBaseFactory::AssertContextWasntDestroyed(
base::SupportsUserData* context) const {
- DCHECK(CalledOnValidThread());
+ // TODO(crbug.com/701326): We should DCHECK(CalledOnValidThread()) here, but
+ // currently some code doesn't do service getting on the main thread.
+ // This needs to be fixed and DCHECK should be restored here.
dependency_manager_->AssertContextWasntDestroyed(context);
}
-void KeyedServiceBaseFactory::MarkContextLiveForTesting(
- base::SupportsUserData* context) {
+void KeyedServiceBaseFactory::MarkContextLive(base::SupportsUserData* context) {
DCHECK(CalledOnValidThread());
- dependency_manager_->MarkContextLiveForTesting(context);
+ dependency_manager_->MarkContextLive(context);
}
-#endif
bool KeyedServiceBaseFactory::ServiceIsCreatedWithContext() const {
return false;
« no previous file with comments | « components/keyed_service/core/keyed_service_base_factory.h ('k') | components/keyed_service/core/keyed_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698