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

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

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 protected: 94 protected:
95 virtual ~Observer() {} 95 virtual ~Observer() {}
96 }; 96 };
97 97
98 typedef std::vector<DownloadItem*> DownloadVector; 98 typedef std::vector<DownloadItem*> DownloadVector;
99 99
100 // Add all download items to |downloads|, no matter the type or state, without 100 // Add all download items to |downloads|, no matter the type or state, without
101 // clearing |downloads| first. 101 // clearing |downloads| first.
102 virtual void GetAllDownloads(DownloadVector* downloads) = 0; 102 virtual void GetAllDownloads(DownloadVector* downloads) = 0;
103 103
104 // Called by a download source (Currently DownloadResourceHandler) 104 // Handles a download that's already in progress. The |request_handle|
105 // to initiate the non-source portions of a download. 105 // provides a handle for controlling the download. |info| specifies parameters
106 // Returns the id assigned to the download. If the DownloadCreateInfo 106 // for the new download including the ByteStreamReader.
107 // specifies an id, that id will be used. 107 virtual void StartDownloadWithActiveRequest(
108 virtual void StartDownload( 108 scoped_ptr<DownloadRequestHandle> request_handle,
109 scoped_ptr<DownloadCreateInfo> info, 109 scoped_ptr<DownloadCreateInfo> info) = 0;
110 scoped_ptr<ByteStreamReader> stream,
111 const DownloadUrlParameters::OnStartedCallback& on_started) = 0;
112 110
113 // Remove downloads after remove_begin (inclusive) and before remove_end 111 // Remove downloads after remove_begin (inclusive) and before remove_end
114 // (exclusive). You may pass in null Time values to do an unbounded delete 112 // (exclusive). You may pass in null Time values to do an unbounded delete
115 // in either direction. 113 // in either direction.
116 virtual int RemoveDownloadsBetween(base::Time remove_begin, 114 virtual int RemoveDownloadsBetween(base::Time remove_begin,
117 base::Time remove_end) = 0; 115 base::Time remove_end) = 0;
118 116
119 // Remove downloads will delete all downloads that have a timestamp that is 117 // 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 118 // the same or more recent than |remove_begin|. The number of downloads
121 // deleted is returned back to the caller. 119 // deleted is returned back to the caller.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 virtual void CheckForHistoryFilesRemoval() = 0; 164 virtual void CheckForHistoryFilesRemoval() = 0;
167 165
168 // Get the download item for |id| if present, no matter what type of download 166 // Get the download item for |id| if present, no matter what type of download
169 // it is or state it's in. 167 // it is or state it's in.
170 virtual DownloadItem* GetDownload(uint32 id) = 0; 168 virtual DownloadItem* GetDownload(uint32 id) = 0;
171 }; 169 };
172 170
173 } // namespace content 171 } // namespace content
174 172
175 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 173 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « content/public/browser/download_interrupt_reasons.h ('k') | content/public/browser/download_url_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698