1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_simpledb_SDBRequest_h
8 #define mozilla_dom_simpledb_SDBRequest_h
11 #include "ErrorList.h"
12 #include "mozilla/Assertions.h"
13 #include "mozilla/RefPtr.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "nsISDBRequest.h"
17 #include "nsISupports.h"
27 class SDBRequest final
: public nsISDBRequest
{
28 RefPtr
<SDBConnection
> mConnection
;
30 nsCOMPtr
<nsIVariant
> mResult
;
31 nsCOMPtr
<nsISDBCallback
> mCallback
;
34 bool mHaveResultOrErrorCode
;
37 explicit SDBRequest(SDBConnection
* aConnection
);
39 void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(SDBRequest
); }
41 SDBConnection
* GetConnection() const {
42 AssertIsOnOwningThread();
47 void SetResult(nsIVariant
* aResult
);
49 void SetError(nsresult aRv
);
56 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
58 NS_DECL_CYCLE_COLLECTION_CLASS(SDBRequest
)
62 } // namespace mozilla
64 #endif // mozilla_dom_simpledb_SDBRequest_h