Index: chrome/browser/download/chrome_download_manager_delegate.cc |
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc |
index fc95cbf4f129ef68b2e2c50d187f02548b1c81d1..c873c2eb9e4749bc5bf84cf63a72a01aead9aaaa 100644 |
--- a/chrome/browser/download/chrome_download_manager_delegate.cc |
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc |
@@ -132,9 +132,11 @@ ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { |
void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { |
download_manager_ = dm; |
download_history_.reset(new DownloadHistory(profile_)); |
- download_history_->Load( |
- base::Bind(&DownloadManager::OnPersistentStoreQueryComplete, |
- base::Unretained(dm))); |
+ if (profile_->GetOriginalProfile() == profile_) { |
Randy Smith (Not in Mondays)
2012/08/02 17:52:17
Did you consider doing this at the DownloadHistory
benjhayden
2012/08/13 15:08:09
I think we agreed to keep the conditionals in CDMD
Randy Smith (Not in Mondays)
2012/08/13 18:52:58
Yep, that's my memory too.
|
+ download_history_->Load( |
+ base::Bind(&DownloadManager::OnPersistentStoreQueryComplete, |
+ download_manager_)); |
Randy Smith (Not in Mondays)
2012/08/02 17:52:17
I'm somewhat uncomfortable here. I'll agree in ad
benjhayden
2012/08/13 15:08:09
This call is disappearing in my DownloadHistory CL
Randy Smith (Not in Mondays)
2012/08/13 18:52:58
The problem is someone (say a poor idealistic new
benjhayden
2012/08/13 20:26:24
Done.
|
+ } |
#if !defined(OS_ANDROID) |
extension_event_router_.reset(new ExtensionDownloadsEventRouter( |
profile_, download_manager_)); |
@@ -424,9 +426,14 @@ bool ChromeDownloadManagerDelegate::GenerateFileHash() { |
void ChromeDownloadManagerDelegate::AddItemToPersistentStore( |
DownloadItem* item) { |
+ if (profile_->IsOffTheRecord()) { |
+ OnItemAddedToPersistentStore( |
+ item->GetId(), download_history_->GetNextFakeDbHandle()); |
+ return; |
+ } |
download_history_->AddEntry(item, |
base::Bind(&ChromeDownloadManagerDelegate::OnItemAddedToPersistentStore, |
- base::Unretained(this))); |
+ this)); |
} |
void ChromeDownloadManagerDelegate::UpdateItemInPersistentStore( |
@@ -448,6 +455,8 @@ void ChromeDownloadManagerDelegate::RemoveItemFromPersistentStore( |
void ChromeDownloadManagerDelegate::RemoveItemsFromPersistentStoreBetween( |
base::Time remove_begin, |
base::Time remove_end) { |
+ if (profile_->IsOffTheRecord()) |
+ return; |
download_history_->RemoveEntriesBetween(remove_begin, remove_end); |
} |
@@ -578,7 +587,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadUrlDone( |
download_history_->CheckVisitedReferrerBefore( |
download_id, download->GetReferrerUrl(), |
base::Bind(&ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone, |
- base::Unretained(this), download_id, callback, danger_type)); |
+ this, download_id, callback, danger_type)); |
} |
void ChromeDownloadManagerDelegate::CheckClientDownloadDone( |