Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(658)

Side by Side Diff: content/public/browser/download_manager.h

Issue 1603903002: Add an OriginFilterBuilder class for [white|black]listing origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase over 1246583002 Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 // Called by a download source (Currently DownloadResourceHandler) 108 // Called by a download source (Currently DownloadResourceHandler)
109 // to initiate the non-source portions of a download. 109 // to initiate the non-source portions of a download.
110 // Returns the id assigned to the download. If the DownloadCreateInfo 110 // Returns the id assigned to the download. If the DownloadCreateInfo
111 // specifies an id, that id will be used. 111 // specifies an id, that id will be used.
112 virtual void StartDownload( 112 virtual void StartDownload(
113 scoped_ptr<DownloadCreateInfo> info, 113 scoped_ptr<DownloadCreateInfo> info,
114 scoped_ptr<ByteStreamReader> stream, 114 scoped_ptr<ByteStreamReader> stream,
115 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; 115 const DownloadUrlParameters::OnStartedCallback& on_started) = 0;
116 116
117 // Remove downloads which are same-origin with the given origin and pertain to 117 // Remove downloads whose URLs match the |url_filter| and are within
118 // the given time constraints. (See |RemoveDownloadsBetween|.) 118 // the given time constraints - after remove_begin (inclusive) and before
119 virtual int RemoveDownloadsByOriginAndTime(const url::Origin& origin, 119 // remove_end (exclusive). You may pass in null Time values to do an unbounded
120 base::Time remove_begin, 120 // delete in either direction.
121 base::Time remove_end) = 0; 121 virtual int RemoveDownloadsByURLAndTime(
122 122 const base::Callback<bool(const GURL&)>& url_filter,
123 // Remove downloads after remove_begin (inclusive) and before remove_end 123 base::Time remove_begin,
124 // (exclusive). You may pass in null Time values to do an unbounded delete 124 base::Time remove_end) = 0;
125 // in either direction.
126 virtual int RemoveDownloadsBetween(base::Time remove_begin,
127 base::Time remove_end) = 0;
128 125
129 // Remove all downloads will delete all downloads. The number of downloads 126 // Remove all downloads will delete all downloads. The number of downloads
130 // deleted is returned back to the caller. 127 // deleted is returned back to the caller.
131 virtual int RemoveAllDownloads() = 0; 128 virtual int RemoveAllDownloads() = 0;
132 129
133 // See DownloadUrlParameters for details about controlling the download. 130 // See DownloadUrlParameters for details about controlling the download.
134 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> parameters) = 0; 131 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> parameters) = 0;
135 132
136 // Allow objects to observe the download creation process. 133 // Allow objects to observe the download creation process.
137 virtual void AddObserver(Observer* observer) = 0; 134 virtual void AddObserver(Observer* observer) = 0;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 virtual void CheckForHistoryFilesRemoval() = 0; 176 virtual void CheckForHistoryFilesRemoval() = 0;
180 177
181 // Get the download item for |id| if present, no matter what type of download 178 // Get the download item for |id| if present, no matter what type of download
182 // it is or state it's in. 179 // it is or state it's in.
183 virtual DownloadItem* GetDownload(uint32_t id) = 0; 180 virtual DownloadItem* GetDownload(uint32_t id) = 0;
184 }; 181 };
185 182
186 } // namespace content 183 } // namespace content
187 184
188 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 185 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/public/test/mock_download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698