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

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

Issue 2665243003: add a download slices table into history download db (Closed)
Patch Set: add test file to BUILD.gn Created 3 years, 10 months 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // DownloadHistory manages persisting DownloadItems to the history service by 5 // DownloadHistory manages persisting DownloadItems to the history service by
6 // observing a single DownloadManager and all its DownloadItems using an 6 // observing a single DownloadManager and all its DownloadItems using an
7 // AllDownloadItemNotifier. 7 // AllDownloadItemNotifier.
8 // 8 //
9 // DownloadHistory decides whether and when to add items to, remove items from, 9 // DownloadHistory decides whether and when to add items to, remove items from,
10 // and update items in the database. DownloadHistory uses DownloadHistoryData to 10 // and update items in the database. DownloadHistory uses DownloadHistoryData to
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 item->GetTabReferrerUrl(), 133 item->GetTabReferrerUrl(),
134 std::string(), // HTTP method (not available yet) 134 std::string(), // HTTP method (not available yet)
135 item->GetMimeType(), item->GetOriginalMimeType(), item->GetStartTime(), 135 item->GetMimeType(), item->GetOriginalMimeType(), item->GetStartTime(),
136 item->GetEndTime(), item->GetETag(), item->GetLastModifiedTime(), 136 item->GetEndTime(), item->GetETag(), item->GetLastModifiedTime(),
137 item->GetReceivedBytes(), item->GetTotalBytes(), 137 item->GetReceivedBytes(), item->GetTotalBytes(),
138 history::ToHistoryDownloadState(item->GetState()), 138 history::ToHistoryDownloadState(item->GetState()),
139 history::ToHistoryDownloadDangerType(item->GetDangerType()), 139 history::ToHistoryDownloadDangerType(item->GetDangerType()),
140 history::ToHistoryDownloadInterruptReason(item->GetLastReason()), 140 history::ToHistoryDownloadInterruptReason(item->GetLastReason()),
141 std::string(), // Hash value (not available yet) 141 std::string(), // Hash value (not available yet)
142 history::ToHistoryDownloadId(item->GetId()), item->GetGuid(), 142 history::ToHistoryDownloadId(item->GetId()), item->GetGuid(),
143 item->GetOpened(), by_ext_id, by_ext_name); 143 item->GetOpened(), by_ext_id, by_ext_name,
144 // TODO(qinmin): get the slice information.
145 std::vector<history::DownloadSliceInfo>());
144 } 146 }
145 147
146 enum class ShouldUpdateHistoryResult { 148 enum class ShouldUpdateHistoryResult {
147 NO_UPDATE, 149 NO_UPDATE,
148 UPDATE, 150 UPDATE,
149 UPDATE_IMMEDIATELY, 151 UPDATE_IMMEDIATELY,
150 }; 152 };
151 153
152 ShouldUpdateHistoryResult ShouldUpdateHistory( 154 ShouldUpdateHistoryResult ShouldUpdateHistory(
153 const history::DownloadRow* previous, 155 const history::DownloadRow* previous,
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 491 }
490 492
491 void DownloadHistory::RemoveDownloadsBatch() { 493 void DownloadHistory::RemoveDownloadsBatch() {
492 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 494 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
493 IdSet remove_ids; 495 IdSet remove_ids;
494 removing_ids_.swap(remove_ids); 496 removing_ids_.swap(remove_ids);
495 history_->RemoveDownloads(remove_ids); 497 history_->RemoveDownloads(remove_ids);
496 for (Observer& observer : observers_) 498 for (Observer& observer : observers_)
497 observer.OnDownloadsRemoved(remove_ids); 499 observer.OnDownloadsRemoved(remove_ids);
498 } 500 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698