Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 virtual void AnnotateWithSourceInformation() = 0; | 50 virtual void AnnotateWithSourceInformation() = 0; |
| 51 | 51 |
| 52 virtual FilePath FullPath() const = 0; | 52 virtual FilePath FullPath() const = 0; |
| 53 virtual bool InProgress() const = 0; | 53 virtual bool InProgress() const = 0; |
| 54 virtual int64 BytesSoFar() const = 0; | 54 virtual int64 BytesSoFar() const = 0; |
| 55 | 55 |
| 56 // Set |hash| with sha256 digest for the file. | 56 // Set |hash| with sha256 digest for the file. |
| 57 // Returns true if digest is successfully calculated. | 57 // Returns true if digest is successfully calculated. |
| 58 virtual bool GetSha256Hash(std::string* hash) = 0; | 58 virtual bool GetSha256Hash(std::string* hash) = 0; |
| 59 | 59 |
| 60 // Returns the current (intermediate) state of the hash as a byte string. | |
| 61 virtual std::string GetSha256HashState() = 0; | |
| 62 | |
| 63 // Resets the current state of the hash to the contents of |hash_state|. | |
| 64 virtual bool SetSha256HashState(const std::string& hash_state) = 0; | |
|
Randy Smith (Not in Mondays)
2011/11/22 17:37:49
Same comment as in base file; can we get rid of th
ahendrickson
2011/11/22 23:46:44
This one we can get rid of.
Done.
| |
| 65 | |
| 60 // Cancels the download request associated with this file. | 66 // Cancels the download request associated with this file. |
| 61 virtual void CancelDownloadRequest() = 0; | 67 virtual void CancelDownloadRequest() = 0; |
| 62 | 68 |
| 63 virtual int Id() const = 0; | 69 virtual int Id() const = 0; |
| 64 virtual DownloadManager* GetDownloadManager() = 0; | 70 virtual DownloadManager* GetDownloadManager() = 0; |
| 65 virtual const DownloadId& GlobalId() const = 0; | 71 virtual const DownloadId& GlobalId() const = 0; |
| 66 | 72 |
| 67 virtual std::string DebugString() const = 0; | 73 virtual std::string DebugString() const = 0; |
| 68 | 74 |
| 69 // Appends the passed-in |number| between parenthesis to the |path| before | 75 // Appends the passed-in |number| between parenthesis to the |path| before |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 82 // Same as GetUniquePathNumber, except that it also checks the existence | 88 // Same as GetUniquePathNumber, except that it also checks the existence |
| 83 // of it with the given suffix. | 89 // of it with the given suffix. |
| 84 // If |path| does not exist, 0 is returned. If it fails to find such | 90 // If |path| does not exist, 0 is returned. If it fails to find such |
| 85 // a number, -1 is returned. | 91 // a number, -1 is returned. |
| 86 static int GetUniquePathNumberWithSuffix( | 92 static int GetUniquePathNumberWithSuffix( |
| 87 const FilePath& path, | 93 const FilePath& path, |
| 88 const FilePath::StringType& suffix); | 94 const FilePath::StringType& suffix); |
| 89 }; | 95 }; |
| 90 | 96 |
| 91 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 97 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |