Bug 480427: Remove nsIProcess2 from trunk. r=bsmedberg
--- a/xpcom/tests/unit/test_nsIProcess.js
+++ b/xpcom/tests/unit/test_nsIProcess.js
@@ -128,17 +128,17 @@ function test_arguments()
}
// test if we get notified about a blocking process
function test_notify_blocking()
{
var file = get_test_program("TestQuickReturn");
var process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess2);
+ .createInstance(Components.interfaces.nsIProcess);
process.init(file);
process.runAsync([], 0, {
observe: function(subject, topic, data) {
process = subject.QueryInterface(Components.interfaces.nsIProcess);
do_check_eq(topic, "process-finished");
do_check_eq(process.exitValue, 42);
test_notify_nonblocking();
@@ -147,17 +147,17 @@ function test_notify_blocking()
}
// test if we get notified about a non-blocking process
function test_notify_nonblocking()
{
var file = get_test_program("TestArguments");
var process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess2);
+ .createInstance(Components.interfaces.nsIProcess);
process.init(file);
process.runAsync(["mozilla"], 1, {
observe: function(subject, topic, data) {
process = subject.QueryInterface(Components.interfaces.nsIProcess);
do_check_eq(topic, "process-finished");
do_check_eq(process.exitValue, 0);
test_notify_killed();
@@ -166,17 +166,17 @@ function test_notify_nonblocking()
}
// test if we get notified about a killed process
function test_notify_killed()
{
var file = get_test_program("TestBlockingProcess");
var process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess2);
+ .createInstance(Components.interfaces.nsIProcess);
process.init(file);
process.runAsync([], 0, {
observe: function(subject, topic, data) {
process = subject.QueryInterface(Components.interfaces.nsIProcess);
do_check_eq(topic, "process-finished");
do_test_finished();
}
--- a/xpcom/threads/nsIProcess.idl
+++ b/xpcom/threads/nsIProcess.idl
@@ -1,29 +1,24 @@
#include "nsIFile.idl"
#include "nsISupports.idl"
interface nsIObserver;
-[scriptable, uuid(d573f1f3-fcdd-4dbe-980b-4ba79e6718dc)]
+[scriptable, uuid(3c09efde-5f49-42b8-8520-57be02a5f84e)]
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
@@ -31,64 +26,46 @@ interface nsIProcess : nsISupports
* @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.
+ * 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.
*/
- readonly attribute nsIFile location;
+ void runAsync([array, size_is(count)] in string args, in unsigned long count,
+ [optional] in nsIObserver observer, [optional] in boolean holdWeak);
/**
* 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"
%}
--- a/xpcom/threads/nsProcess.h
+++ b/xpcom/threads/nsProcess.h
@@ -57,24 +57,23 @@
#include <windows.h>
#include <shellapi.h>
#endif
#define NS_PROCESS_CID \
{0x7b4eeb20, 0xd781, 0x11d4, \
{0x8A, 0x83, 0x00, 0x10, 0xa4, 0xe0, 0xc9, 0xca}}
-class nsProcess : public nsIProcess2,
+class nsProcess : public nsIProcess,
public nsIObserver
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPROCESS
- NS_DECL_NSIPROCESS2
NS_DECL_NSIOBSERVER
nsProcess();
private:
~nsProcess();
static void PR_CALLBACK Monitor(void *arg);
void ProcessComplete();
--- a/xpcom/threads/nsProcessCommon.cpp
+++ b/xpcom/threads/nsProcessCommon.cpp
@@ -72,18 +72,17 @@
#ifdef WINCE
#include <windows.h> // for MultiByteToWideChar
#include "prmem.h"
#endif
//-------------------------------------------------------------------//
// nsIProcess implementation
//-------------------------------------------------------------------//
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsProcess, nsIProcess,
- nsIProcess2,
+NS_IMPL_THREADSAFE_ISUPPORTS2(nsProcess, nsIProcess,
nsIObserver)
//Constructor
nsProcess::nsProcess()
: mThread(nsnull),
mLock(PR_NewLock()),
mShutdown(PR_FALSE),
mPid(-1),
@@ -465,51 +464,28 @@ NS_IMETHODIMP nsProcess::GetIsRunning(PR
if (mThread)
*aIsRunning = PR_TRUE;
else
*aIsRunning = PR_FALSE;
return NS_OK;
}
-NS_IMETHODIMP nsProcess::InitWithPid(PRUint32 pid)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsProcess::GetLocation(nsIFile** aLocation)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
NS_IMETHODIMP
nsProcess::GetPid(PRUint32 *aPid)
{
if (!mThread)
return NS_ERROR_FAILURE;
if (mPid < 0)
return NS_ERROR_NOT_IMPLEMENTED;
*aPid = mPid;
return NS_OK;
}
NS_IMETHODIMP
-nsProcess::GetProcessName(char** aProcessName)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsProcess::GetProcessSignature(PRUint32 *aProcessSignature)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
nsProcess::Kill()
{
if (!mThread)
return NS_ERROR_FAILURE;
{
nsAutoLock lock(mLock);
#if defined(PROCESSMODEL_WINAPI)