Commit 0e8075b3 authored by Kathleen Brade's avatar Kathleen Brade Committed by Mike Perry
Browse files

Add processID API to nsXULAppInfo.

This is needed to allow Tor Launcher to pass Firefox's PID as the owning
controller process, so Tor knows to exit when Firefox does.
parent d8d5602a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -777,6 +777,18 @@ nsXULAppInfo::GetProcessType(uint32_t* aResult)
  return NS_OK;
}

NS_IMETHODIMP
nsXULAppInfo::GetProcessID(uint32_t* aResult)
{
  NS_ENSURE_ARG_POINTER(aResult);
#ifdef XP_WIN
  *aResult = GetCurrentProcessId();
#else
  *aResult = getpid();
#endif
  return NS_OK;
}

NS_IMETHODIMP
nsXULAppInfo::EnsureContentProcess()
{
+7 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@
 *                    stable/frozen, please contact Benjamin Smedberg.
 */

[scriptable, uuid(cb0b8eda-4c83-4d0e-a63c-d3b65714bc85)]

[scriptable, uuid(e080b1f6-8452-4bde-9368-c795808b86d1)]
interface nsIXULRuntime : nsISupports
{
  /**
@@ -67,6 +68,11 @@ interface nsIXULRuntime : nsISupports
   */
  readonly attribute unsigned long processType;

  /**
   * The system process ID of the caller's process.
   */
  readonly attribute unsigned long processID;

  /**
   * Signal the apprunner to invalidate caches on the next restart.
   * This will cause components to be autoregistered and all