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

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

Issue 7847027: DownloadId (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge Created 9 years, 3 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
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/off_the_record_profile_impl.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index b4ffcf48b4bd9073f1c5694436ca5ad411bd58dc..568ec29216f177078ea2d75bdd864bf14173ee96 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -115,6 +115,16 @@ void OffTheRecordProfileImpl::Init() {
}
OffTheRecordProfileImpl::~OffTheRecordProfileImpl() {
+ // Shutdown the DownloadManager here in the dtor as ProfileImpl does to
+ // guarantee that it happens before the last scoped_refptr<DM> is reaped.
+ // DownloadManager is lazily created, so check before accessing it.
+ if (download_manager_.get()) {
+ // Drop our download manager so we forget about all the downloads made
+ // in incognito mode.
+ download_manager_->Shutdown();
+ download_manager_ = NULL;
+ }
+
NotificationService::current()->Notify(
chrome::NOTIFICATION_PROFILE_DESTROYED, Source<Profile>(this),
NotificationService::NoDetails());
@@ -539,22 +549,10 @@ void OffTheRecordProfileImpl::InitChromeOSPreferences() {
}
#endif // defined(OS_CHROMEOS)
-void OffTheRecordProfileImpl::ExitedOffTheRecordMode() {
- // DownloadManager is lazily created, so check before accessing it.
- if (download_manager_.get()) {
- // Drop our download manager so we forget about all the downloads made
- // in incognito mode.
- download_manager_->Shutdown();
- download_manager_ = NULL;
- }
-}
-
void OffTheRecordProfileImpl::OnBrowserAdded(const Browser* browser) {
}
void OffTheRecordProfileImpl::OnBrowserRemoved(const Browser* browser) {
- if (BrowserList::GetBrowserCount(this) == 0)
- ExitedOffTheRecordMode();
}
ChromeBlobStorageContext* OffTheRecordProfileImpl::GetBlobStorageContext() {
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698