OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // The history system runs on a background thread so that potentially slow | 5 // The history system runs on a background thread so that potentially slow |
6 // database operations don't delay the browser. This backend processing is | 6 // database operations don't delay the browser. This backend processing is |
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to | 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to |
8 // that thread. | 8 // that thread. |
9 // | 9 // |
10 // Main thread History thread | 10 // Main thread History thread |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 HistoryService::Handle HistoryService::CreateDownload( | 504 HistoryService::Handle HistoryService::CreateDownload( |
505 int32 id, | 505 int32 id, |
506 const DownloadPersistentStoreInfo& create_info, | 506 const DownloadPersistentStoreInfo& create_info, |
507 CancelableRequestConsumerBase* consumer, | 507 CancelableRequestConsumerBase* consumer, |
508 HistoryService::DownloadCreateCallback* callback) { | 508 HistoryService::DownloadCreateCallback* callback) { |
509 return Schedule(PRIORITY_NORMAL, &HistoryBackend::CreateDownload, consumer, | 509 return Schedule(PRIORITY_NORMAL, &HistoryBackend::CreateDownload, consumer, |
510 new history::DownloadCreateRequest(callback), id, | 510 new history::DownloadCreateRequest(callback), id, |
511 create_info); | 511 create_info); |
512 } | 512 } |
513 | 513 |
514 HistoryService::Handle HistoryService::GetNextDownloadId( | |
515 CancelableRequestConsumerBase* consumer, | |
516 DownloadNextIdCallback* callback) { | |
517 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetNextDownloadId, consumer, | |
518 new history::DownloadNextIdRequest(callback)); | |
519 } | |
520 | |
521 // Handle queries for a list of all downloads in the history database's | 514 // Handle queries for a list of all downloads in the history database's |
522 // 'downloads' table. | 515 // 'downloads' table. |
523 HistoryService::Handle HistoryService::QueryDownloads( | 516 HistoryService::Handle HistoryService::QueryDownloads( |
524 CancelableRequestConsumerBase* consumer, | 517 CancelableRequestConsumerBase* consumer, |
525 DownloadQueryCallback* callback) { | 518 DownloadQueryCallback* callback) { |
526 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, | 519 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, |
527 new history::DownloadQueryRequest(callback)); | 520 new history::DownloadQueryRequest(callback)); |
528 } | 521 } |
529 | 522 |
530 // Changes all IN_PROGRESS in the database entries to CANCELED. | 523 // Changes all IN_PROGRESS in the database entries to CANCELED. |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 798 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
806 if (ts) | 799 if (ts) |
807 ts->MigrateFromHistory(); | 800 ts->MigrateFromHistory(); |
808 } | 801 } |
809 } | 802 } |
810 | 803 |
811 void HistoryService::OnTopSitesReady() { | 804 void HistoryService::OnTopSitesReady() { |
812 ScheduleAndForget(PRIORITY_NORMAL, | 805 ScheduleAndForget(PRIORITY_NORMAL, |
813 &HistoryBackend::MigrateThumbnailsDatabase); | 806 &HistoryBackend::MigrateThumbnailsDatabase); |
814 } | 807 } |
OLD | NEW |