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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // clearing |downloads| first. | 108 // clearing |downloads| first. |
109 virtual void GetAllDownloads(DownloadVector* downloads) = 0; | 109 virtual void GetAllDownloads(DownloadVector* downloads) = 0; |
110 | 110 |
111 // Returns true if initialized properly. | 111 // Returns true if initialized properly. |
112 virtual bool Init(BrowserContext* browser_context) = 0; | 112 virtual bool Init(BrowserContext* browser_context) = 0; |
113 | 113 |
114 // Called by a download source (Currently DownloadResourceHandler) | 114 // Called by a download source (Currently DownloadResourceHandler) |
115 // to initiate the non-source portions of a download. | 115 // to initiate the non-source portions of a download. |
116 // Returns the id assigned to the download. If the DownloadCreateInfo | 116 // Returns the id assigned to the download. If the DownloadCreateInfo |
117 // specifies an id, that id will be used. | 117 // specifies an id, that id will be used. |
118 virtual DownloadId StartDownload( | 118 virtual DownloadItem* StartDownload( |
119 scoped_ptr<DownloadCreateInfo> info, | 119 scoped_ptr<DownloadCreateInfo> info, |
120 scoped_ptr<ByteStreamReader> stream) = 0; | 120 scoped_ptr<ByteStreamReader> stream) = 0; |
121 | 121 |
122 // Notifications sent from the download thread to the UI thread | 122 // Notifications sent from the download thread to the UI thread |
123 virtual void UpdateDownload(int32 download_id, | 123 virtual void UpdateDownload(int32 download_id, |
124 int64 bytes_so_far, | 124 int64 bytes_so_far, |
125 int64 bytes_per_sec, | 125 int64 bytes_per_sec, |
126 const std::string& hash_state) = 0; | 126 const std::string& hash_state) = 0; |
127 | 127 |
128 // |download_id| is the ID of the download. | 128 // |download_id| is the ID of the download. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 protected: | 200 protected: |
201 virtual ~DownloadManager() {} | 201 virtual ~DownloadManager() {} |
202 | 202 |
203 private: | 203 private: |
204 friend class base::RefCountedThreadSafe<DownloadManager>; | 204 friend class base::RefCountedThreadSafe<DownloadManager>; |
205 }; | 205 }; |
206 | 206 |
207 } // namespace content | 207 } // namespace content |
208 | 208 |
209 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 209 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |