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

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

Issue 2880933002: Download driver for components/download. (Closed)
Patch Set: Polish comment. Created 3 years, 7 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/download/download_ui_controller_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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 new extensions::DownloadedByExtension( 308 new extensions::DownloadedByExtension(
309 item, it->by_ext_id, it->by_ext_name); 309 item, it->by_ext_id, it->by_ext_name);
310 item->UpdateObservers(); 310 item->UpdateObservers();
311 } 311 }
312 #endif 312 #endif
313 DCHECK_EQ(DownloadHistoryData::PERSISTED, 313 DCHECK_EQ(DownloadHistoryData::PERSISTED,
314 DownloadHistoryData::Get(item)->state()); 314 DownloadHistoryData::Get(item)->state());
315 ++history_size_; 315 ++history_size_;
316 } 316 }
317 notifier_.GetManager()->CheckForHistoryFilesRemoval(); 317 notifier_.GetManager()->CheckForHistoryFilesRemoval();
318 notifier_.GetManager()->PostInitialization();
318 319
319 initial_history_query_complete_ = true; 320 initial_history_query_complete_ = true;
320 for (Observer& observer : observers_) 321 for (Observer& observer : observers_)
321 observer.OnHistoryQueryComplete(); 322 observer.OnHistoryQueryComplete();
322 } 323 }
323 324
324 void DownloadHistory::MaybeAddToHistory(content::DownloadItem* item) { 325 void DownloadHistory::MaybeAddToHistory(content::DownloadItem* item) {
325 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 326 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
326 327
327 uint32_t download_id = item->GetId(); 328 uint32_t download_id = item->GetId();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 498 }
498 499
499 void DownloadHistory::RemoveDownloadsBatch() { 500 void DownloadHistory::RemoveDownloadsBatch() {
500 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 501 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
501 IdSet remove_ids; 502 IdSet remove_ids;
502 removing_ids_.swap(remove_ids); 503 removing_ids_.swap(remove_ids);
503 history_->RemoveDownloads(remove_ids); 504 history_->RemoveDownloads(remove_ids);
504 for (Observer& observer : observers_) 505 for (Observer& observer : observers_)
505 observer.OnDownloadsRemoved(remove_ids); 506 observer.OnDownloadsRemoved(remove_ids);
506 } 507 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_ui_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698