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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 base::Bind(&HistoryBackend::GetFaviconsForURL, | 637 base::Bind(&HistoryBackend::GetFaviconsForURL, |
638 history_backend_.get(), | 638 history_backend_.get(), |
639 page_url, | 639 page_url, |
640 icon_types, | 640 icon_types, |
641 desired_size_in_dip, | 641 desired_size_in_dip, |
642 desired_scale_factors, | 642 desired_scale_factors, |
643 results), | 643 results), |
644 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); | 644 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); |
645 } | 645 } |
646 | 646 |
647 CancelableTaskTracker::TaskId HistoryService::GetLargestFaviconForURL( | |
648 const GURL& page_url, | |
649 const std::vector<int>& icon_types, | |
650 int minimal_size_in_pixel, | |
651 const FaviconService::FaviconResultsCallback& callback, | |
652 CancelableTaskTracker* tracker) { | |
653 DCHECK(thread_checker_.CalledOnValidThread()); | |
654 LoadBackendIfNecessary(); | |
655 | |
sky
2013/10/15 15:03:47
nit: only one newline.
michaelbai
2013/10/15 19:36:31
Done.
| |
656 | |
657 std::vector<chrome::FaviconBitmapResult>* results = | |
658 new std::vector<chrome::FaviconBitmapResult>(); | |
659 return tracker->PostTaskAndReply( | |
660 thread_->message_loop_proxy().get(), | |
661 FROM_HERE, | |
662 base::Bind(&HistoryBackend::GetLargestFaviconForURL, | |
663 history_backend_.get(), | |
664 page_url, | |
665 icon_types, | |
666 minimal_size_in_pixel, | |
667 results), | |
668 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); | |
669 } | |
670 | |
sky
2013/10/15 15:03:47
nit: only one newline.
michaelbai
2013/10/15 19:36:31
Done.
| |
671 | |
647 CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( | 672 CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( |
648 chrome::FaviconID favicon_id, | 673 chrome::FaviconID favicon_id, |
649 int desired_size_in_dip, | 674 int desired_size_in_dip, |
650 ui::ScaleFactor desired_scale_factor, | 675 ui::ScaleFactor desired_scale_factor, |
651 const FaviconService::FaviconResultsCallback& callback, | 676 const FaviconService::FaviconResultsCallback& callback, |
652 CancelableTaskTracker* tracker) { | 677 CancelableTaskTracker* tracker) { |
653 DCHECK(thread_checker_.CalledOnValidThread()); | 678 DCHECK(thread_checker_.CalledOnValidThread()); |
654 LoadBackendIfNecessary(); | 679 LoadBackendIfNecessary(); |
655 | 680 |
656 std::vector<chrome::FaviconBitmapResult>* results = | 681 std::vector<chrome::FaviconBitmapResult>* results = |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1241 DCHECK(thread_checker_.CalledOnValidThread()); | 1266 DCHECK(thread_checker_.CalledOnValidThread()); |
1242 visit_database_observers_.RemoveObserver(observer); | 1267 visit_database_observers_.RemoveObserver(observer); |
1243 } | 1268 } |
1244 | 1269 |
1245 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 1270 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
1246 const history::BriefVisitInfo& info) { | 1271 const history::BriefVisitInfo& info) { |
1247 DCHECK(thread_checker_.CalledOnValidThread()); | 1272 DCHECK(thread_checker_.CalledOnValidThread()); |
1248 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, | 1273 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, |
1249 OnAddVisit(info)); | 1274 OnAddVisit(info)); |
1250 } | 1275 } |
OLD | NEW |