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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1124333010: Shut down Profile's URLRequestContextGetters safely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fetcher
Patch Set: Cleanup Created 5 years, 7 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: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 512fc154c7d6259a8820a1c06550ca7bdafa3304..84525babd0379234f38e03cbdd52c28658448632 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -351,12 +351,13 @@ void InitializeAndPassKeygenHandler(
}
#endif // defined(USE_NSS_CERTS)
-void InvalidateContextGettersOnIO(
+// For safe shutdown, must be called before the ProfileIOData is destroyed.
+void NotifyContextGettersOfShutdownOnIO(
scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> getters) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
ProfileIOData::ChromeURLRequestContextGetterVector::iterator iter;
- for (iter = getters->begin(); iter != getters->end(); ++iter)
- (*iter)->Invalidate();
+ for (auto& chrome_context_getter : *getters)
+ chrome_context_getter->NotifyContextShuttingDown();
}
} // namespace
@@ -1228,7 +1229,7 @@ void ProfileIOData::ShutdownOnUIThread(
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- base::Bind(&InvalidateContextGettersOnIO,
+ base::Bind(&NotifyContextGettersOfShutdownOnIO,
base::Passed(&context_getters)));
}
}
« chrome/browser/profiles/profile_browsertest.cc ('K') | « chrome/browser/profiles/profile_io_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698