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

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
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 "chrome/browser/download/chrome_download_manager_delegate.h" 5 #include "chrome/browser/download/chrome_download_manager_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 this)); 491 this));
492 } 492 }
493 493
494 void ChromeDownloadManagerDelegate::UpdateItemInPersistentStore( 494 void ChromeDownloadManagerDelegate::UpdateItemInPersistentStore(
495 DownloadItem* item) { 495 DownloadItem* item) {
496 download_history_->UpdateEntry(item); 496 download_history_->UpdateEntry(item);
497 } 497 }
498 498
499 void ChromeDownloadManagerDelegate::UpdatePathForItemInPersistentStore( 499 void ChromeDownloadManagerDelegate::UpdatePathForItemInPersistentStore(
500 DownloadItem* item, 500 DownloadItem* item,
501 const FilePath& new_path) { 501 const FilePath& target_path,
502 download_history_->UpdateDownloadPath(item, new_path); 502 const FilePath& current_path) {
503 download_history_->UpdateDownloadPath(item, target_path, current_path);
503 } 504 }
504 505
505 void ChromeDownloadManagerDelegate::RemoveItemFromPersistentStore( 506 void ChromeDownloadManagerDelegate::RemoveItemFromPersistentStore(
506 DownloadItem* item) { 507 DownloadItem* item) {
507 download_history_->RemoveEntry(item); 508 download_history_->RemoveEntry(item);
508 } 509 }
509 510
510 void ChromeDownloadManagerDelegate::RemoveItemsFromPersistentStoreBetween( 511 void ChromeDownloadManagerDelegate::RemoveItemsFromPersistentStoreBetween(
511 base::Time remove_begin, 512 base::Time remove_begin,
512 base::Time remove_end) { 513 base::Time remove_end) {
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 int32 download_id, int64 db_handle) { 891 int32 download_id, int64 db_handle) {
891 // It's not immediately obvious, but HistoryBackend::CreateDownload() can 892 // It's not immediately obvious, but HistoryBackend::CreateDownload() can
892 // call this function with an invalid |db_handle|. For instance, this can 893 // call this function with an invalid |db_handle|. For instance, this can
893 // happen when the history database is offline. We cannot have multiple 894 // happen when the history database is offline. We cannot have multiple
894 // DownloadItems with the same invalid db_handle, so we need to assign a 895 // DownloadItems with the same invalid db_handle, so we need to assign a
895 // unique |db_handle| here. 896 // unique |db_handle| here.
896 if (db_handle == DownloadItem::kUninitializedHandle) 897 if (db_handle == DownloadItem::kUninitializedHandle)
897 db_handle = download_history_->GetNextFakeDbHandle(); 898 db_handle = download_history_->GetNextFakeDbHandle();
898 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); 899 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle);
899 } 900 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698