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 |
113 // Remove downloads after remove_begin (inclusive) and before remove_end | 117 // Remove downloads which are same-origin with the given origin, are after |
114 // (exclusive). You may pass in null Time values to do an unbounded delete | 118 // remove_begin (inclusive), and before remove_end (exclusive). You may pass |
115 // in either direction. | 119 // in null Time values to do an unbounded delete in either direction. A |
116 virtual int RemoveDownloadsBetween(base::Time remove_begin, | 120 // unique origin causes all origins to be removed. |
Randy Smith (Not in Mondays)
2015/08/03 19:09:30
I'm uncomfortable with using unique origins to ind
Timo Reimann
2015/08/03 20:09:32
Sounds legitimate; especially since mkwst raised s
| |
121 virtual int RemoveDownloadsBetween(const url::Origin& origin_to_clear, | |
122 base::Time remove_begin, | |
117 base::Time remove_end) = 0; | 123 base::Time remove_end) = 0; |
118 | 124 |
119 // Remove downloads will delete all downloads that have a timestamp that is | 125 // 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 | 126 // the same or more recent than |remove_begin|. The number of downloads |
121 // deleted is returned back to the caller. | 127 // deleted is returned back to the caller. |
122 virtual int RemoveDownloads(base::Time remove_begin) = 0; | 128 virtual int RemoveDownloads(base::Time remove_begin) = 0; |
123 | 129 |
124 // Remove all downloads will delete all downloads. The number of downloads | 130 // Remove all downloads will delete all downloads. The number of downloads |
125 // deleted is returned back to the caller. | 131 // deleted is returned back to the caller. |
126 virtual int RemoveAllDownloads() = 0; | 132 virtual int RemoveAllDownloads() = 0; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 virtual void CheckForHistoryFilesRemoval() = 0; | 180 virtual void CheckForHistoryFilesRemoval() = 0; |
175 | 181 |
176 // Get the download item for |id| if present, no matter what type of download | 182 // Get the download item for |id| if present, no matter what type of download |
177 // it is or state it's in. | 183 // it is or state it's in. |
178 virtual DownloadItem* GetDownload(uint32 id) = 0; | 184 virtual DownloadItem* GetDownload(uint32 id) = 0; |
179 }; | 185 }; |
180 | 186 |
181 } // namespace content | 187 } // namespace content |
182 | 188 |
183 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 189 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |