2014-10-27 17:00:05 +00:00
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2016-01-30 17:05:36 +00:00
|
|
|
interface mozIDOMWindow;
|
2015-12-15 11:10:53 +00:00
|
|
|
interface nsIPrincipal;
|
2014-10-29 20:11:33 +00:00
|
|
|
|
2015-10-16 16:48:26 +00:00
|
|
|
[scriptable, uuid(9cf3b48e-361d-486a-8917-55cf8d00bb41)]
|
2014-10-29 20:11:33 +00:00
|
|
|
interface nsIWorkerDebuggerListener : nsISupports
|
|
|
|
{
|
|
|
|
void onClose();
|
2015-03-20 11:15:59 +00:00
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
void onError(in AString filename, in unsigned long lineno,
|
|
|
|
in AString message);
|
2015-03-26 19:09:45 +00:00
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
void onMessage(in AString message);
|
2014-10-29 20:11:33 +00:00
|
|
|
};
|
|
|
|
|
2016-01-30 17:05:36 +00:00
|
|
|
[scriptable, builtinclass, uuid(22f93aa3-8a05-46be-87e0-fa93bf8a8eff)]
|
2014-10-27 17:00:05 +00:00
|
|
|
interface nsIWorkerDebugger : nsISupports
|
|
|
|
{
|
2014-10-29 20:11:33 +00:00
|
|
|
const unsigned long TYPE_DEDICATED = 0;
|
|
|
|
const unsigned long TYPE_SHARED = 1;
|
|
|
|
const unsigned long TYPE_SERVICE = 2;
|
|
|
|
|
2014-10-27 17:00:05 +00:00
|
|
|
readonly attribute bool isClosed;
|
|
|
|
|
2014-10-29 20:11:33 +00:00
|
|
|
readonly attribute bool isChrome;
|
|
|
|
|
2015-06-08 07:08:20 +00:00
|
|
|
readonly attribute bool isInitialized;
|
|
|
|
|
2014-10-29 20:11:33 +00:00
|
|
|
readonly attribute nsIWorkerDebugger parent;
|
|
|
|
|
|
|
|
readonly attribute unsigned long type;
|
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString url;
|
2014-10-29 20:11:33 +00:00
|
|
|
|
2020-01-15 13:40:47 +00:00
|
|
|
// If this is a dedicated worker, the window this worker or (in the case of
|
|
|
|
// nested workers) its top-level ancestral worker is associated with.
|
2016-01-30 17:05:36 +00:00
|
|
|
readonly attribute mozIDOMWindow window;
|
2014-10-29 20:11:33 +00:00
|
|
|
|
2015-12-15 11:10:53 +00:00
|
|
|
readonly attribute nsIPrincipal principal;
|
|
|
|
|
|
|
|
readonly attribute unsigned long serviceWorkerID;
|
|
|
|
|
2019-04-18 00:47:24 +00:00
|
|
|
readonly attribute AString id;
|
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
void initialize(in AString url);
|
2015-03-17 10:15:19 +00:00
|
|
|
|
2016-02-26 20:23:12 +00:00
|
|
|
[binaryname(PostMessageMoz)]
|
2018-09-06 08:02:43 +00:00
|
|
|
void postMessage(in AString message);
|
2015-03-20 11:15:59 +00:00
|
|
|
|
2014-10-29 20:11:33 +00:00
|
|
|
void addListener(in nsIWorkerDebuggerListener listener);
|
|
|
|
|
|
|
|
void removeListener(in nsIWorkerDebuggerListener listener);
|
2019-02-12 23:04:18 +00:00
|
|
|
|
|
|
|
// Indicate whether the debugger has finished initializing. By default the
|
|
|
|
// debugger will be considered initialized when the onRegister hooks in all
|
|
|
|
// nsIWorkerDebuggerManagerListener have been called.
|
|
|
|
//
|
|
|
|
// setDebuggerReady(false) can be called during an onRegister hook to mark
|
|
|
|
// the debugger as not being ready yet. This will prevent all content from
|
|
|
|
// running in the worker, including the worker's main script and any messages
|
|
|
|
// posted to it. Other runnables will still execute in the worker as normal.
|
|
|
|
//
|
|
|
|
// When the debugger is ready, setDebuggerReady(true) should then be called
|
|
|
|
// to allow the worker to begin executing content.
|
|
|
|
void setDebuggerReady(in boolean ready);
|
2014-10-27 17:00:05 +00:00
|
|
|
};
|