Chromium Code Reviews| Index: chrome/browser/history/top_sites_cache.h |
| diff --git a/chrome/browser/history/top_sites_cache.h b/chrome/browser/history/top_sites_cache.h |
| index 0ce730848c5178ae48d2d19f9723bc79bfca629b..e133f5f02eebc50c13c41de8ed1ab2c0ef713314 100644 |
| --- a/chrome/browser/history/top_sites_cache.h |
| +++ b/chrome/browser/history/top_sites_cache.h |
| @@ -45,7 +45,8 @@ class TopSitesCache { |
| TopSitesCache(); |
| ~TopSitesCache(); |
| - // The top sites. |
| + // Set the top sites. In |top_sites| all forced URLs must appear before |
| + // non-forced URLs. This is only checked in debug. |
| void SetTopSites(const MostVisitedURLList& top_sites); |
| const MostVisitedURLList& top_sites() const { return top_sites_; } |
| @@ -86,6 +87,12 @@ class TopSitesCache { |
| // Returns the index into |top_sites_| for |url|. |
| size_t GetURLIndex(const GURL& url) const; |
| + // Returns the number of non-forced URLs in the cache. |
| + size_t GetNbNonForcedURLs() const; |
|
brettw
2013/11/08 22:56:07
"Nb"?
beaudoin
2013/11/11 21:58:09
Done.
|
| + |
| + // Returns the number of forced URLs in the cache. |
| + size_t GetNbForcedURLs() const; |
| + |
| private: |
| // The entries in CanonicalURLs, see CanonicalURLs for details. The second |
| // argument gives the index of the URL into MostVisitedURLs redirects. |
| @@ -124,6 +131,9 @@ class TopSitesCache { |
| typedef std::map<CanonicalURLEntry, size_t, |
| CanonicalURLComparator> CanonicalURLs; |
| + // Count the number of forced URLs. |
| + void CountForcedURLs(); |
| + |
| // Generates the set of canonical urls from |top_sites_|. |
| void GenerateCanonicalURLs(); |
| @@ -136,7 +146,12 @@ class TopSitesCache { |
| // Returns the GURL corresponding to an iterator in |canonical_urls_|. |
| const GURL& GetURLFromIterator(CanonicalURLs::const_iterator it) const; |
| - // The top sites. |
| + // The number of top sites with forced URLs. |
| + size_t nb_forced_urls_; |
| + |
| + // The top sites. This list must always contain the forced URLs first followed |
| + // by the non-forced URLs. This is not strictly enforced but is checked in |
| + // debug. |
| MostVisitedURLList top_sites_; |
| // The images. These map from canonical url to image. |