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

Unified Diff: components/keyed_service/ios/browser_state_dependency_manager.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/ios/browser_state_dependency_manager.h
diff --git a/components/keyed_service/ios/browser_state_dependency_manager.h b/components/keyed_service/ios/browser_state_dependency_manager.h
index 649f16f2376a26df82090b05fceedc679ebf4ac9..927f9a4e443f6ec950cfe7b373faba5846edbdfc 100644
--- a/components/keyed_service/ios/browser_state_dependency_manager.h
+++ b/components/keyed_service/ios/browser_state_dependency_manager.h
@@ -56,19 +56,17 @@ class KEYED_SERVICE_EXPORT BrowserStateDependencyManager
// associated with it.
void DestroyBrowserStateServices(web::BrowserState* context);
-#ifndef NDEBUG
- // Debugging assertion called as part of GetServiceForBrowserState in debug
- // mode. This will NOTREACHED() whenever the user is trying to access a stale
- // BrowserState*.
- void AssertBrowserStateWasntDestroyed(web::BrowserState* context);
+ // Runtime assertion called as a part of GetServiceForBrowserState() to check
+ // if |context| is considered stale. This will NOTREACHED() or
+ // base::debug::DumpWithoutCrashing() depending on the DCHECK_IS_ON() value.
+ void AssertBrowserStateWasntDestroyed(web::BrowserState* context) const;
// Marks |context| as live (i.e., not stale). This method can be called as a
// safeguard against |AssertBrowserStateWasntDestroyed()| checks going off
- // due to |context| aliasing a BrowserState instance from a prior test
+ // due to |context| aliasing a BrowserState instance from a prior construction
// (i.e., 0xWhatever might be created, be destroyed, and then a new
// BrowserState object might be created at 0xWhatever).
- void MarkBrowserStateLiveForTesting(web::BrowserState* context);
-#endif // NDEBUG
+ void MarkBrowserStateLive(web::BrowserState* context);
private:
friend struct base::DefaultSingletonTraits<BrowserStateDependencyManager>;

Powered by Google App Engine
This is Rietveld 408576698