tor-browser

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

BoundStorageKeyParent.h (1790B)


      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_BoundStorageKeyParent_h
      8 #define mozilla_dom_cache_BoundStorageKeyParent_h
      9 
     10 #include "mozilla/dom/cache/PBoundStorageKeyParent.h"
     11 
     12 namespace mozilla {
     13 namespace ipc {
     14 class PBackgroundParent;
     15 }  // namespace ipc
     16 
     17 namespace dom::cache {
     18 class PCacheOpParent;
     19 class PCacheParent;
     20 class PCacheStorageParent;
     21 class ManagerId;
     22 
     23 class BoundStorageKeyParent final : public PBoundStorageKeyParent {
     24  friend class PBoundStorageKeyParent;
     25 
     26 public:
     27  explicit BoundStorageKeyParent(
     28      mozilla::ipc::PBackgroundParent* aBackgroundParent)
     29      : mBackgroundParent(aBackgroundParent) {
     30    MOZ_COUNT_CTOR(BoundStorageKeyParent);
     31  }
     32 
     33  NS_INLINE_DECL_REFCOUNTING(BoundStorageKeyParent, override)
     34 
     35 private:
     36  virtual ~BoundStorageKeyParent() { MOZ_COUNT_DTOR(BoundStorageKeyParent); }
     37 
     38  already_AddRefed<PCacheStorageParent> AllocPCacheStorageParent(
     39      const Namespace& aNamespace, const PrincipalInfo& aPrincipalInfo);
     40 
     41  // Keeping a reference to PBackgroundParent actor as it is required to passed
     42  // in when creating CacheStorageParent in AllocPCacheStorageParent. Raw ptr is
     43  // fine here as PBackground is one of the few top-level that gets created very
     44  // early on in the content and parent lifecycle and extends the lifetime of
     45  // this class.
     46  mozilla::ipc::PBackgroundParent* MOZ_NON_OWNING_REF mBackgroundParent;
     47 };
     48 
     49 }  // namespace dom::cache
     50 }  // namespace mozilla
     51 
     52 #endif  // mozilla_dom_cache_BoundStorageKeyParent_h