| 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 |
| 60 // Cancels the download request associated with this file. | 63 // Cancels the download request associated with this file. |
| 61 virtual void CancelDownloadRequest() = 0; | 64 virtual void CancelDownloadRequest() = 0; |
| 62 | 65 |
| 63 virtual int Id() const = 0; | 66 virtual int Id() const = 0; |
| 64 virtual DownloadManager* GetDownloadManager() = 0; | 67 virtual DownloadManager* GetDownloadManager() = 0; |
| 65 virtual const DownloadId& GlobalId() const = 0; | 68 virtual const DownloadId& GlobalId() const = 0; |
| 66 | 69 |
| 67 virtual std::string DebugString() const = 0; | 70 virtual std::string DebugString() const = 0; |
| 68 | 71 |
| 69 // Appends the passed-in |number| between parenthesis to the |path| before | 72 // 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 | 85 // Same as GetUniquePathNumber, except that it also checks the existence |
| 83 // of it with the given suffix. | 86 // of it with the given suffix. |
| 84 // If |path| does not exist, 0 is returned. If it fails to find such | 87 // If |path| does not exist, 0 is returned. If it fails to find such |
| 85 // a number, -1 is returned. | 88 // a number, -1 is returned. |
| 86 static int GetUniquePathNumberWithSuffix( | 89 static int GetUniquePathNumberWithSuffix( |
| 87 const FilePath& path, | 90 const FilePath& path, |
| 88 const FilePath::StringType& suffix); | 91 const FilePath::StringType& suffix); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 94 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |