Bug 1704628 Part 4: Avoid use of ESC to close context menu in browser_toolbox_content...
[gecko.git] / dom / cache / CacheOpChild.h
blobc962aa876a1cedb3b6f53c208d435300390d64a1
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 {
18 namespace dom {
20 class Promise;
22 namespace cache {
24 class CacheOpChild final : public PCacheOpChild,
25 public ActorChild,
26 public TypeUtils {
27 friend class CacheChild;
28 friend class CacheStorageChild;
29 friend class PCacheOpChild;
31 private:
32 // This class must be constructed by CacheChild or CacheStorageChild using
33 // their ExecuteOp() factory method.
34 CacheOpChild(SafeRefPtr<CacheWorkerRef> aWorkerRef, nsIGlobalObject* aGlobal,
35 nsISupports* aParent, Promise* aPromise);
36 ~CacheOpChild();
38 // PCacheOpChild methods
39 virtual void ActorDestroy(ActorDestroyReason aReason) override;
41 mozilla::ipc::IPCResult Recv__delete__(ErrorResult&& aRv,
42 const CacheOpResult& aResult);
44 // ActorChild methods
45 virtual void StartDestroy() override;
47 // TypeUtils methods
48 virtual nsIGlobalObject* GetGlobalObject() const override;
50 #ifdef DEBUG
51 virtual void AssertOwningThread() const override;
52 #endif
54 virtual mozilla::ipc::PBackgroundChild* GetIPCManager() override;
56 // Utility methods
57 void HandleResponse(const Maybe<CacheResponse>& aMaybeResponse);
59 void HandleResponseList(const nsTArray<CacheResponse>& aResponseList);
61 void HandleRequestList(const nsTArray<CacheRequest>& aRequestList);
63 nsCOMPtr<nsIGlobalObject> mGlobal;
64 // Hold the parent Cache or CacheStorage object alive until this async
65 // operation completes.
66 nsCOMPtr<nsISupports> mParent;
67 RefPtr<Promise> mPromise;
69 NS_DECL_OWNINGTHREAD
72 } // namespace cache
73 } // namespace dom
74 } // namespace mozilla
76 #endif // mozilla_dom_cache_CacheOpChild_h