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

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

Issue 7192016: chrome.experimental.downloads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merged db_handle, id; onCreated, onErased 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/history/download_database.h
diff --git a/chrome/browser/history/download_database.h b/chrome/browser/history/download_database.h
index bef60a1bc5cedaaceea235828407b2d6f2d0dee3..4109c94fc85c13d8c4347ff5444487af88fe2655 100644
--- a/chrome/browser/history/download_database.h
+++ b/chrome/browser/history/download_database.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_
#pragma once
+#include "base/callback.h"
#include "chrome/browser/history/history_types.h"
struct DownloadHistoryInfo;
@@ -25,13 +26,13 @@ class DownloadDatabase {
virtual ~DownloadDatabase();
// Get all the downloads from the database.
- void QueryDownloads(std::vector<DownloadHistoryInfo>* results);
+ void QueryDownloads(DownloadQueryParameters* params);
// Update the state of one download. Returns true if successful.
- bool UpdateDownload(int64 received_bytes, int32 state, DownloadID db_handle);
+ bool UpdateDownload(int64 received_bytes, int32 state, DownloadID id);
// Update the path of one download. Returns true if successful.
- bool UpdateDownloadPath(const FilePath& path, DownloadID db_handle);
+ bool UpdateDownloadPath(const FilePath& path, DownloadID id);
// Fixes state of the download entries. Sometimes entries with IN_PROGRESS
// state are not updated during browser shutdown (particularly when crashing).
@@ -40,10 +41,10 @@ class DownloadDatabase {
bool CleanUpInProgressEntries();
// Create a new database entry for one download and return its primary db id.
- int64 CreateDownload(const DownloadHistoryInfo& info);
+ bool CreateDownload(const DownloadHistoryInfo& info);
// Remove a download from the database.
- void RemoveDownload(DownloadID db_handle);
+ void RemoveDownload(DownloadID id);
// Remove all completed downloads that started after |remove_begin|
// (inclusive) and before |remove_end|. You may use null Time values
@@ -63,6 +64,8 @@ class DownloadDatabase {
bool DropDownloadTable();
private:
+ bool MaybeUpgradeTable(DownloadQueryParameters::GetNextIdThunk get_next_id);
+
DISALLOW_COPY_AND_ASSIGN(DownloadDatabase);
};
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/browser/history/download_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698