summaryrefslogtreecommitdiffstats
path: root/components/history
diff options
context:
space:
mode:
authorshess <shess@chromium.org>2016-02-04 11:29:44 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-04 19:30:45 +0000
commit6f68bd3907164c404842a54b217fe048ebf80f93 (patch)
tree9cb3de5fd72758d11e19f84eccc56ab3394381c3 /components/history
parent5527f553b5f37b3bf74bfb16c874bc0aa2c86cff (diff)
downloadchromium_src-6f68bd3907164c404842a54b217fe048ebf80f93.zip
chromium_src-6f68bd3907164c404842a54b217fe048ebf80f93.tar.gz
chromium_src-6f68bd3907164c404842a54b217fe048ebf80f93.tar.bz2
[sql] Remove misleading AutoRecoverTable() parameter.
|extend_columns| was intended to be used in the case where the target schema differed slightly from the schema of the table being recovered. Unfortunately, it actually implemented part of the solution for when the target has fewer columns and described it as the solution for when the target has more columns. Remove the unnecessary code and parameter. [In general, table schema only add new columns, removing is more infrequent.] BUG=none Review URL: https://codereview.chromium.org/1666473003 Cr-Commit-Position: refs/heads/master@{#373586}
Diffstat (limited to 'components/history')
-rw-r--r--components/history/core/browser/thumbnail_database.cc6
-rw-r--r--components/history/core/browser/top_sites_database.cc5
2 files changed, 5 insertions, 6 deletions
diff --git a/components/history/core/browser/thumbnail_database.cc b/components/history/core/browser/thumbnail_database.cc
index c295bb4..8569d64 100644
--- a/components/history/core/browser/thumbnail_database.cc
+++ b/components/history/core/browser/thumbnail_database.cc
@@ -352,18 +352,18 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
return;
}
- if (!recovery->AutoRecoverTable("favicons", 0, &favicons_rows_recovered)) {
+ if (!recovery->AutoRecoverTable("favicons", &favicons_rows_recovered)) {
sql::Recovery::Rollback(std::move(recovery));
RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICONS);
return;
}
- if (!recovery->AutoRecoverTable("favicon_bitmaps", 0,
+ if (!recovery->AutoRecoverTable("favicon_bitmaps",
&favicon_bitmaps_rows_recovered)) {
sql::Recovery::Rollback(std::move(recovery));
RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICON_BITMAPS);
return;
}
- if (!recovery->AutoRecoverTable("icon_mapping", 0,
+ if (!recovery->AutoRecoverTable("icon_mapping",
&icon_mapping_rows_recovered)) {
sql::Recovery::Rollback(std::move(recovery));
RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_ICON_MAPPING);
diff --git a/components/history/core/browser/top_sites_database.cc b/components/history/core/browser/top_sites_database.cc
index faa61fc..646a85c 100644
--- a/components/history/core/browser/top_sites_database.cc
+++ b/components/history/core/browser/top_sites_database.cc
@@ -277,9 +277,8 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
return;
}
- // The |1| is because v2 [thumbnails] has one less column than v3 did. In the
- // v2 case the column will get default values.
- if (!recovery->AutoRecoverTable("thumbnails", 1, &thumbnails_recovered)) {
+ // In the v2 case the missing column will get default values.
+ if (!recovery->AutoRecoverTable("thumbnails", &thumbnails_recovered)) {
sql::Recovery::Rollback(std::move(recovery));
RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_THUMBNAILS);
return;