| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // 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 |
| 525 // 'downloads' table. | 525 // 'downloads' table. |
| 526 HistoryService::Handle HistoryService::QueryDownloads( | 526 HistoryService::Handle HistoryService::QueryDownloads( |
| 527 CancelableRequestConsumerBase* consumer, | 527 CancelableRequestConsumerBase* consumer, |
| 528 history::DownloadQueryParameters::GetNextIdThunk gnit, |
| 528 DownloadQueryCallback* callback) { | 529 DownloadQueryCallback* callback) { |
| 530 history::DownloadQueryRequest* request = new history::DownloadQueryRequest(cal
lback); |
| 531 request->value.get_next_id = gnit; |
| 529 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, | 532 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryDownloads, consumer, |
| 530 new history::DownloadQueryRequest(callback)); | 533 request); |
| 531 } | 534 } |
| 532 | 535 |
| 533 // Changes all IN_PROGRESS in the database entries to CANCELED. | 536 // Changes all IN_PROGRESS in the database entries to CANCELED. |
| 534 // IN_PROGRESS entries are the corrupted entries, not updated by next function | 537 // IN_PROGRESS entries are the corrupted entries, not updated by next function |
| 535 // because of the crash or some other extremal exit. | 538 // because of the crash or some other extremal exit. |
| 536 void HistoryService::CleanUpInProgressEntries() { | 539 void HistoryService::CleanUpInProgressEntries() { |
| 537 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); | 540 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); |
| 538 } | 541 } |
| 539 | 542 |
| 540 // Handle updates for a particular download. This is a 'fire and forget' | 543 // Handle updates for a particular download. This is a 'fire and forget' |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 811 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
| 809 if (ts) | 812 if (ts) |
| 810 ts->MigrateFromHistory(); | 813 ts->MigrateFromHistory(); |
| 811 } | 814 } |
| 812 } | 815 } |
| 813 | 816 |
| 814 void HistoryService::OnTopSitesReady() { | 817 void HistoryService::OnTopSitesReady() { |
| 815 ScheduleAndForget(PRIORITY_NORMAL, | 818 ScheduleAndForget(PRIORITY_NORMAL, |
| 816 &HistoryBackend::MigrateThumbnailsDatabase); | 819 &HistoryBackend::MigrateThumbnailsDatabase); |
| 817 } | 820 } |
| OLD | NEW |