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

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

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added binary files based on c#37 Created 7 years, 11 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 // Allow objects to observe the download creation process. 134 // Allow objects to observe the download creation process.
135 virtual void AddObserver(Observer* observer) = 0; 135 virtual void AddObserver(Observer* observer) = 0;
136 136
137 // Remove a download observer from ourself. 137 // Remove a download observer from ourself.
138 virtual void RemoveObserver(Observer* observer) = 0; 138 virtual void RemoveObserver(Observer* observer) = 0;
139 139
140 // Called by the embedder, after creating the download manager, to let it know 140 // Called by the embedder, after creating the download manager, to let it know
141 // about downloads from previous runs of the browser. 141 // about downloads from previous runs of the browser.
142 virtual DownloadItem* CreateDownloadItem( 142 virtual DownloadItem* CreateDownloadItem(
143 const FilePath& path, 143 const FilePath& current_path,
144 const GURL& url, 144 const FilePath& target_path,
145 const std::vector<GURL>& url_chain,
145 const GURL& referrer_url, 146 const GURL& referrer_url,
146 const base::Time& start_time, 147 const base::Time& start_time,
147 const base::Time& end_time, 148 const base::Time& end_time,
148 int64 received_bytes, 149 int64 received_bytes,
149 int64 total_bytes, 150 int64 total_bytes,
150 DownloadItem::DownloadState state, 151 DownloadItem::DownloadState state,
152 DownloadDangerType danger_type,
153 DownloadInterruptReason interrupt_reason,
151 bool opened) = 0; 154 bool opened) = 0;
152 155
153 // The number of in progress (including paused) downloads. 156 // The number of in progress (including paused) downloads.
154 // Performance note: this loops over all items. If profiling finds that this 157 // Performance note: this loops over all items. If profiling finds that this
155 // is too slow, use an AllDownloadItemNotifier to count in-progress items. 158 // is too slow, use an AllDownloadItemNotifier to count in-progress items.
156 virtual int InProgressCount() const = 0; 159 virtual int InProgressCount() const = 0;
157 160
158 virtual BrowserContext* GetBrowserContext() const = 0; 161 virtual BrowserContext* GetBrowserContext() const = 0;
159 162
160 // Checks whether downloaded files still exist. Updates state of downloads 163 // Checks whether downloaded files still exist. Updates state of downloads
161 // that refer to removed files. The check runs in the background and may 164 // that refer to removed files. The check runs in the background and may
162 // finish asynchronously after this method returns. 165 // finish asynchronously after this method returns.
163 virtual void CheckForHistoryFilesRemoval() = 0; 166 virtual void CheckForHistoryFilesRemoval() = 0;
164 167
165 // Get the download item for |id| if present, no matter what type of download 168 // Get the download item for |id| if present, no matter what type of download
166 // it is or state it's in. 169 // it is or state it's in.
167 virtual DownloadItem* GetDownload(int id) = 0; 170 virtual DownloadItem* GetDownload(int id) = 0;
168 171
169 protected: 172 protected:
170 virtual ~DownloadManager() {} 173 virtual ~DownloadManager() {}
171 174
172 private: 175 private:
173 friend class base::RefCountedThreadSafe<DownloadManager>; 176 friend class base::RefCountedThreadSafe<DownloadManager>;
174 }; 177 };
175 178
176 } // namespace content 179 } // namespace content
177 180
178 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 181 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698