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

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

Issue 8355031: Most Visited: remove over-eager optimization that causes a lot of blank thumbnails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test and remove unused function Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/history/top_sites_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/history/top_sites.h" 5 #include "chrome/browser/history/top_sites.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 void TopSites::ResetThreadSafeCache() { 941 void TopSites::ResetThreadSafeCache() {
942 base::AutoLock lock(lock_); 942 base::AutoLock lock(lock_);
943 MostVisitedURLList cached; 943 MostVisitedURLList cached;
944 ApplyBlacklistAndPinnedURLs(cache_->top_sites(), &cached); 944 ApplyBlacklistAndPinnedURLs(cache_->top_sites(), &cached);
945 thread_safe_cache_->SetTopSites(cached); 945 thread_safe_cache_->SetTopSites(cached);
946 } 946 }
947 947
948 void TopSites::ResetThreadSafeImageCache() { 948 void TopSites::ResetThreadSafeImageCache() {
949 base::AutoLock lock(lock_); 949 base::AutoLock lock(lock_);
950 thread_safe_cache_->SetThumbnails(cache_->images()); 950 thread_safe_cache_->SetThumbnails(cache_->images());
951 thread_safe_cache_->RemoveUnreferencedThumbnails();
952 } 951 }
953 952
954 void TopSites::NotifyTopSitesChanged() { 953 void TopSites::NotifyTopSitesChanged() {
955 content::NotificationService::current()->Notify( 954 content::NotificationService::current()->Notify(
956 chrome::NOTIFICATION_TOP_SITES_CHANGED, 955 chrome::NOTIFICATION_TOP_SITES_CHANGED,
957 content::Source<TopSites>(this), 956 content::Source<TopSites>(this),
958 content::NotificationService::NoDetails()); 957 content::NotificationService::NoDetails());
959 } 958 }
960 959
961 void TopSites::RestartQueryForTopSitesTimer(base::TimeDelta delta) { 960 void TopSites::RestartQueryForTopSitesTimer(base::TimeDelta delta) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 SetTopSites(pages); 1025 SetTopSites(pages);
1027 1026
1028 // Used only in testing. 1027 // Used only in testing.
1029 content::NotificationService::current()->Notify( 1028 content::NotificationService::current()->Notify(
1030 chrome::NOTIFICATION_TOP_SITES_UPDATED, 1029 chrome::NOTIFICATION_TOP_SITES_UPDATED,
1031 content::Source<TopSites>(this), 1030 content::Source<TopSites>(this),
1032 content::Details<CancelableRequestProvider::Handle>(&handle)); 1031 content::Details<CancelableRequestProvider::Handle>(&handle));
1033 } 1032 }
1034 1033
1035 } // namespace history 1034 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/top_sites_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698