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

Unified Diff: chrome/browser/download/download_history.cc

Issue 7294013: Modified cancel and interrupt processing to avoid race with history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed various problems surfaced by trybots. Created 9 years, 5 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/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 115541a4d24742ed52fa9ed9683f915109b60175..fc400309399b37db0630904a282ad9285b58c43c 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -120,14 +120,14 @@ void DownloadHistory::UpdateDownloadPath(DownloadItem* download_item,
hs->UpdateDownloadPath(new_path, download_item->db_handle());
}
-void DownloadHistory::RemoveEntry(DownloadItem* download_item) {
+void DownloadHistory::RemoveEntry(int64 db_handle) {
// No update necessary if the download was initiated while in incognito mode.
- if (download_item->db_handle() <= kUninitializedHandle)
+ if (db_handle <= kUninitializedHandle)
benjhayden 2011/07/06 18:12:06 Do you want to start using IsFakeHandle(db_handle)
Randy Smith (Not in Mondays) 2011/07/07 22:02:23 I think of IsFakeHandle as an interface to Downloa
return;
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (hs)
- hs->RemoveDownload(download_item->db_handle());
+ hs->RemoveDownload(db_handle);
}
void DownloadHistory::RemoveEntriesBetween(const base::Time remove_begin,
@@ -141,6 +141,11 @@ int64 DownloadHistory::GetNextFakeDbHandle() {
return next_fake_db_handle_--;
}
+// static
+bool DownloadHistory::IsFakeHandle(int64 db_handle) {
+ return db_handle <= 0;
benjhayden 2011/07/06 18:12:06 db_handle <= kUninitializedHandle;
Randy Smith (Not in Mondays) 2011/07/07 22:02:23 Done.
+}
+
void DownloadHistory::OnGotVisitCountToHost(HistoryService::Handle handle,
bool found_visits,
int count,

Powered by Google App Engine
This is Rietveld 408576698