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 // The DownloadManager object manages the process of downloading, including | 5 // The DownloadManager object manages the process of downloading, including |
6 // updates to the history system and providing the information for displaying | 6 // updates to the history system and providing the information for displaying |
7 // the downloads view in the Destinations tab. There is one DownloadManager per | 7 // the downloads view in the Destinations tab. There is one DownloadManager per |
8 // active browser context in Chrome. | 8 // active browser context in Chrome. |
9 // | 9 // |
10 // Download observers: | 10 // Download observers: |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "base/sequenced_task_runner_helpers.h" | 37 #include "base/sequenced_task_runner_helpers.h" |
38 #include "base/time/time.h" | 38 #include "base/time/time.h" |
39 #include "content/public/browser/download_interrupt_reasons.h" | 39 #include "content/public/browser/download_interrupt_reasons.h" |
40 #include "content/public/browser/download_item.h" | 40 #include "content/public/browser/download_item.h" |
41 #include "content/public/browser/download_url_parameters.h" | 41 #include "content/public/browser/download_url_parameters.h" |
42 #include "net/base/net_errors.h" | 42 #include "net/base/net_errors.h" |
43 #include "net/log/net_log.h" | 43 #include "net/log/net_log.h" |
44 | 44 |
45 class GURL; | 45 class GURL; |
46 | 46 |
| 47 namespace url { |
| 48 class Origin; |
| 49 } |
| 50 |
47 namespace content { | 51 namespace content { |
48 | 52 |
49 class BrowserContext; | 53 class BrowserContext; |
50 class ByteStreamReader; | 54 class ByteStreamReader; |
51 class DownloadManagerDelegate; | 55 class DownloadManagerDelegate; |
52 class DownloadQuery; | 56 class DownloadQuery; |
53 class DownloadRequestHandle; | 57 class DownloadRequestHandle; |
54 struct DownloadCreateInfo; | 58 struct DownloadCreateInfo; |
55 | 59 |
56 // Browser's download manager: manages all downloads and destination view. | 60 // Browser's download manager: manages all downloads and destination view. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 107 |
104 // Called by a download source (Currently DownloadResourceHandler) | 108 // Called by a download source (Currently DownloadResourceHandler) |
105 // to initiate the non-source portions of a download. | 109 // to initiate the non-source portions of a download. |
106 // Returns the id assigned to the download. If the DownloadCreateInfo | 110 // Returns the id assigned to the download. If the DownloadCreateInfo |
107 // specifies an id, that id will be used. | 111 // specifies an id, that id will be used. |
108 virtual void StartDownload( | 112 virtual void StartDownload( |
109 scoped_ptr<DownloadCreateInfo> info, | 113 scoped_ptr<DownloadCreateInfo> info, |
110 scoped_ptr<ByteStreamReader> stream, | 114 scoped_ptr<ByteStreamReader> stream, |
111 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; | 115 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; |
112 | 116 |
| 117 // Remove downloads which are same-origin with the given origin and pertain to |
| 118 // the given time constraints. (See |RemoveDownloadsBetween|.) |
| 119 virtual int RemoveDownloadsByOriginAndTime(const url::Origin& origin, |
| 120 base::Time remove_begin, |
| 121 base::Time remove_end) = 0; |
| 122 |
113 // Remove downloads after remove_begin (inclusive) and before remove_end | 123 // Remove downloads after remove_begin (inclusive) and before remove_end |
114 // (exclusive). You may pass in null Time values to do an unbounded delete | 124 // (exclusive). You may pass in null Time values to do an unbounded delete |
115 // in either direction. | 125 // in either direction. |
116 virtual int RemoveDownloadsBetween(base::Time remove_begin, | 126 virtual int RemoveDownloadsBetween(base::Time remove_begin, |
117 base::Time remove_end) = 0; | 127 base::Time remove_end) = 0; |
118 | 128 |
119 // Remove downloads will delete all downloads that have a timestamp that is | 129 // Remove downloads will delete all downloads that have a timestamp that is |
120 // the same or more recent than |remove_begin|. The number of downloads | 130 // the same or more recent than |remove_begin|. The number of downloads |
121 // deleted is returned back to the caller. | 131 // deleted is returned back to the caller. |
122 virtual int RemoveDownloads(base::Time remove_begin) = 0; | 132 virtual int RemoveDownloads(base::Time remove_begin) = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 virtual void CheckForHistoryFilesRemoval() = 0; | 184 virtual void CheckForHistoryFilesRemoval() = 0; |
175 | 185 |
176 // Get the download item for |id| if present, no matter what type of download | 186 // Get the download item for |id| if present, no matter what type of download |
177 // it is or state it's in. | 187 // it is or state it's in. |
178 virtual DownloadItem* GetDownload(uint32 id) = 0; | 188 virtual DownloadItem* GetDownload(uint32 id) = 0; |
179 }; | 189 }; |
180 | 190 |
181 } // namespace content | 191 } // namespace content |
182 | 192 |
183 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 193 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |