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

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

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.h
diff --git a/chrome/browser/download/download_history.h b/chrome/browser/download/download_history.h
index f4b48812137e7d34848e623cb39fb957f81e3e1d..1fea26b16492c3efdb9267879b1b295a338e3689 100644
--- a/chrome/browser/download/download_history.h
+++ b/chrome/browser/download/download_history.h
@@ -51,8 +51,10 @@ class DownloadHistory {
void UpdateDownloadPath(DownloadItem* download_item,
const FilePath& new_path);
- // Removes |download_item| from the history database.
- void RemoveEntry(DownloadItem* download_item);
+ // Removes the download identified by |db_handle| from the history database.
+ // |db_handle| is used instead of the DownloadItem pointer to allow
+ // removal after deletion of the download item.
+ void RemoveEntry(int64 db_handle);
// Removes download-related history entries in the given time range.
void RemoveEntriesBetween(const base::Time remove_begin,
@@ -61,6 +63,10 @@ class DownloadHistory {
// Returns a new unique database handle which will not collide with real ones.
int64 GetNextFakeDbHandle();
+ // Returns whether a given handle is fake. True for
+ // kUninitializedHandle and all returns from GetNextFakeDbHandle().
+ static bool IsFakeHandle(int64 db_handle);
+
private:
typedef std::map<HistoryService::Handle,
std::pair<int32, VisitedBeforeDoneCallback*> >

Powered by Google App Engine
This is Rietveld 408576698