The default bug view has changed. See this FAQ.

Further distinguish top windows in memory reports

RESOLVED WONTFIX

Status

()

Core
DOM
RESOLVED WONTFIX
5 years ago
4 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 639587 [details] [diff] [review]
patch

The DOM memory reporters currently group things under top windows, e.g.:

  top(https://tbpl.mozilla.org/?tree=Mozilla-Inbound, id=174)

I'd like to distinguish between the different kinds of windows, e.g. tabs vs. browser windows.  The attached patch distinguishes between normal, chrome, and modal windows.  With it applied, here are some examples:

  # always present
  chrome-top(resource://gre-resources/hiddenWindow.html, id=3)

  # controlled by the user
  chrome-top(chrome://browser/content/browser.xul, id=1)
  chrome-top(chrome://global/content/console.xul, id=18)
  chrome-top(chrome://global/content/viewSource.xul, id=50)
  chrome-top(chrome://browser/content/scratchpad.xul, id=72)

  # tabs
  normal-top(http://techcrunch.com/, id=12)
  normal-top(about:memory?verbose, id=6)
  normal-top(about:addons, id=41)

  # contents of the "view source" window
  normal-top(view-source:about:memory?verbose, id=52)

In summary:

- "chrome-top" corresponds to physical windows in the UI, with the hidden window as a special case.

- "normal-top" corresponds to "tabs", with the content of the view source window as a special case.

- I didn't manage to trigger any "modal-top" windows -- any suggestions how to do that?

Are there other cases I'm missing?  Is there a better way to distinguish these cases -- e.g. is there a fool-proof way to identify an nsGlobalWindow that is a browser tab?
Attachment #639587 - Flags: feedback?(jst)
> - I didn't manage to trigger any "modal-top" windows -- any suggestions how to do that?

Did you try alert()?
Comment on attachment 639587 [details] [diff] [review]
patch

window.showModalDialog() is what creates modal content windows, so call that from a onclick handler or what not and you should see one of those. But you'll of course have a modal dialog to deal with. Modal content windows are *very* rare, so it may not even be worth distinguishing between modal content windows and tabs here.
Attachment #639587 - Flags: feedback?(jst) → feedback+
(Assignee)

Comment 3

5 years ago
Thanks, jst.  When asking for feedback I was hoping you'd say "here's a better way to distinguish windows" but I get the feeling there isn't one.
(Assignee)

Updated

5 years ago
Whiteboard: [MemShrink] → [MemShrink:P2]
(Assignee)

Comment 4

4 years ago
This doesn't add much.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.