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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 icon_urls, | 614 icon_urls, |
615 icon_types, | 615 icon_types, |
616 desired_size_in_dip, | 616 desired_size_in_dip, |
617 desired_scale_factors, | 617 desired_scale_factors, |
618 results), | 618 results), |
619 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); | 619 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); |
620 } | 620 } |
621 | 621 |
622 CancelableTaskTracker::TaskId HistoryService::GetFaviconsForURL( | 622 CancelableTaskTracker::TaskId HistoryService::GetFaviconsForURL( |
623 const GURL& page_url, | 623 const GURL& page_url, |
624 int icon_types, | 624 const std::vector<int>& icon_types_priority, |
625 int desired_size_in_dip, | 625 int desired_size_in_dip, |
626 const std::vector<ui::ScaleFactor>& desired_scale_factors, | 626 const std::vector<ui::ScaleFactor>& desired_scale_factors, |
| 627 int threshold_for_next_icon_types, |
627 const FaviconService::FaviconResultsCallback& callback, | 628 const FaviconService::FaviconResultsCallback& callback, |
628 CancelableTaskTracker* tracker) { | 629 CancelableTaskTracker* tracker) { |
629 DCHECK(thread_checker_.CalledOnValidThread()); | 630 DCHECK(thread_checker_.CalledOnValidThread()); |
630 LoadBackendIfNecessary(); | 631 LoadBackendIfNecessary(); |
631 | 632 |
632 std::vector<chrome::FaviconBitmapResult>* results = | 633 std::vector<chrome::FaviconBitmapResult>* results = |
633 new std::vector<chrome::FaviconBitmapResult>(); | 634 new std::vector<chrome::FaviconBitmapResult>(); |
634 return tracker->PostTaskAndReply( | 635 return tracker->PostTaskAndReply( |
635 thread_->message_loop_proxy().get(), | 636 thread_->message_loop_proxy().get(), |
636 FROM_HERE, | 637 FROM_HERE, |
637 base::Bind(&HistoryBackend::GetFaviconsForURL, | 638 base::Bind(&HistoryBackend::GetFaviconsForURL, |
638 history_backend_.get(), | 639 history_backend_.get(), |
639 page_url, | 640 page_url, |
640 icon_types, | 641 icon_types_priority, |
641 desired_size_in_dip, | 642 desired_size_in_dip, |
642 desired_scale_factors, | 643 desired_scale_factors, |
| 644 threshold_for_next_icon_types, |
643 results), | 645 results), |
644 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); | 646 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); |
645 } | 647 } |
646 | 648 |
647 CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( | 649 CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( |
648 chrome::FaviconID favicon_id, | 650 chrome::FaviconID favicon_id, |
649 int desired_size_in_dip, | 651 int desired_size_in_dip, |
650 ui::ScaleFactor desired_scale_factor, | 652 ui::ScaleFactor desired_scale_factor, |
651 const FaviconService::FaviconResultsCallback& callback, | 653 const FaviconService::FaviconResultsCallback& callback, |
652 CancelableTaskTracker* tracker) { | 654 CancelableTaskTracker* tracker) { |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 DCHECK(thread_checker_.CalledOnValidThread()); | 1243 DCHECK(thread_checker_.CalledOnValidThread()); |
1242 visit_database_observers_.RemoveObserver(observer); | 1244 visit_database_observers_.RemoveObserver(observer); |
1243 } | 1245 } |
1244 | 1246 |
1245 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 1247 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
1246 const history::BriefVisitInfo& info) { | 1248 const history::BriefVisitInfo& info) { |
1247 DCHECK(thread_checker_.CalledOnValidThread()); | 1249 DCHECK(thread_checker_.CalledOnValidThread()); |
1248 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, | 1250 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, |
1249 OnAddVisit(info)); | 1251 OnAddVisit(info)); |
1250 } | 1252 } |
OLD | NEW |