mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Cleanup async mozStorage callback management.
Also avoid raw pointers in mozStorageAsyncStatementExecution.cpp.
This commit is contained in:
parent
c2c3d90841
commit
86aabf8edd
2 changed files with 88 additions and 140 deletions
|
|
@ -82,6 +82,14 @@ public:
|
|||
*/
|
||||
bool shouldNotify();
|
||||
|
||||
/**
|
||||
* Used by notifyComplete(), notifyError() and notifyResults() to notify on
|
||||
* the calling thread.
|
||||
*/
|
||||
nsresult notifyCompleteOnCallingThread();
|
||||
nsresult notifyErrorOnCallingThread(mozIStorageError *aError);
|
||||
nsresult notifyResultsOnCallingThread(ResultSet *aResultSet);
|
||||
|
||||
private:
|
||||
AsyncExecuteStatements(StatementDataArray &aStatements,
|
||||
Connection *aConnection,
|
||||
|
|
@ -186,7 +194,10 @@ private:
|
|||
RefPtr<Connection> mConnection;
|
||||
sqlite3 *mNativeConnection;
|
||||
bool mHasTransaction;
|
||||
mozIStorageStatementCallback *mCallback;
|
||||
// Note, this may not be a threadsafe object - never addref/release off
|
||||
// the calling thread. We take a reference when this is created, and
|
||||
// release it in the CompletionNotifier::Run() call back to this thread.
|
||||
nsCOMPtr<mozIStorageStatementCallback> mCallback;
|
||||
nsCOMPtr<nsIThread> mCallingThread;
|
||||
RefPtr<ResultSet> mResultSet;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue