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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/download_interrupt_reasons.h" | 15 #include "content/public/browser/download_interrupt_reasons.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class DownloadManager; | |
22 | |
23 // These objects live exclusively on the file thread and handle the writing | 21 // These objects live exclusively on the file thread and handle the writing |
24 // operations for one download. These objects live only for the duration that | 22 // operations for one download. These objects live only for the duration that |
25 // the download is 'in progress': once the download has been completed or | 23 // the download is 'in progress': once the download has been completed or |
26 // cancelled, the DownloadFile is destroyed. | 24 // cancelled, the DownloadFile is destroyed. |
27 class CONTENT_EXPORT DownloadFile { | 25 class CONTENT_EXPORT DownloadFile { |
28 public: | 26 public: |
29 // Callback used with Initialize. On a successful initialize, |reason| will | 27 // Callback used with Initialize. On a successful initialize, |reason| will |
30 // be DOWNLOAD_INTERRUPT_REASON_NONE; on a failed initialize, it will be | 28 // be DOWNLOAD_INTERRUPT_REASON_NONE; on a failed initialize, it will be |
31 // set to the reason for the failure. | 29 // set to the reason for the failure. |
32 typedef base::Callback<void(DownloadInterruptReason reason)> | 30 typedef base::Callback<void(DownloadInterruptReason reason)> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Abort the download and automatically close the file. | 66 // Abort the download and automatically close the file. |
69 virtual void Cancel() = 0; | 67 virtual void Cancel() = 0; |
70 | 68 |
71 virtual const base::FilePath& FullPath() const = 0; | 69 virtual const base::FilePath& FullPath() const = 0; |
72 virtual bool InProgress() const = 0; | 70 virtual bool InProgress() const = 0; |
73 }; | 71 }; |
74 | 72 |
75 } // namespace content | 73 } // namespace content |
76 | 74 |
77 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 75 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
OLD | NEW |