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_cache_CacheStorageParent_h
8 #define mozilla_dom_cache_CacheStorageParent_h
10 #include "mozilla/dom/cache/PCacheStorageParent.h"
11 #include "mozilla/dom/cache/PrincipalVerifier.h"
12 #include "mozilla/dom/cache/Types.h"
14 namespace mozilla::dom::cache
{
18 class CacheStorageParent final
: public PCacheStorageParent
,
19 public PrincipalVerifier::Listener
{
20 friend class PCacheStorageParent
;
23 CacheStorageParent(PBackgroundParent
* aManagingActor
, Namespace aNamespace
,
24 const mozilla::ipc::PrincipalInfo
& aPrincipalInfo
);
26 NS_INLINE_DECL_REFCOUNTING(CacheStorageParent
, override
)
29 virtual ~CacheStorageParent();
31 // PCacheStorageParent methods
32 virtual void ActorDestroy(ActorDestroyReason aReason
) override
;
34 PCacheOpParent
* AllocPCacheOpParent(const CacheOpArgs
& aOpArgs
);
36 bool DeallocPCacheOpParent(PCacheOpParent
* aActor
);
38 virtual mozilla::ipc::IPCResult
RecvPCacheOpConstructor(
39 PCacheOpParent
* actor
, const CacheOpArgs
& aOpArgs
) override
;
41 mozilla::ipc::IPCResult
RecvTeardown();
43 // PrincipalVerifier::Listener methods
44 virtual void OnPrincipalVerified(
45 nsresult aRv
, const SafeRefPtr
<ManagerId
>& aManagerId
) override
;
47 const Namespace mNamespace
;
48 RefPtr
<PrincipalVerifier
> mVerifier
;
49 nsresult mVerifiedStatus
;
50 SafeRefPtr
<ManagerId
> mManagerId
;
53 } // namespace mozilla::dom::cache
55 #endif // mozilla_dom_cache_CacheStorageParent_h