| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Each download is represented by a DownloadItem, and all DownloadItems | 5 // Each download is represented by a DownloadItem, and all DownloadItems |
| 6 // are owned by the DownloadManager which maintains a global list of all | 6 // are owned by the DownloadManager which maintains a global list of all |
| 7 // downloads. DownloadItems are created when a user initiates a download, | 7 // downloads. DownloadItems are created when a user initiates a download, |
| 8 // and exist for the duration of the browser life time. | 8 // and exist for the duration of the browser life time. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 // Full path to the downloaded or downloading file. This is the path to the | 291 // Full path to the downloaded or downloading file. This is the path to the |
| 292 // physical file, if one exists. It should be considered a hint; changes to | 292 // physical file, if one exists. It should be considered a hint; changes to |
| 293 // this value and renames of the file on disk are not atomic with each other. | 293 // this value and renames of the file on disk are not atomic with each other. |
| 294 // May be empty if the in-progress path hasn't been determined yet or if the | 294 // May be empty if the in-progress path hasn't been determined yet or if the |
| 295 // download was interrupted. | 295 // download was interrupted. |
| 296 // | 296 // |
| 297 // DO NOT USE THIS METHOD to access the target path of the DownloadItem. Use | 297 // DO NOT USE THIS METHOD to access the target path of the DownloadItem. Use |
| 298 // GetTargetFilePath() instead. While the download is in progress, the | 298 // GetTargetFilePath() instead. While the download is in progress, the |
| 299 // intermediate file named by GetFullPath() may be renamed or disappear | 299 // intermediate file named by GetFullPath() may be renamed or disappear |
| 300 // completely on the FILE thread. The path may also be reset to empty when the | 300 // completely on the download sequence. The path may also be reset to empty |
| 301 // download is interrupted. | 301 // when the download is interrupted. |
| 302 virtual const base::FilePath& GetFullPath() const = 0; | 302 virtual const base::FilePath& GetFullPath() const = 0; |
| 303 | 303 |
| 304 // Target path of an in-progress download. We may be downloading to a | 304 // Target path of an in-progress download. We may be downloading to a |
| 305 // temporary or intermediate file (specified by GetFullPath()); this is the | 305 // temporary or intermediate file (specified by GetFullPath()); this is the |
| 306 // name we will use once the download completes. | 306 // name we will use once the download completes. |
| 307 // May be empty if the target path hasn't yet been determined. | 307 // May be empty if the target path hasn't yet been determined. |
| 308 virtual const base::FilePath& GetTargetFilePath() const = 0; | 308 virtual const base::FilePath& GetTargetFilePath() const = 0; |
| 309 | 309 |
| 310 // If the download forced a path rather than requesting name determination, | 310 // If the download forced a path rather than requesting name determination, |
| 311 // return the path requested. | 311 // return the path requested. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 // return |name|. Has no effect on the final target filename. | 457 // return |name|. Has no effect on the final target filename. |
| 458 virtual void SetDisplayName(const base::FilePath& name) = 0; | 458 virtual void SetDisplayName(const base::FilePath& name) = 0; |
| 459 | 459 |
| 460 // Debug/testing ------------------------------------------------------------- | 460 // Debug/testing ------------------------------------------------------------- |
| 461 virtual std::string DebugString(bool verbose) const = 0; | 461 virtual std::string DebugString(bool verbose) const = 0; |
| 462 }; | 462 }; |
| 463 | 463 |
| 464 } // namespace content | 464 } // namespace content |
| 465 | 465 |
| 466 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 466 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
| OLD | NEW |