Bug 1850460 - Removed file build/build-clang/revert-llvmorg-18-init-3787-gb6a1473f97d...
[gecko.git] / dom / cache / CacheOpChild.h
blobb41a8edb1a7ef3b2c1b4c4c4ece158118c6331ae
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_CacheOpChild_h
8 #define mozilla_dom_cache_CacheOpChild_h
10 #include "mozilla/dom/cache/ActorChild.h"
11 #include "mozilla/dom/cache/PCacheOpChild.h"
12 #include "mozilla/dom/cache/TypeUtils.h"
13 #include "mozilla/RefPtr.h"
15 class nsIGlobalObject;
17 namespace mozilla::dom {
19 class Promise;
21 namespace cache {
23 class CacheOpChild final : public PCacheOpChild,
24 public ActorChild,
25 public TypeUtils {
26 friend class CacheChild;
27 friend class CacheStorageChild;
28 friend class PCacheOpChild;
30 public:
31 NS_INLINE_DECL_REFCOUNTING(CacheOpChild, override)
33 private:
34 // This class must be constructed by CacheChild or CacheStorageChild using
35 // their ExecuteOp() factory method.
36 CacheOpChild(SafeRefPtr<CacheWorkerRef> aWorkerRef, nsIGlobalObject* aGlobal,
37 nsISupports* aParent, Promise* aPromise,
38 ActorChild* aParentActor);
39 ~CacheOpChild();
41 // PCacheOpChild methods
42 virtual void ActorDestroy(ActorDestroyReason aReason) override;
44 mozilla::ipc::IPCResult Recv__delete__(ErrorResult&& aRv,
45 const CacheOpResult& aResult);
47 // ActorChild methods
48 virtual void StartDestroy() override;
50 // TypeUtils methods
51 virtual nsIGlobalObject* GetGlobalObject() const override;
53 #ifdef DEBUG
54 virtual void AssertOwningThread() const override;
55 #endif
57 virtual mozilla::ipc::PBackgroundChild* GetIPCManager() override;
59 // Utility methods
60 void HandleResponse(const Maybe<CacheResponse>& aMaybeResponse);
62 void HandleResponseList(const nsTArray<CacheResponse>& aResponseList);
64 void HandleRequestList(const nsTArray<CacheRequest>& aRequestList);
66 nsCOMPtr<nsIGlobalObject> mGlobal;
67 // Hold the parent Cache or CacheStorage object alive until this async
68 // operation completes.
69 nsCOMPtr<nsISupports> mParent;
70 RefPtr<Promise> mPromise;
71 ActorChild* mParentActor;
74 } // namespace cache
75 } // namespace mozilla::dom
77 #endif // mozilla_dom_cache_CacheOpChild_h