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

Unified Diff: components/keyed_service/core/keyed_service_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_factory.cc
diff --git a/components/keyed_service/core/keyed_service_factory.cc b/components/keyed_service/core/keyed_service_factory.cc
index 938ddc5d41b378f2f280904b993ca30b524ec9eb..e93b14219e1a2e495495739cc6127693d4dbc79d 100644
--- a/components/keyed_service/core/keyed_service_factory.cc
+++ b/components/keyed_service/core/keyed_service_factory.cc
@@ -30,13 +30,11 @@ void KeyedServiceFactory::SetTestingFactory(
// destruction.
bool add_context = ArePreferencesSetOn(context);
-#ifndef NDEBUG
// Ensure that |context| is not marked as stale (e.g., due to it aliasing an
// instance that was destroyed in an earlier test) in order to avoid accesses
// to |context| in |BrowserContextShutdown| from causing
// |AssertBrowserContextWasntDestroyed| to raise an error.
- MarkContextLiveForTesting(context);
-#endif
+ MarkContextLive(context);
// We have to go through the shutdown and destroy mechanisms because there
// are unit tests that create a service on a context and then change the

Powered by Google App Engine
This is Rietveld 408576698