tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CacheStorageParent.h (2013B)


      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/. */
      6 
      7 #ifndef mozilla_dom_cache_CacheStorageParent_h
      8 #define mozilla_dom_cache_CacheStorageParent_h
      9 
     10 #include "mozilla/dom/cache/PCacheStorageParent.h"
     11 #include "mozilla/dom/cache/PrincipalVerifier.h"
     12 #include "mozilla/dom/cache/Types.h"
     13 
     14 namespace mozilla::dom::cache {
     15 
     16 class ManagerId;
     17 
     18 class CacheStorageParent final : public PCacheStorageParent,
     19                                 public PrincipalVerifier::Listener {
     20  friend class PCacheStorageParent;
     21 
     22 public:
     23  CacheStorageParent(mozilla::ipc::PBackgroundParent* aIPCActor,
     24                     PBoundStorageKeyParent* aBoundStorageKeyActor,
     25                     Namespace aNamespace,
     26                     const mozilla::ipc::PrincipalInfo& aPrincipalInfo);
     27 
     28  NS_INLINE_DECL_REFCOUNTING(CacheStorageParent, override)
     29 
     30 private:
     31  virtual ~CacheStorageParent();
     32 
     33  // PCacheStorageParent methods
     34  virtual void ActorDestroy(ActorDestroyReason aReason) override;
     35 
     36  PCacheOpParent* AllocPCacheOpParent(const CacheOpArgs& aOpArgs);
     37 
     38  bool DeallocPCacheOpParent(PCacheOpParent* aActor);
     39 
     40  virtual mozilla::ipc::IPCResult RecvPCacheOpConstructor(
     41      PCacheOpParent* actor, const CacheOpArgs& aOpArgs) override;
     42 
     43  mozilla::ipc::IPCResult RecvTeardown();
     44 
     45  // PrincipalVerifier::Listener methods
     46  virtual void OnPrincipalVerified(
     47      nsresult aRv, const SafeRefPtr<ManagerId>& aManagerId) override;
     48 
     49  mozilla::ipc::PBackgroundParent* mBackgroundIPCActor;
     50  PBoundStorageKeyParent* mBoundStorageKeyActor;
     51  const Namespace mNamespace;
     52  RefPtr<PrincipalVerifier> mVerifier;
     53  nsresult mVerifiedStatus;
     54  SafeRefPtr<ManagerId> mManagerId;
     55 };
     56 
     57 }  // namespace mozilla::dom::cache
     58 
     59 #endif  // mozilla_dom_cache_CacheStorageParent_h