gecko-dev/storage
Lina Cambridge 38a1672309 Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak
Previously, `mozIStorageConnection#transactionInProgress` returned true
only if a transaction was started via `beginTransaction()`. This meant
that manually executing `BEGIN`, as `Sqlite.jsm` and the Rust bindings
do, wouldn't accurately report if a transaction was in progress.
Similarly, the flag wasn't accurate in cases where SQLite automatically
rolled back a transaction.

Fortunately, SQLite provides the `sqlite3_get_autocommit()` function,
which we can use to determine if a transaction is open or not. This
commit refactors the `transactionInProgress` getter, along with all
`Connection` methods that depend on it, to use the SQLite API instead
of managing that state on the connection. `mozStorageTransaction` and
`Sqlite.jsm` still use their own flags to decide whether to commit
their transactions, for reasons explained in the IDL comment.

This commit also moves `transactionInProgress` to
`mozIStorageAsyncConnection`, so that `Sqlite.jsm` can use it, and
exposes it to Rust.

Differential Revision: https://phabricator.services.mozilla.com/D63732

--HG--
extra : moz-landing-system : lando
2020-03-03 22:57:39 +00:00
..
build
rust Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak 2020-03-03 22:57:39 +00:00
test Bug 1611415 - Prefer using std::move over forget. r=froydnj 2020-02-13 14:38:48 +00:00
variant Bug 1617369 - Reformat storage/variant/ using rustfmt r=lina 2020-03-02 15:48:30 +00:00
FileSystemModule.cpp Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
FileSystemModule.h
IStorageBindingParamsInternal.h
SQLCollations.cpp
SQLCollations.h
SQLiteMutex.h Bug 1611386 - Drop support for --enable-system-sqlite. r=asuth,glandium 2020-02-20 22:16:03 +00:00
StatementCache.h
StorageBaseStatementInternal.cpp
StorageBaseStatementInternal.h
TelemetryVFS.cpp Bug 1611925 - Stop doing our own special parsing of Sqlite zName to build the Quota Object. r=asuth 2020-02-04 10:18:47 +00:00
VacuumManager.cpp
VacuumManager.h Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
Variant.cpp
Variant.h
Variant_inl.h
moz.build Bug 1611386 - Drop support for --enable-system-sqlite. r=asuth,glandium 2020-02-20 22:16:03 +00:00
mozIStorageAggregateFunction.idl
mozIStorageAsyncConnection.idl Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak 2020-03-03 22:57:39 +00:00
mozIStorageAsyncStatement.idl
mozIStorageBaseStatement.idl
mozIStorageBindingParams.idl
mozIStorageBindingParamsArray.idl
mozIStorageCompletionCallback.idl
mozIStorageConnection.idl Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak 2020-03-03 22:57:39 +00:00
mozIStorageError.idl
mozIStorageFunction.idl
mozIStoragePendingStatement.idl
mozIStorageProgressHandler.idl
mozIStorageResultSet.idl
mozIStorageRow.idl
mozIStorageService.idl
mozIStorageStatement.idl
mozIStorageStatementCallback.idl
mozIStorageVacuumParticipant.idl
mozIStorageValueArray.idl
mozStorageArgValueArray.cpp
mozStorageArgValueArray.h
mozStorageAsyncStatement.cpp Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
mozStorageAsyncStatement.h
mozStorageAsyncStatementExecution.cpp Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak 2020-03-03 22:57:39 +00:00
mozStorageAsyncStatementExecution.h
mozStorageAsyncStatementJSHelper.cpp Bug 1586683 - Remove flat strings from JSAPI. r=jwalden,bzbarsky 2019-10-14 09:32:07 +00:00
mozStorageAsyncStatementJSHelper.h Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
mozStorageAsyncStatementParams.cpp
mozStorageAsyncStatementParams.h
mozStorageBindingParams.cpp Bug 1605934 - Use nested namespaces r=sg 2020-01-18 13:48:34 +00:00
mozStorageBindingParams.h
mozStorageBindingParamsArray.cpp
mozStorageBindingParamsArray.h
mozStorageConnection.cpp Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak 2020-03-03 22:57:39 +00:00
mozStorageConnection.h Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak 2020-03-03 22:57:39 +00:00
mozStorageError.cpp
mozStorageError.h
mozStorageHelper.h Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
mozStoragePrivateHelpers.cpp Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj 2019-12-20 07:16:43 +00:00
mozStoragePrivateHelpers.h
mozStorageResultSet.cpp
mozStorageResultSet.h
mozStorageRow.cpp
mozStorageRow.h
mozStorageSQLFunctions.cpp
mozStorageSQLFunctions.h
mozStorageService.cpp Bug 1611386 - Drop support for --enable-system-sqlite. r=asuth,glandium 2020-02-20 22:16:03 +00:00
mozStorageService.h
mozStorageStatement.cpp
mozStorageStatement.h
mozStorageStatementData.h Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
mozStorageStatementJSHelper.cpp Bug 1586683 - Remove flat strings from JSAPI. r=jwalden,bzbarsky 2019-10-14 09:32:07 +00:00
mozStorageStatementJSHelper.h Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
mozStorageStatementParams.cpp
mozStorageStatementParams.h
mozStorageStatementRow.cpp Bug 1602882 - Move array operations to a new js/Array.h header. r=sfink,bzbarsky 2019-12-11 06:17:44 +00:00
mozStorageStatementRow.h
storage.h Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan 2019-12-06 09:17:57 +00:00
style.txt
variantToSQLiteT_impl.h