Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / dom / cache / CacheOpParent.h
blob6055f8d648bd33c12d46591b3d3b3dc4a367333a
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_CacheOpParent_h
8 #define mozilla_dom_cache_CacheOpParent_h
10 #include "mozilla/dom/cache/Manager.h"
11 #include "mozilla/dom/cache/PCacheOpParent.h"
12 #include "mozilla/dom/cache/PrincipalVerifier.h"
13 #include "nsTArray.h"
15 namespace mozilla {
16 namespace ipc {
17 class PBackgroundParent;
18 } // namespace ipc
19 namespace dom {
20 namespace cache {
22 class CacheOpParent final : public PCacheOpParent,
23 public PrincipalVerifier::Listener,
24 public Manager::Listener {
25 // to allow use of convenience overrides
26 using Manager::Listener::OnOpComplete;
28 public:
29 CacheOpParent(mozilla::ipc::PBackgroundParent* aIpcManager, CacheId aCacheId,
30 const CacheOpArgs& aOpArgs);
31 CacheOpParent(mozilla::ipc::PBackgroundParent* aIpcManager,
32 Namespace aNamespace, const CacheOpArgs& aOpArgs);
33 ~CacheOpParent();
35 void Execute(const SafeRefPtr<ManagerId>& aManagerId);
37 void Execute(SafeRefPtr<cache::Manager> aManager);
39 void WaitForVerification(PrincipalVerifier* aVerifier);
41 private:
42 // PCacheOpParent methods
43 virtual void ActorDestroy(ActorDestroyReason aReason) override;
45 // PrincipalVerifier::Listener methods
46 virtual void OnPrincipalVerified(
47 nsresult aRv, const SafeRefPtr<ManagerId>& aManagerId) override;
49 // Manager::Listener methods
50 virtual void OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
51 CacheId aOpenedCacheId,
52 const Maybe<StreamInfo>& aStreamInfo) override;
54 // utility methods
55 already_AddRefed<nsIInputStream> DeserializeCacheStream(
56 const Maybe<CacheReadStream>& aMaybeStream);
58 void ProcessCrossOriginResourcePolicyHeader(
59 ErrorResult& aRv, const nsTArray<SavedResponse>& aResponses);
61 mozilla::ipc::PBackgroundParent* mIpcManager;
62 const CacheId mCacheId;
63 const Namespace mNamespace;
64 const CacheOpArgs mOpArgs;
65 SafeRefPtr<cache::Manager> mManager;
66 RefPtr<PrincipalVerifier> mVerifier;
68 NS_DECL_OWNINGTHREAD
71 } // namespace cache
72 } // namespace dom
73 } // namespace mozilla
75 #endif // mozilla_dom_cache_CacheOpParent_h