| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 HistoryService::Handle HistoryService::CreateDownload( | 507 HistoryService::Handle HistoryService::CreateDownload( |
| 508 int32 id, | 508 int32 id, |
| 509 const DownloadPersistentStoreInfo& create_info, | 509 const DownloadPersistentStoreInfo& create_info, |
| 510 CancelableRequestConsumerBase* consumer, | 510 CancelableRequestConsumerBase* consumer, |
| 511 HistoryService::DownloadCreateCallback* callback) { | 511 HistoryService::DownloadCreateCallback* callback) { |
| 512 return Schedule(PRIORITY_NORMAL, &HistoryBackend::CreateDownload, consumer, | 512 return Schedule(PRIORITY_NORMAL, &HistoryBackend::CreateDownload, consumer, |
| 513 new history::DownloadCreateRequest(callback), id, | 513 new history::DownloadCreateRequest(callback), id, |
| 514 create_info); | 514 create_info); |
| 515 } | 515 } |
| 516 | 516 |
| 517 HistoryService::Handle HistoryService::GetNextDownloadId( |
| 518 CancelableRequestConsumerBase* consumer, |
| 519 DownloadNextIdCallback* callback) { |
| 520 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetNextDownloadId, consumer, |
| 521 new history::DownloadNextIdRequest(callback)); |
| 522 } |
| 523 |
| 517 // Handle queries for a list of all downloads in the history database's | 524 // Handle queries for a list of all downloads in the history database's |
| 518 // 'downloads' table. | 525 // 'downloads' table. |
| 519 HistoryService::Handle HistoryService::QueryDownloads( | 526 HistoryService::Handle HistoryService::QueryDownloads( |
| 520 CancelableRequestConsumerBase* consumer, | 527 CancelableRequestConsumerBase* consumer, |
| 521 DownloadQueryCallback* callback) { | 528 DownloadQueryCallback* callback) { |
| 522 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, | 529 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, |
| 523 new history::DownloadQueryRequest(callback)); | 530 new history::DownloadQueryRequest(callback)); |
| 524 } | 531 } |
| 525 | 532 |
| 526 // Changes all IN_PROGRESS in the database entries to CANCELED. | 533 // Changes all IN_PROGRESS in the database entries to CANCELED. |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 827 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
| 821 if (ts) | 828 if (ts) |
| 822 ts->MigrateFromHistory(); | 829 ts->MigrateFromHistory(); |
| 823 } | 830 } |
| 824 } | 831 } |
| 825 | 832 |
| 826 void HistoryService::OnTopSitesReady() { | 833 void HistoryService::OnTopSitesReady() { |
| 827 ScheduleAndForget(PRIORITY_NORMAL, | 834 ScheduleAndForget(PRIORITY_NORMAL, |
| 828 &HistoryBackend::MigrateThumbnailsDatabase); | 835 &HistoryBackend::MigrateThumbnailsDatabase); |
| 829 } | 836 } |
| OLD | NEW |