Bug 1908539 restrict MacOS platform audio processing to Nightly r=webrtc-reviewers...
[gecko.git] / dom / simpledb / SDBRequest.h
blob450cf8a788791977d3f6e6d0f269710e28c596f6
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
10 #include <cstdint>
11 #include "ErrorList.h"
12 #include "mozilla/Assertions.h"
13 #include "mozilla/RefPtr.h"
14 #include "nsCOMPtr.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "nsISDBRequest.h"
17 #include "nsISupports.h"
19 class nsISDBCallback;
20 class nsIVariant;
22 namespace mozilla::dom {
24 class SDBConnection;
26 class SDBRequest final : public nsISDBRequest {
27 RefPtr<SDBConnection> mConnection;
29 nsCOMPtr<nsIVariant> mResult;
30 nsCOMPtr<nsISDBCallback> mCallback;
32 nsresult mResultCode;
33 bool mHaveResultOrErrorCode;
35 public:
36 explicit SDBRequest(SDBConnection* aConnection);
38 void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(SDBRequest); }
40 SDBConnection* GetConnection() const {
41 AssertIsOnOwningThread();
43 return mConnection;
46 void SetResult(nsIVariant* aResult);
48 void SetError(nsresult aRv);
50 private:
51 ~SDBRequest();
53 void FireCallback();
55 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
56 NS_DECL_NSISDBREQUEST
57 NS_DECL_CYCLE_COLLECTION_CLASS(SDBRequest)
60 } // namespace mozilla::dom
62 #endif // mozilla_dom_simpledb_SDBRequest_h