OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
6 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 6 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
7 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 7 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include "content/public/browser/download_manager.h" | 10 #include "content/public/browser/download_manager.h" |
11 | 11 |
12 #include <map> | 12 #include <map> |
13 #include <set> | 13 #include <set> |
14 | 14 |
15 #include "base/hash_tables.h" | 15 #include "base/hash_tables.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/message_loop_helpers.h" |
19 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
20 #include "base/synchronization/lock.h" | 21 #include "base/synchronization/lock.h" |
21 #include "content/browser/download/download_item_impl.h" | 22 #include "content/browser/download/download_item_impl.h" |
22 #include "content/browser/download/download_status_updater_delegate.h" | 23 #include "content/browser/download/download_status_updater_delegate.h" |
23 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
24 | 25 |
25 class DownloadIdFactory; | 26 class DownloadIdFactory; |
26 class DownloadStatusUpdater; | 27 class DownloadStatusUpdater; |
27 | 28 |
28 class CONTENT_EXPORT DownloadManagerImpl | 29 class CONTENT_EXPORT DownloadManagerImpl |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 typedef base::hash_map<int64, content::DownloadItem*> DownloadMap; | 132 typedef base::hash_map<int64, content::DownloadItem*> DownloadMap; |
132 | 133 |
133 // For testing. | 134 // For testing. |
134 friend class DownloadManagerTest; | 135 friend class DownloadManagerTest; |
135 friend class DownloadTest; | 136 friend class DownloadTest; |
136 | 137 |
137 friend class base::RefCountedThreadSafe< | 138 friend class base::RefCountedThreadSafe< |
138 DownloadManagerImpl, content::BrowserThread::DeleteOnUIThread>; | 139 DownloadManagerImpl, content::BrowserThread::DeleteOnUIThread>; |
139 friend struct content::BrowserThread::DeleteOnThread< | 140 friend struct content::BrowserThread::DeleteOnThread< |
140 content::BrowserThread::UI>; | 141 content::BrowserThread::UI>; |
141 friend class DeleteTask<DownloadManagerImpl>; | 142 friend class base::DeleteHelper<DownloadManagerImpl>; |
142 | 143 |
143 virtual ~DownloadManagerImpl(); | 144 virtual ~DownloadManagerImpl(); |
144 | 145 |
145 // Determine if the download is ready for completion, i.e. has had | 146 // Determine if the download is ready for completion, i.e. has had |
146 // all data saved, and completed the filename determination and | 147 // all data saved, and completed the filename determination and |
147 // history insertion. | 148 // history insertion. |
148 bool IsDownloadReadyForCompletion(content::DownloadItem* download); | 149 bool IsDownloadReadyForCompletion(content::DownloadItem* download); |
149 | 150 |
150 // Show the download in the browser. | 151 // Show the download in the browser. |
151 void ShowDownloadInBrowser(content::DownloadItem* download); | 152 void ShowDownloadInBrowser(content::DownloadItem* download); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 DownloadIdFactory* id_factory_; | 271 DownloadIdFactory* id_factory_; |
271 | 272 |
272 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. | 273 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. |
273 // For debugging only. | 274 // For debugging only. |
274 int64 largest_db_handle_in_history_; | 275 int64 largest_db_handle_in_history_; |
275 | 276 |
276 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); | 277 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); |
277 }; | 278 }; |
278 | 279 |
279 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 280 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
OLD | NEW |