| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <unordered_map> | 13 #include <unordered_map> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/callback_forward.h" | 16 #include "base/callback_forward.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/sequenced_task_runner_helpers.h" | 21 #include "base/sequenced_task_runner_helpers.h" |
| 22 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
| 23 #include "content/browser/download/download_item_impl_delegate.h" | 23 #include "content/browser/download/download_item_impl_delegate.h" |
| 24 #include "content/browser/download/url_downloader.h" | 24 #include "content/browser/download/url_downloader.h" |
| 25 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/download_manager.h" | 27 #include "content/public/browser/download_manager.h" |
| 28 #include "content/public/browser/download_manager_delegate.h" | 28 #include "content/public/browser/download_manager_delegate.h" |
| 29 #include "content/public/browser/download_url_parameters.h" | 29 #include "content/public/browser/download_url_parameters.h" |
| 30 #include "net/traffic_annotation/network_traffic_annotation.h" |
| 30 | 31 |
| 31 namespace net { | 32 namespace net { |
| 32 class NetLog; | 33 class NetLog; |
| 33 } | 34 } |
| 34 | 35 |
| 35 namespace content { | 36 namespace content { |
| 36 class DownloadFileFactory; | 37 class DownloadFileFactory; |
| 37 class DownloadItemFactory; | 38 class DownloadItemFactory; |
| 38 class DownloadItemImpl; | 39 class DownloadItemImpl; |
| 39 class DownloadRequestHandleInterface; | 40 class DownloadRequestHandleInterface; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void GetAllDownloads(DownloadVector* result) override; | 73 void GetAllDownloads(DownloadVector* result) override; |
| 73 void StartDownload( | 74 void StartDownload( |
| 74 std::unique_ptr<DownloadCreateInfo> info, | 75 std::unique_ptr<DownloadCreateInfo> info, |
| 75 std::unique_ptr<ByteStreamReader> stream, | 76 std::unique_ptr<ByteStreamReader> stream, |
| 76 const DownloadUrlParameters::OnStartedCallback& on_started) override; | 77 const DownloadUrlParameters::OnStartedCallback& on_started) override; |
| 77 | 78 |
| 78 int RemoveDownloadsByURLAndTime( | 79 int RemoveDownloadsByURLAndTime( |
| 79 const base::Callback<bool(const GURL&)>& url_filter, | 80 const base::Callback<bool(const GURL&)>& url_filter, |
| 80 base::Time remove_begin, | 81 base::Time remove_begin, |
| 81 base::Time remove_end) override; | 82 base::Time remove_end) override; |
| 82 void DownloadUrl(std::unique_ptr<DownloadUrlParameters> params) override; | 83 void DownloadUrl( |
| 84 std::unique_ptr<DownloadUrlParameters> params, |
| 85 const net::NetworkTrafficAnnotationTag& traffic_annotation) override; |
| 83 void AddObserver(Observer* observer) override; | 86 void AddObserver(Observer* observer) override; |
| 84 void RemoveObserver(Observer* observer) override; | 87 void RemoveObserver(Observer* observer) override; |
| 85 content::DownloadItem* CreateDownloadItem( | 88 content::DownloadItem* CreateDownloadItem( |
| 86 const std::string& guid, | 89 const std::string& guid, |
| 87 uint32_t id, | 90 uint32_t id, |
| 88 const base::FilePath& current_path, | 91 const base::FilePath& current_path, |
| 89 const base::FilePath& target_path, | 92 const base::FilePath& target_path, |
| 90 const std::vector<GURL>& url_chain, | 93 const std::vector<GURL>& url_chain, |
| 91 const GURL& referrer_url, | 94 const GURL& referrer_url, |
| 92 const GURL& site_url, | 95 const GURL& site_url, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 url_downloaders_; | 250 url_downloaders_; |
| 248 | 251 |
| 249 base::WeakPtrFactory<DownloadManagerImpl> weak_factory_; | 252 base::WeakPtrFactory<DownloadManagerImpl> weak_factory_; |
| 250 | 253 |
| 251 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); | 254 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); |
| 252 }; | 255 }; |
| 253 | 256 |
| 254 } // namespace content | 257 } // namespace content |
| 255 | 258 |
| 256 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ | 259 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ |
| OLD | NEW |