| 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 #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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Callback used with Rename(). On a successful rename |reason| will be | 27 // Callback used with Rename(). On a successful rename |reason| will be |
| 28 // DOWNLOAD_INTERRUPT_REASON_NONE and |path| the path the rename | 28 // DOWNLOAD_INTERRUPT_REASON_NONE and |path| the path the rename |
| 29 // was done to. On a failed rename, |reason| will contain the | 29 // was done to. On a failed rename, |reason| will contain the |
| 30 // error. | 30 // error. |
| 31 typedef base::Callback<void(DownloadInterruptReason reason, | 31 typedef base::Callback<void(DownloadInterruptReason reason, |
| 32 const FilePath& path)> RenameCompletionCallback; | 32 const FilePath& path)> RenameCompletionCallback; |
| 33 | 33 |
| 34 virtual ~DownloadFile() {} | 34 virtual ~DownloadFile() {} |
| 35 | 35 |
| 36 // Returns DOWNLOAD_INTERRUPT_REASON_NONE on success, or a network | 36 // Returns DOWNLOAD_INTERRUPT_REASON_NONE on success, or a network |
| 37 // error code on failure. Upon completion, |callback| will be | 37 // download interrupt reason on failure. |
| 38 // called on the UI thread as per the comment above. | 38 // Upon completion, |callback| will be called on the UI |
| 39 // thread as per the comment above. |
| 39 virtual content::DownloadInterruptReason Initialize() = 0; | 40 virtual content::DownloadInterruptReason Initialize() = 0; |
| 40 | 41 |
| 41 // Rename the download file to |full_path|. If that file exists and | 42 // Rename the download file to |full_path|. If that file exists and |
| 42 // |overwrite_existing_file| is false, |full_path| will be uniquified by | 43 // |overwrite_existing_file| is false, |full_path| will be uniquified by |
| 43 // suffixing " (<number>)" to the file name before the extension. | 44 // suffixing " (<number>)" to the file name before the extension. |
| 44 // Upon completion, |callback| will be called on the UI thread | 45 // Upon completion, |callback| will be called on the UI thread |
| 45 // as per the comment above. | 46 // as per the comment above. |
| 46 virtual void Rename(const FilePath& full_path, | 47 virtual void Rename(const FilePath& full_path, |
| 47 bool overwrite_existing_file, | 48 bool overwrite_existing_file, |
| 48 const RenameCompletionCallback& callback) = 0; | 49 const RenameCompletionCallback& callback) = 0; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 virtual int Id() const = 0; | 76 virtual int Id() const = 0; |
| 76 virtual DownloadManager* GetDownloadManager() = 0; | 77 virtual DownloadManager* GetDownloadManager() = 0; |
| 77 virtual const DownloadId& GlobalId() const = 0; | 78 virtual const DownloadId& GlobalId() const = 0; |
| 78 | 79 |
| 79 virtual std::string DebugString() const = 0; | 80 virtual std::string DebugString() const = 0; |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace content | 83 } // namespace content |
| 83 | 84 |
| 84 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 85 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |