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

Unified Diff: chrome/browser/history/top_sites_cache.cc

Issue 6389001: Add heuristics to skip thumbnail generation when it's unnecessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comments Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/top_sites_cache.h ('k') | chrome/browser/tab_contents/thumbnail_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites_cache.cc
diff --git a/chrome/browser/history/top_sites_cache.cc b/chrome/browser/history/top_sites_cache.cc
index 828b701468b8b8645b497dbbf7ae96dcda540654..3be70415d23caf68ca62c1b10d9fdd020e484eb2 100644
--- a/chrome/browser/history/top_sites_cache.cc
+++ b/chrome/browser/history/top_sites_cache.cc
@@ -47,6 +47,17 @@ bool TopSitesCache::GetPageThumbnail(const GURL& url,
return false;
}
+bool TopSitesCache::GetPageThumbnailScore(const GURL& url,
+ ThumbnailScore* score) {
+ std::map<GURL, Images>::const_iterator found =
+ images_.find(GetCanonicalURL(url));
+ if (found != images_.end()) {
+ *score = found->second.thumbnail_score;
+ return true;
+ }
+ return false;
+}
+
GURL TopSitesCache::GetCanonicalURL(const GURL& url) {
CanonicalURLs::iterator i = TopSitesCache::GetCanonicalURLsIterator(url);
return i == canonical_urls_.end() ? url : i->first.first->url;
« no previous file with comments | « chrome/browser/history/top_sites_cache.h ('k') | chrome/browser/tab_contents/thumbnail_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698