Bug 1559409 - Show subframe pids in tab hover text, r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D35029

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2019-06-14 15:42:39 +00:00
Родитель 5993e555d3
Коммит 9033668540
4 изменённых файлов: 23 добавлений и 2 удалений

Просмотреть файл

@ -4288,8 +4288,20 @@ window._gBrowser = {
tab.linkedBrowser.frameLoader) { tab.linkedBrowser.frameLoader) {
label += " (pid " + tab.linkedBrowser.frameLoader.remoteTab.osPid + ")"; label += " (pid " + tab.linkedBrowser.frameLoader.remoteTab.osPid + ")";
if (window.docShell.QueryInterface(Ci.nsILoadContext).useRemoteSubframes) { // If we're running with fission enabled, try to include PID
label += " [F]"; // information for every remote subframe.
if (gFissionBrowser) {
let pids = new Set();
let stack = [tab.linkedBrowser.browsingContext];
while (stack.length) {
let bc = stack.pop();
stack.push(...bc.getChildren());
if (bc.currentWindowGlobal) {
pids.add(bc.currentWindowGlobal.osPid);
}
}
label += " [F " + Array.from(pids).join(", ") + "]";
} }
} }
} }

Просмотреть файл

@ -20,6 +20,8 @@ interface WindowGlobalParent {
readonly attribute unsigned long long outerWindowId; readonly attribute unsigned long long outerWindowId;
readonly attribute unsigned long long contentParentId; readonly attribute unsigned long long contentParentId;
readonly attribute long osPid;
// A WindowGlobalParent is the root in its process if it has no parent, or its // A WindowGlobalParent is the root in its process if it has no parent, or its
// embedder is in a different process. // embedder is in a different process.
readonly attribute boolean isProcessRoot; readonly attribute boolean isProcessRoot;

Просмотреть файл

@ -156,6 +156,11 @@ uint64_t WindowGlobalParent::ContentParentId() {
return browserParent ? browserParent->Manager()->ChildID() : 0; return browserParent ? browserParent->Manager()->ChildID() : 0;
} }
int32_t WindowGlobalParent::OsPid() {
RefPtr<BrowserParent> browserParent = GetBrowserParent();
return browserParent ? browserParent->Manager()->Pid() : -1;
}
// A WindowGlobalPaernt is the root in its process if it has no parent, or its // A WindowGlobalPaernt is the root in its process if it has no parent, or its
// embedder is in a different process. // embedder is in a different process.
bool WindowGlobalParent::IsProcessRoot() { bool WindowGlobalParent::IsProcessRoot() {

Просмотреть файл

@ -94,6 +94,8 @@ class WindowGlobalParent final : public WindowGlobalActor,
uint64_t ContentParentId(); uint64_t ContentParentId();
int32_t OsPid();
bool IsCurrentGlobal(); bool IsCurrentGlobal();
bool IsProcessRoot(); bool IsProcessRoot();