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

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

Issue 39053005: Adding last_forced column to thumbnails database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved last_forced_time from Images to MostVisitedURL. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/top_sites_database.h
diff --git a/chrome/browser/history/top_sites_database.h b/chrome/browser/history/top_sites_database.h
index 053f03b0585f63ad5cbd1a380ce65e10edff4e17..6e299417d5671b26dcb85698be83288fe4b16df7 100644
--- a/chrome/browser/history/top_sites_database.h
+++ b/chrome/browser/history/top_sites_database.h
@@ -60,6 +60,15 @@ class TopSitesDatabase {
private:
FRIEND_TEST_ALL_PREFIXES(TopSitesDatabaseTest, Version1);
FRIEND_TEST_ALL_PREFIXES(TopSitesDatabaseTest, Version2);
+ FRIEND_TEST_ALL_PREFIXES(TopSitesDatabaseTest, Version3);
+ FRIEND_TEST_ALL_PREFIXES(TopSitesDatabaseTest, AddRemoveEditThumbnails);
+
+ // Rank of all URLs that are forced and therefore cannot be automatically
+ // evicted.
+ static const int kRankOfForcedURL = -1;
+
+ // Rank used to indicate that a URL is not stored in the database.
+ static const int kRankOfNonExistingURL = -2;
// Creates the thumbnail table, returning true if the table already exists
// or was successfully created.
@@ -69,6 +78,10 @@ class TopSitesDatabase {
// upgrade was successful.
bool UpgradeToVersion2();
+ // Upgrades the thumbnail table to version 3, returning true if the
+ // upgrade was successful.
+ bool UpgradeToVersion3();
+
// Adds a new URL to the database.
void AddPageThumbnail(const MostVisitedURL& url,
int new_rank,
@@ -82,12 +95,9 @@ class TopSitesDatabase {
bool UpdatePageThumbnail(const MostVisitedURL& url,
const Images& thumbnail);
- // Returns the URL's current rank or -1 if it is not present.
+ // Returns |url|'s current rank or RANK_OF_NONEXISTING_URL if not present.
brettw 2013/10/28 22:22:27 Update this to match constant.
beaudoin 2013/10/29 15:27:50 Done.
int GetURLRank(const MostVisitedURL& url);
- // Returns the number of URLs (rows) in the database.
- int GetRowCount();
-
sql::Connection* CreateDB(const base::FilePath& db_name);
// Encodes redirects into a string.

Powered by Google App Engine
This is Rietveld 408576698