| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 // Changes all IN_PROGRESS in the database entries to CANCELED. | 550 // Changes all IN_PROGRESS in the database entries to CANCELED. |
| 551 // IN_PROGRESS entries are the corrupted entries, not updated by next function | 551 // IN_PROGRESS entries are the corrupted entries, not updated by next function |
| 552 // because of the crash or some other extremal exit. | 552 // because of the crash or some other extremal exit. |
| 553 void HistoryService::CleanUpInProgressEntries() { | 553 void HistoryService::CleanUpInProgressEntries() { |
| 554 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); | 554 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); |
| 555 } | 555 } |
| 556 | 556 |
| 557 // Handle updates for a particular download. This is a 'fire and forget' | 557 // Handle updates for a particular download. This is a 'fire and forget' |
| 558 // operation, so we don't need to be called back. | 558 // operation, so we don't need to be called back. |
| 559 void HistoryService::UpdateDownload(int64 received_bytes, | 559 void HistoryService::UpdateDownload(const DownloadPersistentStoreInfo& data) { |
| 560 int32 state, | 560 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownload, data); |
| 561 int64 db_handle) { | |
| 562 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownload, | |
| 563 received_bytes, state, db_handle); | |
| 564 } | 561 } |
| 565 | 562 |
| 566 void HistoryService::UpdateDownloadPath(const FilePath& path, | 563 void HistoryService::UpdateDownloadPath(const FilePath& path, |
| 567 int64 db_handle) { | 564 int64 db_handle) { |
| 568 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownloadPath, | 565 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownloadPath, |
| 569 path, db_handle); | 566 path, db_handle); |
| 570 } | 567 } |
| 571 | 568 |
| 572 void HistoryService::RemoveDownload(int64 db_handle) { | 569 void HistoryService::RemoveDownload(int64 db_handle) { |
| 573 ScheduleAndForget(PRIORITY_NORMAL, | 570 ScheduleAndForget(PRIORITY_NORMAL, |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 843 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
| 847 if (ts) | 844 if (ts) |
| 848 ts->MigrateFromHistory(); | 845 ts->MigrateFromHistory(); |
| 849 } | 846 } |
| 850 } | 847 } |
| 851 | 848 |
| 852 void HistoryService::OnTopSitesReady() { | 849 void HistoryService::OnTopSitesReady() { |
| 853 ScheduleAndForget(PRIORITY_NORMAL, | 850 ScheduleAndForget(PRIORITY_NORMAL, |
| 854 &HistoryBackend::MigrateThumbnailsDatabase); | 851 &HistoryBackend::MigrateThumbnailsDatabase); |
| 855 } | 852 } |
| OLD | NEW |