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

Unified Diff: content/browser/download/download_persistent_store_info.h

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated Randy's comments. 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
Index: content/browser/download/download_persistent_store_info.h
diff --git a/content/browser/download/download_persistent_store_info.h b/content/browser/download/download_persistent_store_info.h
index 84a2b990f12c306cea1c921463651c798cd1bf31..bee528fbc8b50993e55e012e0ba910e98cf67351 100644
--- a/content/browser/download/download_persistent_store_info.h
+++ b/content/browser/download/download_persistent_store_info.h
@@ -9,10 +9,12 @@
#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_PERSISTENT_STORE_INFO_H_
#pragma once
+#include <string>
#include <vector>
#include "base/file_path.h"
#include "base/time.h"
+#include "content/browser/download/interrupt_reasons.h"
#include "content/common/content_export.h"
#include "googleurl/src/gurl.h"
@@ -28,7 +30,6 @@ class DownloadItem;
// the history, all fields except |referrer_url| are set by the DownloadDatabase
// and read by the DownloadItem.
struct CONTENT_EXPORT DownloadPersistentStoreInfo {
- // TODO(ahendrickson) -- Reduce the number of constructors.
DownloadPersistentStoreInfo();
DownloadPersistentStoreInfo(const FilePath& path,
const GURL& url,
@@ -39,7 +40,11 @@ struct CONTENT_EXPORT DownloadPersistentStoreInfo {
int64 total,
int32 download_state,
int64 handle,
- bool download_opened);
+ bool download_opened,
+ const std::string& hash,
+ const std::string& last_modified,
+ const std::string& etag,
+ InterruptReason reason);
~DownloadPersistentStoreInfo(); // For linux-clang.
// The final path where the download is saved.
@@ -73,6 +78,20 @@ struct CONTENT_EXPORT DownloadPersistentStoreInfo {
// Whether this download has ever been opened from the browser.
bool opened;
+
+ // Sha256 hash of the content. This might be empty either because
+ // the download hasn't started yet or because the hash isn't needed
+ // (ChromeDownloadManagerDelegate::GenerateFileHash() returned false).
+ std::string hash;
+
+ // Server's time stamp for the file.
+ std::string last_modified_time;
+
+ // Server's ETAG for the file.
+ std::string etag;
+
+ // The reason that the download was interrupted (if it was).
+ InterruptReason last_reason;
};
#endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_PERSISTENT_STORE_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698