summaryrefslogtreecommitdiffstats
path: root/storage/mozStorageAsyncStatementExecution.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-08 12:06:30 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-08 12:06:30 +0100
commit44cd9f2a915a4879371c5e0b059acc3e5a2378b0 (patch)
tree8cb1a4758b16d9caae55f525b73f5fca3824b4f7 /storage/mozStorageAsyncStatementExecution.h
parentf8d1830b530cd553d788b3579d41725d35c4da7f (diff)
parentb62fce0dc0c77a5788c331db32b3996e4020e2a5 (diff)
downloadUXP-44cd9f2a915a4879371c5e0b059acc3e5a2378b0.tar
UXP-44cd9f2a915a4879371c5e0b059acc3e5a2378b0.tar.gz
UXP-44cd9f2a915a4879371c5e0b059acc3e5a2378b0.tar.lz
UXP-44cd9f2a915a4879371c5e0b059acc3e5a2378b0.tar.xz
UXP-44cd9f2a915a4879371c5e0b059acc3e5a2378b0.zip
Merge branch 'ported-upstream'
Diffstat (limited to 'storage/mozStorageAsyncStatementExecution.h')
-rw-r--r--storage/mozStorageAsyncStatementExecution.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/storage/mozStorageAsyncStatementExecution.h b/storage/mozStorageAsyncStatementExecution.h
index c8493fd77..14ea49c2d 100644
--- a/storage/mozStorageAsyncStatementExecution.h
+++ b/storage/mozStorageAsyncStatementExecution.h
@@ -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;