Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1005)

Side by Side Diff: chrome/browser/history/history_service.cc

Issue 26563004: Find Favicon in priority of icon_type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 history_backend_.get(), 613 history_backend_.get(),
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 FaviconService::FaviconForURLParams& params,
624 int icon_types,
625 int desired_size_in_dip,
626 const std::vector<ui::ScaleFactor>& desired_scale_factors, 624 const std::vector<ui::ScaleFactor>& desired_scale_factors,
627 const FaviconService::FaviconResultsCallback& callback, 625 const FaviconService::FaviconResultsCallback& callback,
628 CancelableTaskTracker* tracker) { 626 CancelableTaskTracker* tracker) {
629 DCHECK(thread_checker_.CalledOnValidThread()); 627 DCHECK(thread_checker_.CalledOnValidThread());
630 LoadBackendIfNecessary(); 628 LoadBackendIfNecessary();
631 629
632 std::vector<chrome::FaviconBitmapResult>* results = 630 std::vector<chrome::FaviconBitmapResult>* results =
633 new std::vector<chrome::FaviconBitmapResult>(); 631 new std::vector<chrome::FaviconBitmapResult>();
634 return tracker->PostTaskAndReply( 632 return tracker->PostTaskAndReply(
635 thread_->message_loop_proxy().get(), 633 thread_->message_loop_proxy().get(),
636 FROM_HERE, 634 FROM_HERE,
637 base::Bind(&HistoryBackend::GetFaviconsForURL, 635 base::Bind(&HistoryBackend::GetFaviconsForURL,
638 history_backend_.get(), 636 history_backend_.get(),
639 page_url, 637 params.page_url,
640 icon_types, 638 params.icon_types,
641 desired_size_in_dip, 639 params.desired_size_in_dip,
642 desired_scale_factors, 640 desired_scale_factors,
641 params.threshold_for_next_icon_types,
643 results), 642 results),
644 base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); 643 base::Bind(&RunWithFaviconResults, callback, base::Owned(results)));
645 } 644 }
646 645
647 CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( 646 CancelableTaskTracker::TaskId HistoryService::GetFaviconForID(
648 chrome::FaviconID favicon_id, 647 chrome::FaviconID favicon_id,
649 int desired_size_in_dip, 648 int desired_size_in_dip,
650 ui::ScaleFactor desired_scale_factor, 649 ui::ScaleFactor desired_scale_factor,
651 const FaviconService::FaviconResultsCallback& callback, 650 const FaviconService::FaviconResultsCallback& callback,
652 CancelableTaskTracker* tracker) { 651 CancelableTaskTracker* tracker) {
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 DCHECK(thread_checker_.CalledOnValidThread()); 1240 DCHECK(thread_checker_.CalledOnValidThread());
1242 visit_database_observers_.RemoveObserver(observer); 1241 visit_database_observers_.RemoveObserver(observer);
1243 } 1242 }
1244 1243
1245 void HistoryService::NotifyVisitDBObserversOnAddVisit( 1244 void HistoryService::NotifyVisitDBObserversOnAddVisit(
1246 const history::BriefVisitInfo& info) { 1245 const history::BriefVisitInfo& info) {
1247 DCHECK(thread_checker_.CalledOnValidThread()); 1246 DCHECK(thread_checker_.CalledOnValidThread());
1248 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, 1247 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
1249 OnAddVisit(info)); 1248 OnAddVisit(info));
1250 } 1249 }
OLDNEW
« chrome/browser/history/history_backend.cc ('K') | « chrome/browser/history/history_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698