DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (920bcf17a9e1)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
#include "nsIFile.idl"
#include "nsISupports.idl"

interface nsIObserver;

[scriptable, uuid(d573f1f3-fcdd-4dbe-980b-4ba79e6718dc)]
interface nsIProcess : nsISupports
{
  /**
   * Initialises the process with an executable to be run. Call the run method
   * to run the executable.
   * @param executable The executable to run.
   */
  void init(in nsIFile executable);

  /**
   * Not implemented. Will be removed in a future version of this interface.
   */
  void initWithPid(in unsigned long pid);

  /**
   * Kills the running process. After exiting the process will either have
   * been killed or a failure will have been returned.
   */
  void kill();

  /**
   * Executes the file this object was initialized with
   * @param blocking   Whether to wait until the process terminates before
                       returning or not.
   * @param args       An array of arguments to pass to the process in the
   *                   native character set.
   * @param count      The length of the args array.
   */
  void run(in boolean blocking, [array, size_is(count)] in string args,
           in unsigned long count);

  /**
   * Not implemented. Will be removed in a future version of this interface.
   */
  readonly attribute nsIFile location;

  /**
   * The process identifier of the currently running process. This will only
   * be available after the process has started and may not be available on
   * some platforms.
   */
  readonly attribute unsigned long pid;

  /**
   * Not implemented. Will be removed in a future version of this interface.
   */
  readonly attribute string processName;
  /**
   * Not implemented. Will be removed in a future version of this interface.
   */
  readonly attribute unsigned long processSignature;

  /**
   * The exit value of the process. This is only valid after the process has
   * exited.
   */
  readonly attribute long exitValue;

  /**
   * Returns whether the process is currently running or not.
   */
  readonly attribute boolean isRunning;
};

[scriptable, uuid(7d362c71-308e-4724-b1eb-8451fe133026)]
interface nsIProcess2 : nsIProcess
{
  /**
   * Executes the file this object was initialized with optionally calling
   * an observer after the process has finished running.
   * @param args       An array of arguments to pass to the process in the
   *                   native character set.
   * @param count      The length of the args array.
   * @param observer   An observer to notify when the process has completed. It
   *                   will receive this process instance as the subject and
   *                   "process-finished" or "process-failed" as the topic. The
   *                   observer will be notified on the main thread.
   * @param holdWeak   Whether to use a weak reference to hold the observer.
   */
  void runAsync([array, size_is(count)] in string args, in unsigned long count,
                [optional] in nsIObserver observer, [optional] in boolean holdWeak);
};

%{C++

#define NS_PROCESS_CONTRACTID "@mozilla.org/process/util;1"
#define NS_PROCESS_CLASSNAME "Process Specification"
%}