Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
This is on top of bug 1486623.
While at it removed the 'stale computed styles' report, since it was unused
since I removed the undisplayed maps.
Differential Revision: https://phabricator.services.mozilla.com/D4453
--HG--
extra : moz-landing-system : lando
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.
MozReview-Commit-ID: C2H9ce8FmE4
--HG--
extra : rebase_source : 61afc5481dc8ec34caba1886bd74200cf3659fb4
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.
MozReview-Commit-ID: C2H9ce8FmE4
--HG--
extra : rebase_source : 4f8dd2996d820fdb5a07afe544be5e2d6ca6a5c7
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.
MozReview-Commit-ID: C2H9ce8FmE4
--HG--
extra : rebase_source : b01f47e439a61492ad999ae30677c48535e8cd4c
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.
MozReview-Commit-ID: C2H9ce8FmE4
--HG--
extra : rebase_source : 571fd3b1e6511daa5731da76fb5d6d97bce11db1
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.
MozReview-Commit-ID: C2H9ce8FmE4
--HG--
extra : rebase_source : 7a3b71596b4318f517ec4c3ac0180e2aa3b721c7
Rather than recording how many leaked (ghost) windows we see at
various times, I think it will be more useful over all to record what
the maximum number of ghost windows we see during a single
ping. Hopefully this will show up in a way that generates automated
alerts better than GHOST_WINDOWS.
If this works out, I'll make this telemetry measure permanent and
remove GHOST_WINDOWS.
MozReview-Commit-ID: 11ma1lLGz5L
--HG--
extra : rebase_source : dc7705d288d3301fc0a1ec15f8dadfb66fe8820f
nsStyleStructList.h was initially made generated in bug 873368 to avoid
manually maintaining boilerplate for if-dispatch, while the if-dispatch
was replaced by jump table in bug 1171842, so the boilerplate went away.
However, in bug 1122781 (before bug 1171842), boilerplate for dependency
check, so it still needs to be generated.
The dependency table is removed in the previous patch, so we no longer
have any boilerplate in the style struct list, and thus it doesn't need
to be generated anymore.
MozReview-Commit-ID: GkbJZ98ojbE
--HG--
extra : rebase_source : a148b97c051bb6c88846cf6ba617c4edef70ca24
extra : source : f1c7d19cde195fb90ac2627d16ed69d020de01b9
The path service was created to allow us to track resources that were part of
legacy add-ons, and to map URIs ponting to those resources to add-on IDs, so
that we could apply special behavior to them.
We have better ways to track resources belonging to WebExtensions, so this
code does not benefit them in any significant way.
The only remaining legacy extensions are system add-ons, which we control, and
do not need the path service in order to track.
MozReview-Commit-ID: BKXkcaM7jJx
--HG--
extra : rebase_source : c8cb0f7cec919b767bbcfe5433a6838523747676
A ghost window is a window that is:
a) detached
b) we think it should have gone away
c) it has been in that state for a while
Right now, criterion b holds if the detached window does not have the
same eTLD as any window that is not detached. However, this can cause
false positives when a page leaks a cross-origin iframe.
This patch changes criterion b to be that it holds if the window is
not in the same tab group as any non-detached window. This should
match better with the goal of ghost windows, which is to identify when
pages don't go away after their tab is closed.
MozReview-Commit-ID: GG8d0WkXDUt
--HG--
extra : rebase_source : a9464b91bf565e2fe46062b4ce3b591b10e38f25
This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.
MozReview-Commit-ID: 99648Lm46T5
This patch tweaks the REPORT_* macros to include the repetitive code that
updates aWindowTotalSizes.
--HG--
extra : rebase_source : dcc3fa12b102fd36e993ecec3cc8a170fbc84b7c
ServoStyleSetSizes now has two uses, one for the Stylist, and one for the UA
cache, and so the patch removes 'Stylist' from the field names.
Example output from about:memory:
> +----1,359,608 B (00.55%) -- layout
> | +----756,488 B (00.31%) -- style-sheet-cache [2]
> | +----393,968 B (00.16%) -- servo-ua-cache
> | | +--234,496 B (00.10%) -- element-and-pseudos-maps
> | | +---59,648 B (00.02%) -- revalidation-selectors
> | | +---58,320 B (00.02%) -- invalidation-map
> | | +---30,752 B (00.01%) -- other
> | | +---10,752 B (00.00%) -- precomputed-pseudos
MozReview-Commit-ID: 8oxuJO0ojp
--HG--
extra : rebase_source : 7d86216967259b71df7280261d025cc65bf00ba4
We already measure (in Rust code) the things hanging off it, but overlooked the
object itself. This patch adds measurement on the C++ side.
--HG--
extra : rebase_source : f7daf62b4ec43cdc95034ffcb2a3aca27d995ae3
This combines the GhostWindowsReporter with the nsWindowMemoryReporter. It has
the benefit of removing a reporter of a single value and also guarantees that
we use the latests ghost windows value that is calculated in
|nsWindowMemoryReporter::CollectReports| rather than a possibly cached value
from a previous run.
--HG--
extra : histedit_source : bef59afe7b79cae8050460ee1bdc4247daebc21f
Avoid hitting the rather slow effective TLD service by caching results when
mapping URLs to their base domains. In testing the cache ranged from a 1:1 to
a 3:1 hit:miss ratio.
--HG--
extra : histedit_source : 9692a36bb32474b6de0a8291ceb9af7a19d221ff
We already periodically calculate the ghost window amount after cycle
collection, this just uses a cached value of that for the distinguished amount.
This avoids the overhead of a recalculating the value when reporting telemetry.
--HG--
extra : histedit_source : 4ba3ee62fd2871a87970faca8a70b2284e83981d%2C9246ac39cea50c3bb0d1693d8e831c3b3ad33ad9
Example output from the Obama Wikipedia page:
> ├──2,315,600 B (01.16%) -- stylist
> │ ├──1,916,928 B (00.96%) ── invalidation-map
> │ ├────228,800 B (00.11%) ── rule-tree
> │ ├────142,336 B (00.07%) ── element-and-pseudos-maps
> │ ├─────14,336 B (00.01%) ── revalidation-selectors
> │ ├──────9,648 B (00.00%) ── other
> │ └──────3,552 B (00.00%) ── precomputed-pseudos
This change requires new code to measure HashMaps, which uses the new
'malloc_enclosing_size_of' functions that can measure a heap block from an
interior pointer.
The patch changes MallocSizeOfFn to a newtype, and introduces
MallocEnclosingSizeOfFn alongside.
It also adds new traits: MallocSizeOfBox, MallocSizeOfVec, MallocSizeOfHash.
These each contain a single method that does shallow measurement of the
relevant type, which is often useful. (This is a different style to the
existing MallocSizeOf trait, which does deep measurement, but I'm moving away
from the always-deep-measurement style because it's less flexible.)
MozReview-Commit-ID: FgJCCmdw0ZF
--HG--
extra : rebase_source : c692c2073aa66020224489b97247c49de95a99a4
This patch splits up the existing "layout/style-sets" measurement into
"layout/gecko-style-sets", or "layout/servo-style-sets/stylist/rule-tree" and
"layout/servo-style-sets/other". (Additional things will be measured under
"layout/servo-style-sets/" later, such as cascade data.)
This requires introducing a new type, ServoStyleSetSizes, for transferring the
multiple measurements from Rust code to C++ code.
MozReview-Commit-ID: FbmzpsjBpgI
--HG--
extra : rebase_source : f2d1441705139e6674d355792255302fcd89f748
A lot of this involves copy-pasting the existing Servo style structs code.
Note that nsArenaSizes had to be moved after nsStyleSizes, because the former
now contains an instance of the latter.
MozReview-Commit-ID: 3hrkobxbX9b
--HG--
extra : rebase_source : f6b29bd7cb9bd60f2da65f5f907e161299333287
Another plumbing-only change, which is a precursor for the next patch.
ComputedValues are a Servo-only thing, so in order to use nsStyleSizes for both
Gecko and Servo, the ComputedValues sizes must be moved out.
MozReview-Commit-ID: BOnQSzzV0vC
--HG--
extra : rebase_source : 025c6161e509401a36525349083dd98bfda35621
Memory reporting was recently added for these DOM performance objects, but we
failed to report the "window-objects/" totals for the entire process. This
patch adds that.
MozReview-Commit-ID: 41ZcPC3seFc
--HG--
extra : rebase_source : fb4ed30ba3312e2c3fb5e1f9b186726c5ec2cd0f
This patch just moves code around, so that the reporting is done in the same
order that the nsWindowSizes fields are declared. This makes it easier to see
whether anything has been missed.
(I'd like to use macros to generate this repetitive code instead of writing it
by hand, but that's a task for later.)
MozReview-Commit-ID: Eu9Y078VNp
--HG--
extra : rebase_source : 95f31034a39c1057115ec4ea825ea33a774d5388