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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 HistoryService::Handle HistoryService::CreateDownload( | 514 HistoryService::Handle HistoryService::CreateDownload( |
515 int32 id, | 515 int32 id, |
516 const DownloadHistoryInfo& create_info, | 516 const DownloadHistoryInfo& create_info, |
517 CancelableRequestConsumerBase* consumer, | 517 CancelableRequestConsumerBase* consumer, |
518 HistoryService::DownloadCreateCallback* callback) { | 518 HistoryService::DownloadCreateCallback* callback) { |
519 return Schedule(PRIORITY_NORMAL, &HistoryBackend::CreateDownload, consumer, | 519 return Schedule(PRIORITY_NORMAL, &HistoryBackend::CreateDownload, consumer, |
520 new history::DownloadCreateRequest(callback), id, | 520 new history::DownloadCreateRequest(callback), id, |
521 create_info); | 521 create_info); |
522 } | 522 } |
523 | 523 |
| 524 HistoryService::Handle HistoryService::GetNextDownloadId( |
| 525 CancelableRequestConsumerBase* consumer, |
| 526 DownloadNextIdCallback* callback) { |
| 527 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetNextDownloadId, consumer, |
| 528 new history::DownloadNextIdRequest(callback)); |
| 529 } |
| 530 |
524 // Handle queries for a list of all downloads in the history database's | 531 // Handle queries for a list of all downloads in the history database's |
525 // 'downloads' table. | 532 // 'downloads' table. |
526 HistoryService::Handle HistoryService::QueryDownloads( | 533 HistoryService::Handle HistoryService::QueryDownloads( |
527 CancelableRequestConsumerBase* consumer, | 534 CancelableRequestConsumerBase* consumer, |
528 DownloadQueryCallback* callback) { | 535 DownloadQueryCallback* callback) { |
529 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, | 536 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, |
530 new history::DownloadQueryRequest(callback)); | 537 new history::DownloadQueryRequest(callback)); |
531 } | 538 } |
532 | 539 |
533 // Changes all IN_PROGRESS in the database entries to CANCELED. | 540 // Changes all IN_PROGRESS in the database entries to CANCELED. |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 815 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
809 if (ts) | 816 if (ts) |
810 ts->MigrateFromHistory(); | 817 ts->MigrateFromHistory(); |
811 } | 818 } |
812 } | 819 } |
813 | 820 |
814 void HistoryService::OnTopSitesReady() { | 821 void HistoryService::OnTopSitesReady() { |
815 ScheduleAndForget(PRIORITY_NORMAL, | 822 ScheduleAndForget(PRIORITY_NORMAL, |
816 &HistoryBackend::MigrateThumbnailsDatabase); | 823 &HistoryBackend::MigrateThumbnailsDatabase); |
817 } | 824 } |
OLD | NEW |