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

Unified Diff: components/keyed_service/content/browser_context_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/content/browser_context_dependency_manager.h
diff --git a/components/keyed_service/content/browser_context_dependency_manager.h b/components/keyed_service/content/browser_context_dependency_manager.h
index 551a8229c0291316502f647d95a5975dace590df..0a6eb603e1ec27da924da6fde5999d687c758c35 100644
--- a/components/keyed_service/content/browser_context_dependency_manager.h
+++ b/components/keyed_service/content/browser_context_dependency_manager.h
@@ -68,19 +68,18 @@ class KEYED_SERVICE_EXPORT BrowserContextDependencyManager
RegisterWillCreateBrowserContextServicesCallbackForTesting(
const base::Callback<void(content::BrowserContext*)>& callback);
-#ifndef NDEBUG
- // Debugging assertion called as part of GetServiceForBrowserContext in debug
- // mode. This will NOTREACHED() whenever the user is trying to access a stale
- // BrowserContext*.
- void AssertBrowserContextWasntDestroyed(content::BrowserContext* context);
+ // Runtime assertion called as a part of GetServiceForBrowserContext() to
+ // check if |context| is considered stale. This will NOTREACHED() or
+ // base::debug::DumpWithoutCrashing() depending on the DCHECK_IS_ON() value.
+ void AssertBrowserContextWasntDestroyed(
+ content::BrowserContext* context) const;
// Marks |context| as live (i.e., not stale). This method can be called as a
// safeguard against |AssertBrowserContextWasntDestroyed()| checks going off
- // due to |context| aliasing a BrowserContext instance from a prior test
- // (i.e., 0xWhatever might be created, be destroyed, and then a new
- // BrowserContext object might be created at 0xWhatever).
- void MarkBrowserContextLiveForTesting(content::BrowserContext* context);
-#endif // NDEBUG
+ // due to |context| aliasing a BrowserContext instance from a prior
+ // construction (i.e., 0xWhatever might be created, be destroyed, and then a
+ // new BrowserContext object might be created at 0xWhatever).
+ void MarkBrowserContextLive(content::BrowserContext* context);
static BrowserContextDependencyManager* GetInstance();
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | components/keyed_service/content/browser_context_dependency_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698