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 28 matching lines...) Expand all Loading... |
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 { | 47 namespace url { |
48 class Origin; | 48 class Origin; |
| 49 class OriginFilter; |
49 } | 50 } |
50 | 51 |
51 namespace content { | 52 namespace content { |
52 | 53 |
53 class BrowserContext; | 54 class BrowserContext; |
54 class ByteStreamReader; | 55 class ByteStreamReader; |
55 class DownloadManagerDelegate; | 56 class DownloadManagerDelegate; |
56 class DownloadQuery; | 57 class DownloadQuery; |
57 class DownloadRequestHandle; | 58 class DownloadRequestHandle; |
58 struct DownloadCreateInfo; | 59 struct DownloadCreateInfo; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 108 |
108 // Called by a download source (Currently DownloadResourceHandler) | 109 // Called by a download source (Currently DownloadResourceHandler) |
109 // to initiate the non-source portions of a download. | 110 // to initiate the non-source portions of a download. |
110 // Returns the id assigned to the download. If the DownloadCreateInfo | 111 // Returns the id assigned to the download. If the DownloadCreateInfo |
111 // specifies an id, that id will be used. | 112 // specifies an id, that id will be used. |
112 virtual void StartDownload( | 113 virtual void StartDownload( |
113 scoped_ptr<DownloadCreateInfo> info, | 114 scoped_ptr<DownloadCreateInfo> info, |
114 scoped_ptr<ByteStreamReader> stream, | 115 scoped_ptr<ByteStreamReader> stream, |
115 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; | 116 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; |
116 | 117 |
117 // Remove downloads which are same-origin with the given origin and pertain to | 118 // Remove downloads whose origins match the |origins| filter and are within |
118 // the given time constraints. (See |RemoveDownloadsBetween|.) | 119 // the given time constraints - after remove_begin (inclusive) and before |
119 virtual int RemoveDownloadsByOriginAndTime(const url::Origin& origin, | 120 // remove_end (exclusive). You may pass in null Time values to do an unbounded |
| 121 // delete in either direction. |
| 122 virtual int RemoveDownloadsByOriginAndTime(const url::OriginFilter* origins, |
120 base::Time remove_begin, | 123 base::Time remove_begin, |
121 base::Time remove_end) = 0; | 124 base::Time remove_end) = 0; |
122 | 125 |
123 // Remove downloads after remove_begin (inclusive) and before remove_end | |
124 // (exclusive). You may pass in null Time values to do an unbounded delete | |
125 // in either direction. | |
126 virtual int RemoveDownloadsBetween(base::Time remove_begin, | |
127 base::Time remove_end) = 0; | |
128 | |
129 // Remove downloads will delete all downloads that have a timestamp that is | 126 // Remove downloads will delete all downloads that have a timestamp that is |
130 // the same or more recent than |remove_begin|. The number of downloads | 127 // the same or more recent than |remove_begin|. The number of downloads |
131 // deleted is returned back to the caller. | 128 // deleted is returned back to the caller. |
132 virtual int RemoveDownloads(base::Time remove_begin) = 0; | 129 virtual int RemoveDownloads(base::Time remove_begin) = 0; |
133 | 130 |
134 // Remove all downloads will delete all downloads. The number of downloads | 131 // Remove all downloads will delete all downloads. The number of downloads |
135 // deleted is returned back to the caller. | 132 // deleted is returned back to the caller. |
136 virtual int RemoveAllDownloads() = 0; | 133 virtual int RemoveAllDownloads() = 0; |
137 | 134 |
138 // See DownloadUrlParameters for details about controlling the download. | 135 // See DownloadUrlParameters for details about controlling the download. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 virtual void CheckForHistoryFilesRemoval() = 0; | 181 virtual void CheckForHistoryFilesRemoval() = 0; |
185 | 182 |
186 // Get the download item for |id| if present, no matter what type of download | 183 // Get the download item for |id| if present, no matter what type of download |
187 // it is or state it's in. | 184 // it is or state it's in. |
188 virtual DownloadItem* GetDownload(uint32_t id) = 0; | 185 virtual DownloadItem* GetDownload(uint32_t id) = 0; |
189 }; | 186 }; |
190 | 187 |
191 } // namespace content | 188 } // namespace content |
192 | 189 |
193 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 190 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |