Index: components/browser_context_keyed_service/browser_context_dependency_manager.cc |
diff --git a/components/browser_context_keyed_service/browser_context_dependency_manager.cc b/components/browser_context_keyed_service/browser_context_dependency_manager.cc |
index 913c92b80858a7f4489bb486e84cf0ab874dfdef..bd45e7a8cd5837baddabd236db0edcae0524faeb 100644 |
--- a/components/browser_context_keyed_service/browser_context_dependency_manager.cc |
+++ b/components/browser_context_keyed_service/browser_context_dependency_manager.cc |
@@ -71,11 +71,7 @@ void BrowserContextDependencyManager::DoCreateBrowserContextServices( |
TRACE_EVENT0("browser", |
"BrowserContextDependencyManager::DoCreateBrowserContextServices") |
#ifndef NDEBUG |
- // Unmark |context| as dead. This exists because of unit tests, which will |
- // often have similar stack structures. 0xWhatever might be created, go out |
- // of scope, and then a new BrowserContext object might be created |
- // at 0xWhatever. |
- dead_context_pointers_.erase(context); |
+ MarkBrowserContextLiveForTesting(context); |
#endif |
std::vector<DependencyNode*> construction_order; |
@@ -139,6 +135,11 @@ void BrowserContextDependencyManager::AssertBrowserContextWasntDestroyed( |
<< "services again."; |
} |
} |
+ |
+void BrowserContextDependencyManager::MarkBrowserContextLiveForTesting( |
+ content::BrowserContext* context) { |
+ dead_context_pointers_.erase(context); |
+} |
#endif |
// static |