RemoteWorkerDebuggerParent.h (1734B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef mozilla_dom_RemoteWorkerDebuggerParent_h 6 #define mozilla_dom_RemoteWorkerDebuggerParent_h 7 8 #include "mozilla/dom/PRemoteWorkerDebuggerChild.h" 9 #include "mozilla/dom/PRemoteWorkerDebuggerParent.h" 10 #include "mozilla/ipc/Endpoint.h" 11 #include "nsIWorkerDebugger.h" 12 #include "nsTArray.h" 13 14 namespace mozilla::dom { 15 16 class RemoteWorkerDebuggerParent final : public PRemoteWorkerDebuggerParent, 17 public nsIWorkerDebugger { 18 friend class PRemoteWorkerDebuggerParent; 19 20 NS_DECL_THREADSAFE_ISUPPORTS 21 NS_DECL_NSIWORKERDEBUGGER 22 23 public: 24 RemoteWorkerDebuggerParent( 25 const RemoteWorkerDebuggerInfo& aWorkerDebuggerInfo, 26 Endpoint<PRemoteWorkerDebuggerParent>&& aParentEp); 27 28 mozilla::ipc::IPCResult RecvUnregister(); 29 30 mozilla::ipc::IPCResult RecvReportErrorToDebugger( 31 const RemoteWorkerDebuggerErrorInfo& aErrorInfo); 32 33 mozilla::ipc::IPCResult RecvPostMessageToDebugger(const nsString& aMessage); 34 35 mozilla::ipc::IPCResult RecvSetAsInitialized(); 36 mozilla::ipc::IPCResult RecvSetAsClosed(); 37 38 mozilla::ipc::IPCResult RecvAddWindowID(const uint64_t& aWindowID); 39 mozilla::ipc::IPCResult RecvRemoveWindowID(const uint64_t& aWindowID); 40 41 private: 42 ~RemoteWorkerDebuggerParent(); 43 44 bool mIsInitialized{false}; 45 bool mIsClosed{false}; 46 RemoteWorkerDebuggerInfo mWorkerDebuggerInfo; 47 48 nsTArray<uint64_t> mWindowIDs; 49 50 nsTArray<nsCOMPtr<nsIWorkerDebuggerListener>> mListeners; 51 }; 52 53 } // namespace mozilla::dom 54 55 #endif // mozilla_dom_RemoteWorkerDebuggerParent_h