diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /storage/mozStorageConnection.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/mozStorageConnection.cpp')
-rw-r--r-- | storage/mozStorageConnection.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index e10458a68b..5dd2c9223e 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -1155,19 +1155,20 @@ nsresult Connection::initialize(nsIFileURL* aFileURL) { bool hasKey = false; bool hasDirectoryLockId = false; - MOZ_ALWAYS_TRUE(URLParams::Parse( - query, [&hasKey, &hasDirectoryLockId](const nsAString& aName, - const nsAString& aValue) { - if (aName.EqualsLiteral("key")) { - hasKey = true; - return true; - } - if (aName.EqualsLiteral("directoryLockId")) { - hasDirectoryLockId = true; - return true; - } - return true; - })); + MOZ_ALWAYS_TRUE( + URLParams::Parse(query, true, + [&hasKey, &hasDirectoryLockId](const nsAString& aName, + const nsAString& aValue) { + if (aName.EqualsLiteral("key")) { + hasKey = true; + return true; + } + if (aName.EqualsLiteral("directoryLockId")) { + hasDirectoryLockId = true; + return true; + } + return true; + })); bool exclusive = StaticPrefs::storage_sqlite_exclusiveLock_enabled(); @@ -2469,6 +2470,18 @@ Connection::GetVariableLimit(int32_t* _limit) { } NS_IMETHODIMP +Connection::SetVariableLimit(int32_t limit) { + if (!connectionReady()) { + return NS_ERROR_NOT_INITIALIZED; + } + int oldLimit = ::sqlite3_limit(mDBConn, SQLITE_LIMIT_VARIABLE_NUMBER, limit); + if (oldLimit < 0) { + return NS_ERROR_UNEXPECTED; + } + return NS_OK; +} + +NS_IMETHODIMP Connection::BeginTransaction() { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; |