From a6ed3ddf12bcbf47618609f3bdc18f17cab0a0f1 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Thu, 16 Apr 2009 16:46:10 +0100 Subject: [PATCH] Bug 480427: Remove nsIProcess2 from trunk. r=bsmedberg --- xpcom/tests/unit/test_nsIProcess.js | 6 +-- xpcom/threads/nsIProcess.idl | 61 +++++++++-------------------- xpcom/threads/nsProcess.h | 3 +- xpcom/threads/nsProcessCommon.cpp | 26 +----------- 4 files changed, 24 insertions(+), 72 deletions(-) diff --git a/xpcom/tests/unit/test_nsIProcess.js b/xpcom/tests/unit/test_nsIProcess.js index a13751b3f0e3..98be31f434f6 100644 --- a/xpcom/tests/unit/test_nsIProcess.js +++ b/xpcom/tests/unit/test_nsIProcess.js @@ -133,7 +133,7 @@ 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, { @@ -152,7 +152,7 @@ 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, { @@ -171,7 +171,7 @@ 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, { diff --git a/xpcom/threads/nsIProcess.idl b/xpcom/threads/nsIProcess.idl index ae165b2b149e..f820362b597b 100644 --- a/xpcom/threads/nsIProcess.idl +++ b/xpcom/threads/nsIProcess.idl @@ -3,7 +3,7 @@ interface nsIObserver; -[scriptable, uuid(d573f1f3-fcdd-4dbe-980b-4ba79e6718dc)] +[scriptable, uuid(3c09efde-5f49-42b8-8520-57be02a5f84e)] interface nsIProcess : nsISupports { /** @@ -13,11 +13,6 @@ interface nsIProcess : nsISupports */ 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. @@ -35,42 +30,6 @@ interface nsIProcess : nsISupports 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. @@ -85,6 +44,24 @@ interface nsIProcess2 : nsIProcess */ 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; + + /** + * 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; }; %{C++ diff --git a/xpcom/threads/nsProcess.h b/xpcom/threads/nsProcess.h index 0768f6f7e760..9143ac1b1d9e 100644 --- a/xpcom/threads/nsProcess.h +++ b/xpcom/threads/nsProcess.h @@ -62,14 +62,13 @@ {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(); diff --git a/xpcom/threads/nsProcessCommon.cpp b/xpcom/threads/nsProcessCommon.cpp index de12bc4ba65d..1f36aad21083 100644 --- a/xpcom/threads/nsProcessCommon.cpp +++ b/xpcom/threads/nsProcessCommon.cpp @@ -77,8 +77,7 @@ //-------------------------------------------------------------------// // nsIProcess implementation //-------------------------------------------------------------------// -NS_IMPL_THREADSAFE_ISUPPORTS3(nsProcess, nsIProcess, - nsIProcess2, +NS_IMPL_THREADSAFE_ISUPPORTS2(nsProcess, nsIProcess, nsIObserver) //Constructor @@ -470,17 +469,6 @@ NS_IMETHODIMP nsProcess::GetIsRunning(PRBool *aIsRunning) 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) { @@ -492,18 +480,6 @@ nsProcess::GetPid(PRUint32 *aPid) 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() {