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

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, move DM Shutdown to ~OTRProfileImpl 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/history/history_marshaling.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 120b2d1a89848fb2eba988336509742b72b8843d..2525bc6cc15019bdd2f6c946fee7cb346f01585f 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -128,6 +128,16 @@ class OffTheRecordProfileImpl : public Profile,
}
virtual ~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());
@@ -523,13 +533,6 @@ class OffTheRecordProfileImpl : public Profile,
#endif // defined(OS_CHROMEOS)
virtual void ExitedOffTheRecordMode() {
willchan no longer on Chromium 2011/09/12 22:09:41 Can we get rid of this? Or is it still needed?
benjhayden 2011/09/14 19:25:42 Done.
- // 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;
- }
}
virtual void OnBrowserAdded(const Browser* browser) {
« no previous file with comments | « chrome/browser/history/history_marshaling.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698