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

Unified Diff: components/history/core/browser/history_database.cc

Issue 1875033005: [Downloads/History] Add tab-url and tab-referrer-url to DownloadRow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guid-fix
Patch Set: Update expectations for DownloadUIController test. Created 4 years, 8 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
Index: components/history/core/browser/history_database.cc
diff --git a/components/history/core/browser/history_database.cc b/components/history/core/browser/history_database.cc
index c9a94f885bdf621e1e3d18b1c344bb11ffb19407..93a6d22c9736d9bca5e601bf927e36744be486a9 100644
--- a/components/history/core/browser/history_database.cc
+++ b/components/history/core/browser/history_database.cc
@@ -36,7 +36,7 @@ namespace {
// Current version number. We write databases at the "current" version number,
// but any previous version that can read the "compatible" one can make do with
// our database without *too* many bad effects.
-const int kCurrentVersionNumber = 30;
+const int kCurrentVersionNumber = 31;
const int kCompatibleVersionNumber = 16;
const char kEarlyExpirationThresholdKey[] = "early_expiration_threshold";
const int kMaxHostsInMemory = 10000;
@@ -499,6 +499,15 @@ sql::InitStatus HistoryDatabase::EnsureCurrentVersion() {
meta_table_.SetVersionNumber(cur_version);
}
+ if (cur_version == 30) {
+ if (!MigrateDownloadTabUrl()) {
+ LOG(WARNING) << "Unable to migrate history to version 31";
+ return sql::INIT_FAILURE;
+ }
+ cur_version++;
+ meta_table_.SetVersionNumber(cur_version);
+ }
+
// When the version is too old, we just try to continue anyway, there should
// not be a released product that makes a database too old for us to handle.
LOG_IF(WARNING, cur_version < GetCurrentVersion()) <<

Powered by Google App Engine
This is Rietveld 408576698