OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); | 602 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); |
603 } | 603 } |
604 | 604 |
605 // Handle updates for a particular download. This is a 'fire and forget' | 605 // Handle updates for a particular download. This is a 'fire and forget' |
606 // operation, so we don't need to be called back. | 606 // operation, so we don't need to be called back. |
607 void HistoryService::UpdateDownload( | 607 void HistoryService::UpdateDownload( |
608 const content::DownloadPersistentStoreInfo& data) { | 608 const content::DownloadPersistentStoreInfo& data) { |
609 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownload, data); | 609 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownload, data); |
610 } | 610 } |
611 | 611 |
612 void HistoryService::UpdateDownloadPath(const FilePath& path, | 612 void HistoryService::RemoveDownloads(const std::set<int64>& handles) { |
613 int64 db_handle) { | |
614 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownloadPath, | |
615 path, db_handle); | |
616 } | |
617 | |
618 void HistoryService::RemoveDownload(int64 db_handle) { | |
619 ScheduleAndForget(PRIORITY_NORMAL, | 613 ScheduleAndForget(PRIORITY_NORMAL, |
620 &HistoryBackend::RemoveDownload, db_handle); | 614 &HistoryBackend::RemoveDownloads, handles); |
621 } | |
622 | |
623 void HistoryService::RemoveDownloadsBetween(Time remove_begin, | |
624 Time remove_end) { | |
625 ScheduleAndForget(PRIORITY_NORMAL, | |
626 &HistoryBackend::RemoveDownloadsBetween, | |
627 remove_begin, | |
628 remove_end); | |
629 } | 615 } |
630 | 616 |
631 HistoryService::Handle HistoryService::QueryHistory( | 617 HistoryService::Handle HistoryService::QueryHistory( |
632 const string16& text_query, | 618 const string16& text_query, |
633 const history::QueryOptions& options, | 619 const history::QueryOptions& options, |
634 CancelableRequestConsumerBase* consumer, | 620 CancelableRequestConsumerBase* consumer, |
635 const QueryHistoryCallback& callback) { | 621 const QueryHistoryCallback& callback) { |
636 return Schedule(PRIORITY_UI, &HistoryBackend::QueryHistory, consumer, | 622 return Schedule(PRIORITY_UI, &HistoryBackend::QueryHistory, consumer, |
637 new history::QueryHistoryRequest(callback), | 623 new history::QueryHistoryRequest(callback), |
638 text_query, options); | 624 text_query, options); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 void HistoryService::RemoveVisitDatabaseObserver( | 925 void HistoryService::RemoveVisitDatabaseObserver( |
940 history::VisitDatabaseObserver* observer) { | 926 history::VisitDatabaseObserver* observer) { |
941 visit_database_observers_->RemoveObserver(observer); | 927 visit_database_observers_->RemoveObserver(observer); |
942 } | 928 } |
943 | 929 |
944 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 930 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
945 const history::BriefVisitInfo& info) { | 931 const history::BriefVisitInfo& info) { |
946 visit_database_observers_->Notify( | 932 visit_database_observers_->Notify( |
947 &history::VisitDatabaseObserver::OnAddVisit, info); | 933 &history::VisitDatabaseObserver::OnAddVisit, info); |
948 } | 934 } |
OLD | NEW |