Chromium Code Reviews| 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) { |