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

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

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.h
diff --git a/components/keyed_service/core/keyed_service_base_factory.h b/components/keyed_service/core/keyed_service_base_factory.h
index 9e41dcf961df5d5502234aec920a79ce8dadf662..ea9223b0af3fda00ff0b544e253b4eb98b62584d 100644
--- a/components/keyed_service/core/keyed_service_base_factory.h
+++ b/components/keyed_service/core/keyed_service_base_factory.h
@@ -54,18 +54,16 @@ class KEYED_SERVICE_EXPORT KeyedServiceBaseFactory
// created by factories.
void DependsOn(KeyedServiceBaseFactory* rhs);
-#ifndef NDEBUG
- // Debugging assertion that will NOTREACHED() is |context| is considered
- // stale. Should be used by subclasses when accessing |context|.
+ // Runtime assertion to check if |context| is considered stale. Should be used
+ // by subclasses when accessing |context|.
void AssertContextWasntDestroyed(base::SupportsUserData* context) const;
// Marks |context| as live (i.e., not stale). This method can be called as a
// safeguard against |AssertContextWasntDestroyed()| checks going off due to
- // |context| aliasing am instance from a prior test (i.e., 0xWhatever might
- // be created, be destroyed, and then a new object might be created at
+ // |context| aliasing an instance from a prior construction (i.e., 0xWhatever
+ // might be created, be destroyed, and then a new object might be created at
// 0xWhatever).
- void MarkContextLiveForTesting(base::SupportsUserData* context);
-#endif
+ void MarkContextLive(base::SupportsUserData* context);
// Calls RegisterProfilePrefs() after doing house keeping required to work
// alongside RegisterUserPrefsOnContextForTest().
« no previous file with comments | « components/keyed_service/core/dependency_manager.cc ('k') | components/keyed_service/core/keyed_service_base_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698