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_remoteworkercontrollerchild_h__
8 #define mozilla_dom_remoteworkercontrollerchild_h__
10 #include "nsISupportsImpl.h"
12 #include "RemoteWorkerController.h"
13 #include "mozilla/RefPtr.h"
14 #include "mozilla/dom/PRemoteWorkerControllerChild.h"
16 namespace mozilla::dom
{
19 * Parent-process main-thread proxy used by ServiceWorkerManager to control
20 * RemoteWorkerController instances on the parent-process PBackground thread.
22 class RemoteWorkerControllerChild final
: public PRemoteWorkerControllerChild
{
23 friend class PRemoteWorkerControllerChild
;
26 NS_INLINE_DECL_REFCOUNTING(RemoteWorkerControllerChild
)
28 explicit RemoteWorkerControllerChild(RefPtr
<RemoteWorkerObserver
> aObserver
);
32 void RevokeObserver(RemoteWorkerObserver
* aObserver
);
34 void MaybeSendDelete();
37 ~RemoteWorkerControllerChild() = default;
39 PFetchEventOpChild
* AllocPFetchEventOpChild(
40 const ParentToParentServiceWorkerFetchEventOpArgs
& aArgs
);
42 bool DeallocPFetchEventOpChild(PFetchEventOpChild
* aActor
);
44 void ActorDestroy(ActorDestroyReason aReason
) override
;
46 mozilla::ipc::IPCResult
RecvCreationFailed();
48 mozilla::ipc::IPCResult
RecvCreationSucceeded();
50 mozilla::ipc::IPCResult
RecvErrorReceived(const ErrorValue
& aError
);
52 mozilla::ipc::IPCResult
RecvTerminated();
54 mozilla::ipc::IPCResult
RecvSetServiceWorkerSkipWaitingFlag(
55 SetServiceWorkerSkipWaitingFlagResolver
&& aResolve
);
57 RefPtr
<RemoteWorkerObserver
> mObserver
;
59 bool mIPCActive
= true;
62 } // namespace mozilla::dom
64 #endif // mozilla_dom_remoteworkercontrollerchild_h__