When we turn on the pref security.data_uri.unique_opaque_origin to make
data URI is unique origin, the following tests will fail because now
data document is treated as cross origin, so we replace data URIs with
seperate files, hence it will still in the same origin.
Reading the extension permissions DB at startup takes several hundred
milliseconds, largely from the overhead of initializing OS.File. We can avoid
that somewhat by using the stream APIs to read the files, and beginning the
read very early. But the eager initialization gets complicated, and we still
add extra IO to startup.
After this change, the permissions JSON file still remains the primary source
of truth, but the state as of the last session is cached in the volatile
extension startup cache to decrease the overhead of reading it at startup.
MozReview-Commit-ID: HGDt5kSsdzX
--HG--
extra : rebase_source : 511b9a03619f70c3e601a5e1b5985bf3d5efa21f
For unpacked extensions, loading the locales list adds an appreciable delay to
startup time. For packed extension, the overhead is much lower, but still best
avoided.
MozReview-Commit-ID: 6kicOU78fpZ
--HG--
extra : rebase_source : fe88cdd42071c5b7a883b2cad97679381aa5c074
IndexedDB helped where we needed to decrease main thread CPU, but it also took
so long to inialize during startup (over 500ms on a fast machine) that it
delayed extension startup more than was acceptable.
Using a structured clone flat file solves the same issues that IndexedDB did,
but with much less startup overhead.
MozReview-Commit-ID: 1Of7uxKCfkg
--HG--
extra : rebase_source : f2f7f9f852d40d547d43da4804a6bb7be00fdded
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.
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.
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.
ScrollFrameHelper::DecideScrollableLayer doesn't get the actual value of usingDisplayPort/wasUsingDisplayPort if we are not painting to the window. It then sets mWillBuildScrollableLayer to usingDisplayPort. mWillBuildScrollableLayer is the value that determines if we are active and hence an ASR, we don't want to change that between paint display lists for an event handling display list.
We then want to condition uses of mWillBuildScrollableLayer and the return value of DecideScrollableLayer on if we want painting to the window so we get the same behaviour as before when not painting to the window.
We should not let the ppm to do work before the first paint in a new cp. This patch
makes sure that we only let the ppm spawn a new process after the last process reached
an idle state AND the main process becomes idle too.