no bug - Import translations from android-l10n r=release a=l10n CLOSED TREE
[gecko.git] / dom / quota / QuotaRequestBase.h
blob6d97ab07c30288f8298f85b7a3347811cd02d578
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_QUOTA_QUOTAREQUESTBASE_H_
8 #define DOM_QUOTA_QUOTAREQUESTBASE_H_
10 #include "NormalOriginOperationBase.h"
11 #include "mozilla/dom/quota/PQuotaRequestParent.h"
13 namespace mozilla::dom::quota {
15 class RequestResponse;
17 class QuotaRequestBase : public NormalOriginOperationBase,
18 public PQuotaRequestParent {
19 public:
20 NS_INLINE_DECL_REFCOUNTING(QuotaRequestBase, override)
22 protected:
23 QuotaRequestBase(MovingNotNull<RefPtr<QuotaManager>> aQuotaManager,
24 const char* aName)
25 : NormalOriginOperationBase(std::move(aQuotaManager), aName),
26 mActorDestroyed(false) {}
28 virtual ~QuotaRequestBase();
30 void NoteActorDestroyed() {
31 AssertIsOnOwningThread();
33 mActorDestroyed = true;
36 bool IsActorDestroyed() const {
37 AssertIsOnOwningThread();
39 return mActorDestroyed;
42 // Subclasses use this override to set the IPDL response value.
43 virtual void GetResponse(RequestResponse& aResponse) = 0;
45 private:
46 virtual void SendResults() override;
48 // IPDL methods.
49 virtual void ActorDestroy(ActorDestroyReason aWhy) override;
51 bool mActorDestroyed;
54 } // namespace mozilla::dom::quota
56 #endif // DOM_QUOTA_QUOTAREQUESTBASE_H_