| 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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryMostVisitedURLs, | 658 return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryMostVisitedURLs, |
| 659 consumer, | 659 consumer, |
| 660 new history::QueryMostVisitedURLsRequest(callback), | 660 new history::QueryMostVisitedURLsRequest(callback), |
| 661 result_count, days_back); | 661 result_count, days_back); |
| 662 } | 662 } |
| 663 | 663 |
| 664 HistoryService::Handle HistoryService::QueryFilteredURLs( | 664 HistoryService::Handle HistoryService::QueryFilteredURLs( |
| 665 int result_count, | 665 int result_count, |
| 666 const history::VisitFilter& filter, | 666 const history::VisitFilter& filter, |
| 667 CancelableRequestConsumerBase* consumer, | 667 CancelableRequestConsumerBase* consumer, |
| 668 const QueryMostVisitedURLsCallback& callback) { | 668 const QueryFilteredURLsCallback& callback) { |
| 669 return Schedule(PRIORITY_NORMAL, | 669 return Schedule(PRIORITY_NORMAL, |
| 670 &HistoryBackend::QueryFilteredURLs, | 670 &HistoryBackend::QueryFilteredURLs, |
| 671 consumer, | 671 consumer, |
| 672 new history::QueryMostVisitedURLsRequest(callback), | 672 new history::QueryFilteredURLsRequest(callback), |
| 673 result_count, filter); | 673 result_count, filter); |
| 674 } | 674 } |
| 675 | 675 |
| 676 void HistoryService::Observe(int type, | 676 void HistoryService::Observe(int type, |
| 677 const content::NotificationSource& source, | 677 const content::NotificationSource& source, |
| 678 const content::NotificationDetails& details) { | 678 const content::NotificationDetails& details) { |
| 679 if (!thread_) | 679 if (!thread_) |
| 680 return; | 680 return; |
| 681 | 681 |
| 682 switch (type) { | 682 switch (type) { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 void HistoryService::RemoveVisitDatabaseObserver( | 913 void HistoryService::RemoveVisitDatabaseObserver( |
| 914 history::VisitDatabaseObserver* observer) { | 914 history::VisitDatabaseObserver* observer) { |
| 915 visit_database_observers_->RemoveObserver(observer); | 915 visit_database_observers_->RemoveObserver(observer); |
| 916 } | 916 } |
| 917 | 917 |
| 918 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 918 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
| 919 const history::BriefVisitInfo& info) { | 919 const history::BriefVisitInfo& info) { |
| 920 visit_database_observers_->Notify( | 920 visit_database_observers_->Notify( |
| 921 &history::VisitDatabaseObserver::OnAddVisit, info); | 921 &history::VisitDatabaseObserver::OnAddVisit, info); |
| 922 } | 922 } |
| OLD | NEW |