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

Unified Diff: chrome/browser/webdata/web_database_table.h

Issue 12518017: Generalize migration code in WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 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/webdata/web_database.cc ('k') | chrome/browser/webdata/web_intents_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/web_database_table.h
diff --git a/chrome/browser/webdata/web_database_table.h b/chrome/browser/webdata/web_database_table.h
index a1b875d491c54eb90824e6697bfc271aa7f0b9b3..76226959be4468c29e2c00f46b5fd54654cadf88 100644
--- a/chrome/browser/webdata/web_database_table.h
+++ b/chrome/browser/webdata/web_database_table.h
@@ -15,7 +15,7 @@ class MetaTable;
// An abstract base class representing a table within a WebDatabase.
// Each table should subclass this, adding type-specific methods as needed.
class WebDatabaseTable {
- protected:
+ public:
WebDatabaseTable(sql::Connection* db, sql::MetaTable* meta_table);
virtual ~WebDatabaseTable();
@@ -29,6 +29,20 @@ class WebDatabaseTable {
// TODO(andybons): Implement something more robust.
virtual bool IsSyncable() = 0;
+ // Migrates this table to |version|. Returns false if there was
+ // migration work to do and it failed, true otherwise.
+ //
+ // |app_locale| is the locale of the app. Passed as a parameter as
+ // |it can only be safely queried on the UI thread.
+ //
+ // Implementations may set |*update_compatible_version| to true if
+ // the compatible version should be changed to |version|.
+ // Implementations should otherwise not modify this parameter.
+ virtual bool MigrateToVersion(int version,
+ const std::string& app_locale,
+ bool* update_compatible_version) = 0;
+
+ protected:
sql::Connection* db_;
sql::MetaTable* meta_table_;
« no previous file with comments | « chrome/browser/webdata/web_database.cc ('k') | chrome/browser/webdata/web_intents_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698