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

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

Issue 531493002: Move encoding SkBitmaps to PNG out of FaviconService::SetFavicons() and onto the history thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 const gfx::Size& pixel_size) { 610 const gfx::Size& pixel_size) {
611 DCHECK(thread_) << "History service being called after cleanup"; 611 DCHECK(thread_) << "History service being called after cleanup";
612 DCHECK(thread_checker_.CalledOnValidThread()); 612 DCHECK(thread_checker_.CalledOnValidThread());
613 if (!CanAddURL(page_url)) 613 if (!CanAddURL(page_url))
614 return; 614 return;
615 615
616 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::MergeFavicon, page_url, 616 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::MergeFavicon, page_url,
617 icon_url, icon_type, bitmap_data, pixel_size); 617 icon_url, icon_type, bitmap_data, pixel_size);
618 } 618 }
619 619
620 void HistoryService::SetFavicons( 620 void HistoryService::SetFavicon(
621 const GURL& page_url, 621 const GURL& page_url,
622 favicon_base::IconType icon_type, 622 favicon_base::IconType icon_type,
623 const std::vector<favicon_base::FaviconRawBitmapData>& 623 const GURL& icon_url,
624 favicon_bitmap_data) { 624 const std::vector<SkBitmap>& bitmaps) {
625 DCHECK(thread_) << "History service being called after cleanup"; 625 DCHECK(thread_) << "History service being called after cleanup";
626 DCHECK(thread_checker_.CalledOnValidThread()); 626 DCHECK(thread_checker_.CalledOnValidThread());
627 if (!CanAddURL(page_url)) 627 if (!CanAddURL(page_url))
628 return; 628 return;
629 629
630 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicons, page_url, 630 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, page_url,
631 icon_type, favicon_bitmap_data); 631 icon_type, icon_url, bitmaps);
632 } 632 }
633 633
634 void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) { 634 void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) {
635 DCHECK(thread_) << "History service being called after cleanup"; 635 DCHECK(thread_) << "History service being called after cleanup";
636 DCHECK(thread_checker_.CalledOnValidThread()); 636 DCHECK(thread_checker_.CalledOnValidThread());
637 ScheduleAndForget(PRIORITY_NORMAL, 637 ScheduleAndForget(PRIORITY_NORMAL,
638 &HistoryBackend::SetFaviconsOutOfDateForPage, page_url); 638 &HistoryBackend::SetFaviconsOutOfDateForPage, page_url);
639 } 639 }
640 640
641 void HistoryService::CloneFavicons(const GURL& old_page_url, 641 void HistoryService::CloneFavicons(const GURL& old_page_url,
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 DCHECK(thread_checker_.CalledOnValidThread()); 1224 DCHECK(thread_checker_.CalledOnValidThread());
1225 visit_database_observers_.RemoveObserver(observer); 1225 visit_database_observers_.RemoveObserver(observer);
1226 } 1226 }
1227 1227
1228 void HistoryService::NotifyVisitDBObserversOnAddVisit( 1228 void HistoryService::NotifyVisitDBObserversOnAddVisit(
1229 const history::BriefVisitInfo& info) { 1229 const history::BriefVisitInfo& info) {
1230 DCHECK(thread_checker_.CalledOnValidThread()); 1230 DCHECK(thread_checker_.CalledOnValidThread());
1231 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, 1231 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
1232 OnAddVisit(info)); 1232 OnAddVisit(info));
1233 } 1233 }
OLDNEW
« chrome/browser/history/history_service.h ('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