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

Unified Diff: components/browser_context_keyed_service/browser_context_dependency_manager.cc

Issue 159763004: Eliminate potential for flaky crash in BCKSFactory::SetTestingFactory(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 6 years, 10 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/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

Powered by Google App Engine
This is Rietveld 408576698