Bug 1890793: Assert CallArgs::newTarget is not gray. r=spidermonkey-reviewers,sfink...
[gecko.git] / xpcom / threads / nsIProcess.idl
blobc15ded7a2fdd7810db883e9300ee7e2442a07961
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/. */
5 #include "nsISupports.idl"
7 interface nsIFile;
8 interface nsIObserver;
10 [scriptable, uuid(609610de-9954-4a63-8a7c-346350a86403)]
11 interface nsIProcess : nsISupports
13 /**
14 * Initialises the process with an executable to be run. Call the run method
15 * to run the executable.
16 * @param executable The executable to run.
18 void init(in nsIFile executable);
20 /**
21 * Kills the running process. After exiting the process will either have
22 * been killed or a failure will have been returned.
24 void kill();
26 /**
27 * Executes the file this object was initialized with
28 * @param blocking Whether to wait until the process terminates before
29 returning or not.
30 * @param args An array of arguments to pass to the process in the
31 * native character set.
32 * @param count The length of the args array.
34 void run(in boolean blocking, [array, size_is(count)] in string args,
35 in unsigned long count);
37 /**
38 * Executes the file this object was initialized with optionally calling
39 * an observer after the process has finished running.
40 * @param args An array of arguments to pass to the process in the
41 * native character set.
42 * @param count The length of the args array.
43 * @param observer An observer to notify when the process has completed. It
44 * will receive this process instance as the subject and
45 * "process-finished" or "process-failed" as the topic. The
46 * observer will be notified on the main thread.
47 * @param holdWeak Whether to use a weak reference to hold the observer.
49 void runAsync([array, size_is(count)] in string args, in unsigned long count,
50 [optional] in nsIObserver observer, [optional] in boolean holdWeak);
52 /**
53 * Executes the file this object was initialized with
54 * @param blocking Whether to wait until the process terminates before
55 returning or not.
56 * @param args An array of arguments to pass to the process in UTF-16
57 * @param count The length of the args array.
59 void runw(in boolean blocking, [array, size_is(count)] in wstring args,
60 in unsigned long count);
62 /**
63 * Executes the file this object was initialized with optionally calling
64 * an observer after the process has finished running.
65 * @param args An array of arguments to pass to the process in UTF-16
66 * @param count The length of the args array.
67 * @param observer An observer to notify when the process has completed. It
68 * will receive this process instance as the subject and
69 * "process-finished" or "process-failed" as the topic. The
70 * observer will be notified on the main thread.
71 * @param holdWeak Whether to use a weak reference to hold the observer.
73 void runwAsync([array, size_is(count)] in wstring args,
74 in unsigned long count,
75 [optional] in nsIObserver observer, [optional] in boolean holdWeak);
77 /**
78 * When set to true the process will not open a new window when started and
79 * will run hidden from the user. This currently affects only the Windows
80 * platform.
82 attribute boolean startHidden;
84 /**
85 * When set to true the process will be launched directly without using the
86 * shell. This currently affects only the Windows platform.
88 attribute boolean noShell;
90 /**
91 * The process identifier of the currently running process. This will only
92 * be available after the process has started and may not be available on
93 * some platforms.
95 readonly attribute unsigned long pid;
97 /**
98 * The exit value of the process. This is only valid after the process has
99 * exited.
101 readonly attribute long exitValue;
104 * Returns whether the process is currently running or not.
106 readonly attribute boolean isRunning;
109 %{C++
111 #define NS_PROCESS_CONTRACTID "@mozilla.org/process/util;1"