gecko-dev/storage
Andrew Sutherland cac42cb9b5 Bug 1422327 - Clean up storage::Connection::Release. r=mak
Because of the storage::Service's connection list, it's possible for the
refcount for a non-main-thread Connection to experience transient increases
and decreases at any time, dooming logic in Release() that assumes the
refcount isn't changing.

This patch adopts use of an Atomic<bool> so that we execute cleanup logic
exactly once when the refcount falls to 1 at some point.  Care is taken to
ensure that the failsafe Close() occurs on the correct thread.

SpinningSynchronousClose() is still dangerous and can still potentially
nest deeply on the stack.  If we see instances of that in the future, we
may want to adopt use of PushEventQueue so that we can avoid re-entrancy
in our event loop spinning.

MozReview-Commit-ID: A835HBec50H

--HG--
extra : rebase_source : af2f63e8f050b7a0275e39f73e59133958e29f19
2018-02-25 23:50:42 -05:00
..
build
test Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
FileSystemModule.cpp
FileSystemModule.h
IStorageBindingParamsInternal.h
SQLCollations.cpp
SQLCollations.h
SQLiteMutex.h Bug 1371945 - Avoid a possible thread-safety problem with unfinalized statements. r=asuth 2017-06-16 17:43:23 +02:00
StatementCache.h
StorageBaseStatementInternal.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
StorageBaseStatementInternal.h Bug 645049 - Remove [deprecated] methods on mozIStorageBaseStatement.idl. r=asuth 2017-08-06 09:17:50 +09:00
TelemetryVFS.cpp Bug 730495, guarantee that sqlite3_config is called before any other SQLite function, r=asuth, r=froydnj, r=mak 2017-09-29 13:25:06 +02:00
VacuumManager.cpp Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
VacuumManager.h Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
Variant.h Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
Variant_inl.h
moz.build Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozIStorageAggregateFunction.idl
mozIStorageAsyncConnection.idl Bug 1422383 - Clone temporary tables, views, and triggers when cloning a storage connection. r=mak 2017-11-30 19:21:10 -08:00
mozIStorageAsyncStatement.idl
mozIStorageBaseStatement.idl Bug 645049 - Remove [deprecated] methods on mozIStorageBaseStatement.idl. r=asuth 2017-08-06 09:17:50 +09:00
mozIStorageBindingParams.idl
mozIStorageBindingParamsArray.idl
mozIStorageCompletionCallback.idl
mozIStorageConnection.idl Bug 1422383 - Clone temporary tables, views, and triggers when cloning a storage connection. r=mak 2017-11-30 19:21:10 -08: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 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj. 2017-10-18 13:17:26 +11:00
mozStorageAsyncStatement.h Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageAsyncStatementExecution.cpp Bug 1320301 - Add partial support to sqlite3_interrupt. r=asuth 2017-07-31 22:27:23 +02:00
mozStorageAsyncStatementExecution.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
mozStorageAsyncStatementJSHelper.cpp Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageAsyncStatementJSHelper.h Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageAsyncStatementParams.cpp Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageAsyncStatementParams.h Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageBindingParams.cpp
mozStorageBindingParams.h Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
mozStorageBindingParamsArray.cpp
mozStorageBindingParamsArray.h
mozStorageConnection.cpp Bug 1422327 - Clean up storage::Connection::Release. r=mak 2018-02-25 23:50:42 -05:00
mozStorageConnection.h Bug 1422327 - Clean up storage::Connection::Release. r=mak 2018-02-25 23:50:42 -05:00
mozStorageError.cpp
mozStorageError.h
mozStorageHelper.h Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium 2017-12-06 16:52:51 -08:00
mozStoragePrivateHelpers.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
mozStoragePrivateHelpers.h
mozStorageResultSet.cpp
mozStorageResultSet.h
mozStorageRow.cpp
mozStorageRow.h
mozStorageSQLFunctions.cpp Bug 1386103 (part 1, attempt 3) - Specify nsAuto[C]String storage size via template parameter. r=dbaron. 2017-08-09 20:41:38 +10:00
mozStorageSQLFunctions.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
mozStorageService.cpp Bug 1422327 - Clean up storage::Connection::Release. r=mak 2018-02-25 23:50:42 -05:00
mozStorageService.h Bug 1414441 - Stop caching an XPConnect pointer in storage/. r=mak 2017-11-03 15:50:29 -07:00
mozStorageStatement.cpp Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj. 2017-10-18 13:17:26 +11:00
mozStorageStatement.h Bug 958643, part 6 - Remove some unused forward decls. r=krizsa 2017-09-20 12:02:47 -07:00
mozStorageStatementData.h Bug 1350958 - Finish labeling ProxyReleaseEvent, r=billm 2017-07-14 08:49:22 +02:00
mozStorageStatementJSHelper.cpp Bug 1414441 - Stop caching an XPConnect pointer in storage/. r=mak 2017-11-03 15:50:29 -07:00
mozStorageStatementJSHelper.h Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageStatementParams.cpp Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageStatementParams.h Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
mozStorageStatementRow.cpp Bug 1390489 - Port StatementRow to WebIDL bindings. r=asuth,qdot 2017-08-22 09:25:37 +02:00
mozStorageStatementRow.h Bug 1390489 - Port StatementRow to WebIDL bindings. r=asuth,qdot 2017-08-22 09:25:37 +02:00
storage.h
style.txt
variantToSQLiteT_impl.h