Last Comment Bug 771426 - Further distinguish top windows in memory reports
: Further distinguish top windows in memory reports
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
-- normal with 1 vote (vote)
: ---
Assigned To: Nicholas Nethercote [:njn]
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2012-07-05 23:04 PDT by Nicholas Nethercote [:njn]
Modified: 2013-02-06 16:04 PST (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (1.12 KB, patch)
2012-07-05 23:04 PDT, Nicholas Nethercote [:njn]
jst: feedback+
Details | Diff | Splinter Review

Description User image Nicholas Nethercote [:njn] 2012-07-05 23:04:27 PDT
Created attachment 639587 [details] [diff] [review]

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

  top(, 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(, 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?
Comment 1 User image Justin Lebar (not reading bugmail) 2012-07-06 06:08:23 PDT
> - I didn't manage to trigger any "modal-top" windows -- any suggestions how to do that?

Did you try alert()?
Comment 2 User image Johnny Stenback (:jst, 2012-07-09 00:01:26 PDT
Comment on attachment 639587 [details] [diff] [review]

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.
Comment 3 User image Nicholas Nethercote [:njn] 2012-07-09 03:30:33 PDT
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.
Comment 4 User image Nicholas Nethercote [:njn] 2013-02-06 16:04:32 PST
This doesn't add much.

Note You need to log in before you can comment on or make changes to this bug.