Bug 1769952 - Fix running raptor on a Win10-64 VM r=sparky
[gecko.git] / dom / simpledb / ActorsChild.h
blobba8a77b7ac8d28fb035d0f658ebe5a2f5fc17e00
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_simpledb_ActorsChild_h
8 #define mozilla_dom_simpledb_ActorsChild_h
10 #include <cstdint>
11 #include "ErrorList.h"
12 #include "mozilla/RefPtr.h"
13 #include "mozilla/dom/PBackgroundSDBConnectionChild.h"
14 #include "mozilla/dom/PBackgroundSDBRequestChild.h"
15 #include "mozilla/ipc/ProtocolUtils.h"
16 #include "nsISupports.h"
17 #include "nsStringFwd.h"
19 namespace mozilla {
20 namespace ipc {
22 class BackgroundChildImpl;
24 } // namespace ipc
26 namespace dom {
28 class SDBConnection;
29 class SDBRequest;
31 class SDBConnectionChild final : public PBackgroundSDBConnectionChild {
32 friend class mozilla::ipc::BackgroundChildImpl;
33 friend class SDBConnection;
35 SDBConnection* mConnection;
37 NS_DECL_OWNINGTHREAD
39 public:
40 void AssertIsOnOwningThread() const {
41 NS_ASSERT_OWNINGTHREAD(SDBConnectionChild);
44 private:
45 // Only created by SDBConnection.
46 explicit SDBConnectionChild(SDBConnection* aConnection);
48 // Only destroyed by mozilla::ipc::BackgroundChildImpl.
49 ~SDBConnectionChild();
51 void SendDeleteMeInternal();
53 // IPDL methods are only called by IPDL.
54 virtual void ActorDestroy(ActorDestroyReason aWhy) override;
56 virtual PBackgroundSDBRequestChild* AllocPBackgroundSDBRequestChild(
57 const SDBRequestParams& aParams) override;
59 virtual bool DeallocPBackgroundSDBRequestChild(
60 PBackgroundSDBRequestChild* aActor) override;
62 virtual mozilla::ipc::IPCResult RecvAllowToClose() override;
64 virtual mozilla::ipc::IPCResult RecvClosed() override;
67 class SDBRequestChild final : public PBackgroundSDBRequestChild {
68 friend class SDBConnectionChild;
69 friend class SDBConnection;
71 RefPtr<SDBConnection> mConnection;
72 RefPtr<SDBRequest> mRequest;
74 public:
75 void AssertIsOnOwningThread() const
76 #ifdef DEBUG
78 #else
81 #endif
83 private:
84 // Only created by SDBConnection.
85 explicit SDBRequestChild(SDBRequest* aRequest);
87 // Only destroyed by SDBConnectionChild.
88 ~SDBRequestChild();
90 void HandleResponse(nsresult aResponse);
92 void HandleResponse();
94 void HandleResponse(const nsCString& aResponse);
96 // IPDL methods are only called by IPDL.
97 virtual void ActorDestroy(ActorDestroyReason aWhy) override;
99 virtual mozilla::ipc::IPCResult Recv__delete__(
100 const SDBRequestResponse& aResponse) override;
103 } // namespace dom
104 } // namespace mozilla
106 #endif // mozilla_dom_simpledb_ActorsChild_h