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

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

Issue 8503018: Split DownloadItem into an ABC, an Impl, and a Mock. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge Created 9 years, 1 month 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/download/download_extension_api.cc ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index dde224040ea82a735e03814c0138625fcbd28fa3..93af0d5b214b7696b24d487ecc769da7b099fe9d 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -72,14 +72,14 @@ void DownloadHistory::AddEntry(
// you'd have to do enough downloading that your ISP would likely stab you in
// the neck first. YMMV.
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
- if (download_item->is_otr() ||
+ if (download_item->IsOtr() ||
ChromeDownloadManagerDelegate::IsExtensionDownload(download_item) ||
- download_item->is_temporary() || !hs) {
- callback.Run(download_item->id(), GetNextFakeDbHandle());
+ download_item->IsTemporary() || !hs) {
+ callback.Run(download_item->GetId(), GetNextFakeDbHandle());
return;
}
- int32 id = download_item->id();
+ int32 id = download_item->GetId();
DownloadPersistentStoreInfo history_info =
download_item->GetPersistentStoreInfo();
hs->CreateDownload(id, history_info, &history_consumer_, callback);
@@ -88,7 +88,7 @@ void DownloadHistory::AddEntry(
void DownloadHistory::UpdateEntry(DownloadItem* download_item) {
// Don't store info in the database if the download was initiated while in
// incognito mode or if it hasn't been initialized in our database table.
- if (download_item->db_handle() <= DownloadItem::kUninitializedHandle)
+ if (download_item->GetDbHandle() <= DownloadItem::kUninitializedHandle)
return;
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
@@ -100,22 +100,22 @@ void DownloadHistory::UpdateEntry(DownloadItem* download_item) {
void DownloadHistory::UpdateDownloadPath(DownloadItem* download_item,
const FilePath& new_path) {
// No update necessary if the download was initiated while in incognito mode.
- if (download_item->db_handle() <= DownloadItem::kUninitializedHandle)
+ if (download_item->GetDbHandle() <= DownloadItem::kUninitializedHandle)
return;
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (hs)
- hs->UpdateDownloadPath(new_path, download_item->db_handle());
+ hs->UpdateDownloadPath(new_path, download_item->GetDbHandle());
}
void DownloadHistory::RemoveEntry(DownloadItem* download_item) {
// No update necessary if the download was initiated while in incognito mode.
- if (download_item->db_handle() <= DownloadItem::kUninitializedHandle)
+ if (download_item->GetDbHandle() <= DownloadItem::kUninitializedHandle)
return;
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (hs)
- hs->RemoveDownload(download_item->db_handle());
+ hs->RemoveDownload(download_item->GetDbHandle());
}
void DownloadHistory::RemoveEntriesBetween(const base::Time remove_begin,
« no previous file with comments | « chrome/browser/download/download_extension_api.cc ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698