CacheStorageParent.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_cache_CacheStorageParent_h
  6. #define mozilla_dom_cache_CacheStorageParent_h
  7. #include "mozilla/dom/cache/PCacheStorageParent.h"
  8. #include "mozilla/dom/cache/PrincipalVerifier.h"
  9. #include "mozilla/dom/cache/Types.h"
  10. namespace mozilla {
  11. namespace dom {
  12. namespace cache {
  13. class ManagerId;
  14. class CacheStorageParent final : public PCacheStorageParent
  15. , public PrincipalVerifier::Listener
  16. {
  17. public:
  18. CacheStorageParent(PBackgroundParent* aManagingActor, Namespace aNamespace,
  19. const mozilla::ipc::PrincipalInfo& aPrincipalInfo);
  20. virtual ~CacheStorageParent();
  21. private:
  22. // PCacheStorageParent methods
  23. virtual void
  24. ActorDestroy(ActorDestroyReason aReason) override;
  25. virtual PCacheOpParent*
  26. AllocPCacheOpParent(const CacheOpArgs& aOpArgs) override;
  27. virtual bool
  28. DeallocPCacheOpParent(PCacheOpParent* aActor) override;
  29. virtual bool
  30. RecvPCacheOpConstructor(PCacheOpParent* actor,
  31. const CacheOpArgs& aOpArgs) override;
  32. virtual bool
  33. RecvTeardown() override;
  34. // PrincipalVerifier::Listener methods
  35. virtual void OnPrincipalVerified(nsresult aRv,
  36. ManagerId* aManagerId) override;
  37. const Namespace mNamespace;
  38. RefPtr<PrincipalVerifier> mVerifier;
  39. nsresult mVerifiedStatus;
  40. RefPtr<ManagerId> mManagerId;
  41. };
  42. } // namespace cache
  43. } // namespace dom
  44. } // namespace mozilla
  45. #endif // mozilla_dom_cache_CacheStorageParent_h