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

Side by Side Diff: content/browser/download/download_manager_impl.cc

Issue 102683004: Add mime type information to the download database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
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 #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 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 DownloadItemFactoryImpl() {} 162 DownloadItemFactoryImpl() {}
163 virtual ~DownloadItemFactoryImpl() {} 163 virtual ~DownloadItemFactoryImpl() {}
164 164
165 virtual DownloadItemImpl* CreatePersistedItem( 165 virtual DownloadItemImpl* CreatePersistedItem(
166 DownloadItemImplDelegate* delegate, 166 DownloadItemImplDelegate* delegate,
167 uint32 download_id, 167 uint32 download_id,
168 const base::FilePath& current_path, 168 const base::FilePath& current_path,
169 const base::FilePath& target_path, 169 const base::FilePath& target_path,
170 const std::vector<GURL>& url_chain, 170 const std::vector<GURL>& url_chain,
171 const GURL& referrer_url, 171 const GURL& referrer_url,
172 const std::string& mime_type,
173 const std::string& original_mime_type,
172 const base::Time& start_time, 174 const base::Time& start_time,
173 const base::Time& end_time, 175 const base::Time& end_time,
174 const std::string& etag, 176 const std::string& etag,
175 const std::string& last_modified, 177 const std::string& last_modified,
176 int64 received_bytes, 178 int64 received_bytes,
177 int64 total_bytes, 179 int64 total_bytes,
178 DownloadItem::DownloadState state, 180 DownloadItem::DownloadState state,
179 DownloadDangerType danger_type, 181 DownloadDangerType danger_type,
180 DownloadInterruptReason interrupt_reason, 182 DownloadInterruptReason interrupt_reason,
181 bool opened, 183 bool opened,
182 const net::BoundNetLog& bound_net_log) OVERRIDE { 184 const net::BoundNetLog& bound_net_log) OVERRIDE {
183 return new DownloadItemImpl( 185 return new DownloadItemImpl(
184 delegate, 186 delegate,
185 download_id, 187 download_id,
186 current_path, 188 current_path,
187 target_path, 189 target_path,
188 url_chain, 190 url_chain,
189 referrer_url, 191 referrer_url,
192 mime_type,
193 original_mime_type,
190 start_time, 194 start_time,
191 end_time, 195 end_time,
192 etag, 196 etag,
193 last_modified, 197 last_modified,
194 received_bytes, 198 received_bytes,
195 total_bytes, 199 total_bytes,
196 state, 200 state,
197 danger_type, 201 danger_type,
198 interrupt_reason, 202 interrupt_reason,
199 opened, 203 opened,
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 void DownloadManagerImpl::RemoveObserver(Observer* observer) { 615 void DownloadManagerImpl::RemoveObserver(Observer* observer) {
612 observers_.RemoveObserver(observer); 616 observers_.RemoveObserver(observer);
613 } 617 }
614 618
615 DownloadItem* DownloadManagerImpl::CreateDownloadItem( 619 DownloadItem* DownloadManagerImpl::CreateDownloadItem(
616 uint32 id, 620 uint32 id,
617 const base::FilePath& current_path, 621 const base::FilePath& current_path,
618 const base::FilePath& target_path, 622 const base::FilePath& target_path,
619 const std::vector<GURL>& url_chain, 623 const std::vector<GURL>& url_chain,
620 const GURL& referrer_url, 624 const GURL& referrer_url,
625 const std::string& mime_type,
626 const std::string& original_mime_type,
621 const base::Time& start_time, 627 const base::Time& start_time,
622 const base::Time& end_time, 628 const base::Time& end_time,
623 const std::string& etag, 629 const std::string& etag,
624 const std::string& last_modified, 630 const std::string& last_modified,
625 int64 received_bytes, 631 int64 received_bytes,
626 int64 total_bytes, 632 int64 total_bytes,
627 DownloadItem::DownloadState state, 633 DownloadItem::DownloadState state,
628 DownloadDangerType danger_type, 634 DownloadDangerType danger_type,
629 DownloadInterruptReason interrupt_reason, 635 DownloadInterruptReason interrupt_reason,
630 bool opened) { 636 bool opened) {
631 if (ContainsKey(downloads_, id)) { 637 if (ContainsKey(downloads_, id)) {
632 NOTREACHED(); 638 NOTREACHED();
633 return NULL; 639 return NULL;
634 } 640 }
635 DownloadItemImpl* item = item_factory_->CreatePersistedItem( 641 DownloadItemImpl* item = item_factory_->CreatePersistedItem(
636 this, 642 this,
637 id, 643 id,
638 current_path, 644 current_path,
639 target_path, 645 target_path,
640 url_chain, 646 url_chain,
641 referrer_url, 647 referrer_url,
648 mime_type,
649 original_mime_type,
642 start_time, 650 start_time,
643 end_time, 651 end_time,
644 etag, 652 etag,
645 last_modified, 653 last_modified,
646 received_bytes, 654 received_bytes,
647 total_bytes, 655 total_bytes,
648 state, 656 state,
649 danger_type, 657 danger_type,
650 interrupt_reason, 658 interrupt_reason,
651 opened, 659 opened,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 if (delegate_) 715 if (delegate_)
708 delegate_->OpenDownload(download); 716 delegate_->OpenDownload(download);
709 } 717 }
710 718
711 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 719 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
712 if (delegate_) 720 if (delegate_)
713 delegate_->ShowDownloadInShell(download); 721 delegate_->ShowDownloadInShell(download);
714 } 722 }
715 723
716 } // namespace content 724 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698