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

Unified Diff: chrome/browser/history/top_sites.h

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 | « no previous file | chrome/browser/history/top_sites.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites.h
diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h
index 00d23432e4336897f24a06871c5cbd103b34ef3f..f92b87794dd96e00c3a8e6c0067035158ed1d1d5 100644
--- a/chrome/browser/history/top_sites.h
+++ b/chrome/browser/history/top_sites.h
@@ -79,6 +79,11 @@ class TopSites
bool GetPageThumbnail(const GURL& url,
scoped_refptr<RefCountedBytes>* bytes);
+ // Get a thumbnail score for a given page. Returns true iff we have the
+ // thumbnail score. This may be invoked on any thread. The score will
+ // be copied to |score|.
+ virtual bool GetPageThumbnailScore(const GURL& url, ThumbnailScore* score);
+
// Invoked from History if migration is needed. If this is invoked it will
// be before HistoryLoaded is invoked.
void MigrateFromHistory();
@@ -144,6 +149,19 @@ class TopSites
bool loaded() const { return loaded_; }
+ // Returns true if the given URL is known to the top sites service.
+ // This function also returns false if TopSites isn't loaded yet.
+ virtual bool IsKnownURL(const GURL& url);
+
+ // Returns true if the top sites list is full (i.e. we already have the
+ // maximum number of top sites). This function also returns false if
+ // TopSites isn't loaded yet.
+ virtual bool IsFull();
+
+ protected:
+ // For allowing inheritance.
+ virtual ~TopSites();
+
private:
friend class base::RefCountedThreadSafe<TopSites>;
friend class TopSitesTest;
@@ -177,8 +195,6 @@ class TopSites
TOP_SITES_LOADED
};
- ~TopSites();
-
// Sets the thumbnail without writing to the database. Useful when
// reading last known top sites from the DB.
// Returns true if the thumbnail was set, false if the existing one is better.
« no previous file with comments | « no previous file | chrome/browser/history/top_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698