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

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: Answered Brett's comments. 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
« no previous file with comments | « chrome/browser/history/history_types.cc ('k') | chrome/browser/history/top_sites_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e1df910c721497d9a6ef459320834408de994138 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 kRankOfNonExistingURL if not present.
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.
« no previous file with comments | « chrome/browser/history/history_types.cc ('k') | chrome/browser/history/top_sites_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698