Index: chrome/browser/webdata/keyword_table.cc |
=================================================================== |
--- chrome/browser/webdata/keyword_table.cc (revision 90021) |
+++ chrome/browser/webdata/keyword_table.cc (working copy) |
@@ -18,7 +18,7 @@ |
namespace { |
// ID of the url column in keywords. |
-const int kUrlIdPosition = 16; |
+const int kUrlIdPosition = 17; |
// Keys used in the meta table. |
const char* kDefaultSearchProviderKey = "Default Search Provider ID"; |
@@ -54,6 +54,7 @@ |
s->BindBool(14, url.created_by_policy()); |
s->BindString(15, url.instant_url() ? url.instant_url()->url() : |
std::string()); |
+ s->BindInt64(16, url.last_modified().ToTimeT()); |
} |
} // anonymous namespace |
@@ -78,7 +79,8 @@ |
"autogenerate_keyword INTEGER DEFAULT 0," |
"logo_id INTEGER DEFAULT 0," |
"created_by_policy INTEGER DEFAULT 0," |
- "instant_url VARCHAR)")) { |
+ "instant_url VARCHAR," |
+ "last_modified INTEGER DEFAULT 0)")) { |
NOTREACHED(); |
return false; |
} |
@@ -99,8 +101,8 @@ |
"originating_url, date_created, usage_count, input_encodings, " |
"show_in_default_list, suggest_url, prepopulate_id, " |
"autogenerate_keyword, logo_id, created_by_policy, instant_url, " |
- "id) VALUES " |
- "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")); |
+ "last_modified, id) VALUES " |
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")); |
if (!s) { |
NOTREACHED() << "Statement prepare failed"; |
return false; |
@@ -132,7 +134,7 @@ |
"safe_for_autoreplace, originating_url, date_created, " |
"usage_count, input_encodings, show_in_default_list, " |
"suggest_url, prepopulate_id, autogenerate_keyword, logo_id, " |
- "created_by_policy, instant_url " |
+ "created_by_policy, instant_url, last_modified " |
"FROM keywords ORDER BY id ASC")); |
if (!s) { |
NOTREACHED() << "Statement prepare failed"; |
@@ -183,6 +185,8 @@ |
template_url->SetInstantURL(s.ColumnString(16), 0, 0); |
+ template_url->set_last_modified(Time::FromTimeT(s.ColumnInt64(17))); |
+ |
urls->push_back(template_url); |
} |
return s.Succeeded(); |
@@ -197,7 +201,8 @@ |
"safe_for_autoreplace=?, originating_url=?, date_created=?, " |
"usage_count=?, input_encodings=?, show_in_default_list=?, " |
"suggest_url=?, prepopulate_id=?, autogenerate_keyword=?, " |
- "logo_id=?, created_by_policy=?, instant_url=? WHERE id=?")); |
+ "logo_id=?, created_by_policy=?, instant_url=?, last_modified=? " |
+ "WHERE id=?")); |
if (!s) { |
NOTREACHED() << "Statement prepare failed"; |
return false; |
@@ -290,3 +295,8 @@ |
return true; |
} |
+ |
+bool KeywordTable::MigrateToVersion38AddLastModifiedColumn() { |
+ return db_->Execute( |
+ "ALTER TABLE keywords ADD COLUMN last_modified INTEGER DEFAULT 0"); |
+} |
Property changes on: chrome\browser\webdata\keyword_table.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |