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

Unified Diff: chrome/browser/history/history.h

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r165669 Created 8 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
Index: chrome/browser/history/history.h
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index c8273e6022869aacdfe66adb1d855f3cd622693c..a8b47e50ace5efaa8321af3399b089596f0728a6 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -38,18 +38,16 @@ class BookmarkService;
class FilePath;
class GURL;
class HistoryURLProvider;
-struct HistoryURLProviderParams;
class PageUsageData;
class PageUsageRequest;
class Profile;
+struct DownloadPersistentStoreInfo;
+struct HistoryURLProviderParams;
namespace base {
class Thread;
}
-namespace content {
-struct DownloadPersistentStoreInfo;
-}
namespace history {
class InMemoryHistoryBackend;
@@ -356,7 +354,7 @@ class HistoryService : public CancelableRequestProvider,
// Requests the number of user-visible visits (i.e. no redirects or subframes)
// to all urls on the same scheme/host/port as |url|. This is only valid for
// HTTP and HTTPS URLs.
- Handle GetVisibleVisitCountToHost(
+ virtual Handle GetVisibleVisitCountToHost(
const GURL& url,
CancelableRequestConsumerBase* consumer,
const GetVisibleVisitCountToHostCallback& callback);
@@ -449,15 +447,15 @@ class HistoryService : public CancelableRequestProvider,
// Implemented by the caller of 'CreateDownload' below, and is called when the
// history service has created a new entry for a download in the history db.
- typedef base::Callback<void(int32, int64)> DownloadCreateCallback;
+ typedef base::Callback<void(int64)> DownloadCreateCallback;
// Begins a history request to create a new persistent entry for a download.
// 'info' contains all the download's creation state, and 'callback' runs
// when the history service request is complete.
- Handle CreateDownload(int32 id,
- const content::DownloadPersistentStoreInfo& info,
- CancelableRequestConsumerBase* consumer,
- const DownloadCreateCallback& callback);
+ virtual Handle CreateDownload(
Randy Smith (Not in Mondays) 2012/11/02 23:31:25 Probably worthwhile putting a note in here somewhe
benjhayden 2012/11/06 20:01:14 Added a note below the section header on L446. I'd
Randy Smith (Not in Mondays) 2012/11/07 21:10:29 I'm good with that, but I'd request that you speci
benjhayden 2012/11/08 21:40:03 Done.
+ const DownloadPersistentStoreInfo& info,
+ CancelableRequestConsumerBase* consumer,
+ const DownloadCreateCallback& callback);
// Implemented by the caller of 'GetNextDownloadId' below.
typedef base::Callback<void(int)> DownloadNextIdCallback;
@@ -469,15 +467,15 @@ class HistoryService : public CancelableRequestProvider,
// Implemented by the caller of 'QueryDownloads' below, and is called when the
// history service has retrieved a list of all download state. The call
typedef base::Callback<void(
- std::vector<content::DownloadPersistentStoreInfo>*)>
+ std::vector<DownloadPersistentStoreInfo>*)>
DownloadQueryCallback;
// Begins a history request to retrieve the state of all downloads in the
// history db. 'callback' runs when the history service request is complete,
// at which point 'info' contains an array of DownloadPersistentStoreInfo, one
// per download.
- Handle QueryDownloads(CancelableRequestConsumerBase* consumer,
- const DownloadQueryCallback& callback);
+ virtual Handle QueryDownloads(CancelableRequestConsumerBase* consumer,
+ const DownloadQueryCallback& callback);
// Begins a request to clean up entries that has been corrupted (because of
// the crash, for example).
@@ -486,22 +484,11 @@ class HistoryService : public CancelableRequestProvider,
// Called to update the history service about the current state of a download.
// This is a 'fire and forget' query, so just pass the relevant state info to
// the database with no need for a callback.
- void UpdateDownload(const content::DownloadPersistentStoreInfo& data);
-
- // Called to update the history service about the path of a download.
- // This is a 'fire and forget' query.
- void UpdateDownloadPath(const FilePath& path, int64 db_handle);
-
- // Permanently remove a download from the history system. This is a 'fire and
- // forget' operation.
- void RemoveDownload(int64 db_handle);
-
- // Permanently removes all completed download from the history system within
- // the specified range. This function does not delete downloads that are in
- // progress or in the process of being cancelled. This is a 'fire and forget'
- // operation. You can pass is_null times to get unbounded time in either or
- // both directions.
- void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end);
+ virtual void UpdateDownload(const DownloadPersistentStoreInfo& data);
+
+ // Permanently remove some downloads from the history system. This is a 'fire
+ // and forget' operation.
+ virtual void RemoveDownloads(const std::set<int64>& db_handles);
// Visit Segments ------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698