nsIWorkerDebugger.idl (2435B)
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 https://mozilla.org/MPL/2.0/. */ 4 5 #include "nsISupports.idl" 6 7 interface mozIDOMWindow; 8 interface nsIPrincipal; 9 10 [scriptable, uuid(9cf3b48e-361d-486a-8917-55cf8d00bb41)] 11 interface nsIWorkerDebuggerListener : nsISupports 12 { 13 void onClose(); 14 15 void onError(in ACString filename, in unsigned long lineno, 16 in AString message); 17 18 void onMessage(in AString message); 19 }; 20 21 [scriptable, builtinclass, uuid(22f93aa3-8a05-46be-87e0-fa93bf8a8eff)] 22 interface nsIWorkerDebugger : nsISupports 23 { 24 const unsigned long TYPE_DEDICATED = 0; 25 const unsigned long TYPE_SHARED = 1; 26 const unsigned long TYPE_SERVICE = 2; 27 28 readonly attribute boolean isClosed; 29 30 readonly attribute boolean isChrome; 31 32 readonly attribute boolean isRemote; 33 34 readonly attribute boolean isInitialized; 35 36 readonly attribute nsIWorkerDebugger parent; 37 38 readonly attribute unsigned long type; 39 40 readonly attribute AString url; 41 42 // If this is a dedicated worker, the window this worker or (in the case of 43 // nested workers) its top-level ancestral worker is associated with. 44 readonly attribute mozIDOMWindow window; 45 46 readonly attribute Array<uint64_t> windowIDs; 47 48 readonly attribute nsIPrincipal principal; 49 50 readonly attribute unsigned long serviceWorkerID; 51 52 readonly attribute AString id; 53 54 readonly attribute AString name; 55 56 void initialize(in AString url); 57 58 [binaryname(PostMessageMoz)] 59 void postMessage(in AString message); 60 61 void addListener(in nsIWorkerDebuggerListener listener); 62 63 void removeListener(in nsIWorkerDebuggerListener listener); 64 65 // Indicate whether the debugger has finished initializing. By default the 66 // debugger will be considered initialized when the onRegister hooks in all 67 // nsIWorkerDebuggerManagerListener have been called. 68 // 69 // setDebuggerReady(false) can be called during an onRegister hook to mark 70 // the debugger as not being ready yet. This will prevent all content from 71 // running in the worker, including the worker's main script and any messages 72 // posted to it. Other runnables will still execute in the worker as normal. 73 // 74 // When the debugger is ready, setDebuggerReady(true) should then be called 75 // to allow the worker to begin executing content. 76 void setDebuggerReady(in boolean ready); 77 };