| 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 #include "content/browser/download/download_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" | 
| 6 | 6 | 
| 7 #include <iterator> | 7 #include <iterator> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/bind.h" | 10 #include "base/bind.h" | 
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 134       const base::Time& end_time, | 134       const base::Time& end_time, | 
| 135       const std::string& etag, | 135       const std::string& etag, | 
| 136       const std::string& last_modified, | 136       const std::string& last_modified, | 
| 137       int64_t received_bytes, | 137       int64_t received_bytes, | 
| 138       int64_t total_bytes, | 138       int64_t total_bytes, | 
| 139       const std::string& hash, | 139       const std::string& hash, | 
| 140       DownloadItem::DownloadState state, | 140       DownloadItem::DownloadState state, | 
| 141       DownloadDangerType danger_type, | 141       DownloadDangerType danger_type, | 
| 142       DownloadInterruptReason interrupt_reason, | 142       DownloadInterruptReason interrupt_reason, | 
| 143       bool opened, | 143       bool opened, | 
|  | 144       const base::Time& last_access_time, | 
| 144       const std::vector<DownloadItem::ReceivedSlice>& received_slices, | 145       const std::vector<DownloadItem::ReceivedSlice>& received_slices, | 
| 145       const net::NetLogWithSource& net_log) override { | 146       const net::NetLogWithSource& net_log) override { | 
| 146     return new DownloadItemImpl( | 147     return new DownloadItemImpl( | 
| 147         delegate, guid, download_id, current_path, target_path, url_chain, | 148         delegate, guid, download_id, current_path, target_path, url_chain, | 
| 148         referrer_url, site_url, tab_url, tab_refererr_url, mime_type, | 149         referrer_url, site_url, tab_url, tab_refererr_url, mime_type, | 
| 149         original_mime_type, start_time, end_time, etag, last_modified, | 150         original_mime_type, start_time, end_time, etag, last_modified, | 
| 150         received_bytes, total_bytes, hash, state, danger_type, interrupt_reason, | 151         received_bytes, total_bytes, hash, state, danger_type, interrupt_reason, | 
| 151         opened, received_slices, net_log); | 152         opened, last_access_time, received_slices, net_log); | 
| 152   } | 153   } | 
| 153 | 154 | 
| 154   DownloadItemImpl* CreateActiveItem( | 155   DownloadItemImpl* CreateActiveItem( | 
| 155       DownloadItemImplDelegate* delegate, | 156       DownloadItemImplDelegate* delegate, | 
| 156       uint32_t download_id, | 157       uint32_t download_id, | 
| 157       const DownloadCreateInfo& info, | 158       const DownloadCreateInfo& info, | 
| 158       const net::NetLogWithSource& net_log) override { | 159       const net::NetLogWithSource& net_log) override { | 
| 159     return new DownloadItemImpl(delegate, download_id, info, net_log); | 160     return new DownloadItemImpl(delegate, download_id, info, net_log); | 
| 160   } | 161   } | 
| 161 | 162 | 
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 653     const base::Time& end_time, | 654     const base::Time& end_time, | 
| 654     const std::string& etag, | 655     const std::string& etag, | 
| 655     const std::string& last_modified, | 656     const std::string& last_modified, | 
| 656     int64_t received_bytes, | 657     int64_t received_bytes, | 
| 657     int64_t total_bytes, | 658     int64_t total_bytes, | 
| 658     const std::string& hash, | 659     const std::string& hash, | 
| 659     DownloadItem::DownloadState state, | 660     DownloadItem::DownloadState state, | 
| 660     DownloadDangerType danger_type, | 661     DownloadDangerType danger_type, | 
| 661     DownloadInterruptReason interrupt_reason, | 662     DownloadInterruptReason interrupt_reason, | 
| 662     bool opened, | 663     bool opened, | 
|  | 664     const base::Time& last_access_time, | 
| 663     const std::vector<DownloadItem::ReceivedSlice>& received_slices) { | 665     const std::vector<DownloadItem::ReceivedSlice>& received_slices) { | 
| 664   if (base::ContainsKey(downloads_, id)) { | 666   if (base::ContainsKey(downloads_, id)) { | 
| 665     NOTREACHED(); | 667     NOTREACHED(); | 
| 666     return nullptr; | 668     return nullptr; | 
| 667   } | 669   } | 
| 668   DCHECK(!base::ContainsKey(downloads_by_guid_, guid)); | 670   DCHECK(!base::ContainsKey(downloads_by_guid_, guid)); | 
| 669   DownloadItemImpl* item = item_factory_->CreatePersistedItem( | 671   DownloadItemImpl* item = item_factory_->CreatePersistedItem( | 
| 670       this, guid, id, current_path, target_path, url_chain, referrer_url, | 672       this, guid, id, current_path, target_path, url_chain, referrer_url, | 
| 671       site_url, tab_url, tab_refererr_url, mime_type, original_mime_type, | 673       site_url, tab_url, tab_refererr_url, mime_type, original_mime_type, | 
| 672       start_time, end_time, etag, last_modified, received_bytes, total_bytes, | 674       start_time, end_time, etag, last_modified, received_bytes, total_bytes, | 
| 673       hash, state, danger_type, interrupt_reason, opened, received_slices, | 675       hash, state, danger_type, interrupt_reason, opened, last_access_time, | 
|  | 676       received_slices, | 
| 674       net::NetLogWithSource::Make(net_log_, net::NetLogSourceType::DOWNLOAD)); | 677       net::NetLogWithSource::Make(net_log_, net::NetLogSourceType::DOWNLOAD)); | 
| 675   downloads_[id] = base::WrapUnique(item); | 678   downloads_[id] = base::WrapUnique(item); | 
| 676   downloads_by_guid_[guid] = item; | 679   downloads_by_guid_[guid] = item; | 
| 677   for (auto& observer : observers_) | 680   for (auto& observer : observers_) | 
| 678     observer.OnDownloadCreated(this, item); | 681     observer.OnDownloadCreated(this, item); | 
| 679   DVLOG(20) << __func__ << "() download = " << item->DebugString(true); | 682   DVLOG(20) << __func__ << "() download = " << item->DebugString(true); | 
| 680   return item; | 683   return item; | 
| 681 } | 684 } | 
| 682 | 685 | 
| 683 int DownloadManagerImpl::InProgressCount() const { | 686 int DownloadManagerImpl::InProgressCount() const { | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 735   if (delegate_) | 738   if (delegate_) | 
| 736     delegate_->OpenDownload(download); | 739     delegate_->OpenDownload(download); | 
| 737 } | 740 } | 
| 738 | 741 | 
| 739 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 742 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 
| 740   if (delegate_) | 743   if (delegate_) | 
| 741     delegate_->ShowDownloadInShell(download); | 744     delegate_->ShowDownloadInShell(download); | 
| 742 } | 745 } | 
| 743 | 746 | 
| 744 }  // namespace content | 747 }  // namespace content | 
| OLD | NEW | 
|---|