summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/Database.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /toolkit/components/places/Database.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/places/Database.cpp')
-rw-r--r--toolkit/components/places/Database.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp
index 891c53156d..56da4094c7 100644
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -1260,6 +1260,15 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) {
// Firefox 118 uses schema version 75
+ // Version 76 was not correctly invoked and thus removed.
+
+ if (currentSchemaVersion < 77) {
+ rv = MigrateV77Up();
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+
+ // Firefox 125 uses schema version 77
+
// Schema Upgrades must add migration code here.
// >>> IMPORTANT! <<<
// NEVER MIX UP SYNC AND ASYNC EXECUTION IN MIGRATORS, YOU MAY LOCK THE
@@ -1615,7 +1624,7 @@ nsresult Database::InitFunctions() {
NS_ENSURE_SUCCESS(rv, rv);
rv = InvalidateDaysOfHistoryFunction::create(mMainConn);
NS_ENSURE_SUCCESS(rv, rv);
- rv = MD5HexFunction::create(mMainConn);
+ rv = SHA256HexFunction::create(mMainConn);
NS_ENSURE_SUCCESS(rv, rv);
rv = SetShouldStartFrecencyRecalculationFunction::create(mMainConn);
NS_ENSURE_SUCCESS(rv, rv);
@@ -2041,6 +2050,15 @@ nsresult Database::MigrateV75Up() {
return NS_OK;
}
+nsresult Database::MigrateV77Up() {
+ // Recalculate origins frecency.
+ nsCOMPtr<mozIStorageStatement> stmt;
+ nsresult rv = mMainConn->ExecuteSimpleSQL(
+ "UPDATE moz_origins SET recalc_frecency = 1"_ns);
+ NS_ENSURE_SUCCESS(rv, rv);
+ return NS_OK;
+}
+
int64_t Database::CreateMobileRoot() {
MOZ_ASSERT(NS_IsMainThread());