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"
22 namespace mozilla::dom
{
26 class SDBRequest final
: public nsISDBRequest
{
27 RefPtr
<SDBConnection
> mConnection
;
29 nsCOMPtr
<nsIVariant
> mResult
;
30 nsCOMPtr
<nsISDBCallback
> mCallback
;
33 bool mHaveResultOrErrorCode
;
36 explicit SDBRequest(SDBConnection
* aConnection
);
38 void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(SDBRequest
); }
40 SDBConnection
* GetConnection() const {
41 AssertIsOnOwningThread();
46 void SetResult(nsIVariant
* aResult
);
48 void SetError(nsresult aRv
);
55 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
57 NS_DECL_CYCLE_COLLECTION_CLASS(SDBRequest
)
60 } // namespace mozilla::dom
62 #endif // mozilla_dom_simpledb_SDBRequest_h