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

Unified Diff: chrome/browser/webdata/keyword_table.cc

Issue 10695115: Add a separate protector UMA state when backup is overwritten by migration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/keyword_table.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/keyword_table.cc
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index c08a6f7c4da962d2e164bfb74bd879ec929ce68b..47d485216639f33faed44c592da86976e42e90d5 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -114,6 +114,11 @@ bool IsSearchProviderIDValid(int64 id, const std::string& signature) {
} // anonymous namespace
+KeywordTable::KeywordTable(sql::Connection* db, sql::MetaTable* meta_table)
+ : WebDatabaseTable(db, meta_table),
+ backup_overwritten_(false) {
+}
+
KeywordTable::~KeywordTable() {}
bool KeywordTable::Init() {
@@ -257,7 +262,9 @@ bool KeywordTable::DidDefaultSearchProviderChange() {
if (backup_id == kInvalidTemplateURLID) {
UMA_HISTOGRAM_ENUMERATION(
protector::kProtectorHistogramDefaultSearchProvider,
- protector::kProtectorErrorValueValidZero,
+ backup_overwritten_ ?
+ protector::kProtectorErrorOverwrittenByMigration :
+ protector::kProtectorErrorValueValidZero,
protector::kProtectorErrorCount);
return false;
}
@@ -268,7 +275,9 @@ bool KeywordTable::DidDefaultSearchProviderChange() {
current_url == backup_url) {
UMA_HISTOGRAM_ENUMERATION(
protector::kProtectorHistogramDefaultSearchProvider,
- protector::kProtectorErrorValueValid,
+ backup_overwritten_ ?
+ protector::kProtectorErrorOverwrittenByMigration :
+ protector::kProtectorErrorValueValid,
protector::kProtectorErrorCount);
return false;
}
@@ -354,7 +363,10 @@ bool KeywordTable::MigrateToVersion39AddSyncGUIDColumn() {
}
bool KeywordTable::MigrateToVersion44AddDefaultSearchProviderBackup() {
- return IsBackupSignatureValid(44) || UpdateBackupSignature(44);
+ if (IsBackupSignatureValid(44))
+ return true;
+ backup_overwritten_ = true;
+ return UpdateBackupSignature(44);
}
bool KeywordTable::MigrateToVersion45RemoveLogoIDAndAutogenerateColumns() {
« no previous file with comments | « chrome/browser/webdata/keyword_table.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698