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

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

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years, 2 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: content/browser/download/base_file.h
diff --git a/content/browser/download/base_file.h b/content/browser/download/base_file.h
index 7076ef146678274ecb28fa62c4a57f5df583431b..e4ac541746d1a7cc8dbe25153d6c8a59ec981411 100644
--- a/content/browser/download/base_file.h
+++ b/content/browser/download/base_file.h
@@ -63,7 +63,17 @@ class CONTENT_EXPORT BaseFile {
bool in_progress() const { return file_stream_ != NULL; }
int64 bytes_so_far() const { return bytes_so_far_; }
- // Set |hash| with sha256 digest for the file.
+ // Copies the current sha256 digest for the file into |hash|. May be partial.
+ // Used to save the hash in the case of download resumption.
+ // Returns true on success, false on failure.
+ bool GetPartialSha256Hash(std::string* hash);
Randy Smith (Not in Mondays) 2011/10/31 18:46:43 I'd like to look at combining the concepts of part
ahendrickson 2011/11/13 21:15:20 Done.
+
+ // Sets the sha256 digest for the file from |hash|.
+ // Used to restore the hash in the case of download resumption.
+ // Returns true on success, false on failure.
+ bool SetPartialSha256Hash(const std::string& hash);
Randy Smith (Not in Mondays) 2011/10/31 18:46:43 Hmmm. This feels like something that's relevant o
ahendrickson 2011/11/13 21:15:20 I'd like to be able to set the partial hash in uni
Randy Smith (Not in Mondays) 2011/11/15 18:35:25 Why can't that be done in the constructor?
ahendrickson 2011/11/16 15:41:08 Done.
+
+ // Sets |hash| with sha256 digest for the file.
// Returns true if digest is successfully calculated.
virtual bool GetSha256Hash(std::string* hash);

Powered by Google App Engine
This is Rietveld 408576698