Bug 1287626 - Add globally unique nsIXULAppinfo.uniqueProcessID
MozReview-Commit-ID: 3bcW1CjTpjT
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -832,16 +832,28 @@ nsXULAppInfo::GetProcessID(uint32_t* aRe
#ifdef XP_WIN
*aResult = GetCurrentProcessId();
#else
*aResult = getpid();
#endif
return NS_OK;
}
+NS_IMETHODIMP
+nsXULAppInfo::GetUniqueProcessID(uint64_t* aResult)
+{
+ if (XRE_IsContentProcess()) {
+ ContentChild* cc = ContentChild::GetSingleton();
+ *aResult = cc->GetID();
+ } else {
+ *aResult = 0;
+ }
+ return NS_OK;
+}
+
static bool gBrowserTabsRemoteAutostart = false;
static uint64_t gBrowserTabsRemoteStatus = 0;
static bool gBrowserTabsRemoteAutostartInitialized = false;
static bool gMultiprocessBlockPolicyInitialized = false;
static uint32_t gMultiprocessBlockPolicy = 0;
NS_IMETHODIMP
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -82,16 +82,21 @@ interface nsIXULRuntime : nsISupports
readonly attribute unsigned long processType;
/**
* The system process ID of the caller's process.
*/
readonly attribute unsigned long processID;
/**
+ * A globally unique and non-recycled ID of the caller's process.
+ */
+ readonly attribute uint64_t uniqueProcessID;
+
+ /**
* If true, browser tabs may be opened by default in a different process
* from the main browser UI.
*/
readonly attribute boolean browserTabsRemoteAutostart;
/**
* A numeric value indicating whether multiprocess might be blocked.
* Possible values can be found at nsAppRunner.cpp. A value of 0