nsIContentIterator::Init() takes nsRange but it's too expensive for some users.
So, there should be another Init() which can be specified a range in DOM tree
with 2 pairs of nsINode* and uint32_t.
MozReview-Commit-ID: 6JXic0KOM2d
--HG--
extra : rebase_source : 28ff355a2aa0dcb5d65495806ef8c67f1da642ea
Sometimes, test receive pings that should not be there. This happens because
Telemetry is initialized multiple times by some tests: this patch fixes
one test and moves another flaky test to a separate file. Additionally,
add useful debug information to the logs to understand which ping made
the test fail.
MozReview-Commit-ID: BS25U3e9fxO
--HG--
extra : rebase_source : 697142688c9562c4c64c7a81908d9360fc4d04f4
nsDocument::mTiming can be nullptr when the document is still loading, so we
should not record ready state probes in nsDOMNavigationTiming.
Also stops recording probes from parent process because we only need data from
real web contents.
MozReview-Commit-ID: 8XUHC8yKobO
--HG--
extra : rebase_source : 2227ba85d55496f2e8dfa4aa91d8f9f966684c6f
Like part a, but for `choices` messages rather than error messages.
MozReview-Commit-ID: 7dJ0NL2fUh5
--HG--
extra : rebase_source : 477f1364c0904bde78d54eae083bdb8e49ee5732
extra : histedit_source : 38c336b3a59481b6f2523798367159fb757c6485
For choices types, when one choice fails, we don't need the original error
string, since another choice may succeed, and we generate the final error
based on all of the options. Nevertheless, we spend a lot of time generating
JSON strings for the failed inputs in those cases, which adds up to about 12%
of the remaining overhead at this point.
MozReview-Commit-ID: 6nXBAv2W20V
--HG--
extra : rebase_source : 5894bc4b9e8d64ac9505f27240ea4fabfcb5f02f
extra : histedit_source : 0e8b5e0315abd672a57a60420453a1e0681c9df6
The Array and ArrayBuffer type checks we do in getBaseType add up to a
significant amount of overhead given the number of times we call them,
especially when X-ray overhead comes into play. These changes allow us to
avoid X-ray overhead altogether.
MozReview-Commit-ID: KlRuxeElIfp
--HG--
extra : rebase_source : c7f00fb8c35965476e7c7b888b6af36714c1323f
extra : histedit_source : fc559e665e60e9bbb688eebe6c6e6da5dacec748
This prevents naming conflicts if a paused or blocked download is retried from the original page.
MozReview-Commit-ID: 4rFZ5rP8saJ
--HG--
extra : rebase_source : c392fc62cb33b2c2d70a1c3a8a975ddf93d394ea
We would like to be able to see if a given hang in BHR occurred
under high CPU load, as this is an indication that the hang is
of less use to us, since it's likely that the external CPU use
is more responsible for it.
The way this works is fairly simple. We get the system CPU usage
on a scale from 0 to 1, and we get the current process's CPU
usage, also on a scale from 0 to 1, and we subtract the latter
from the former. We then compare this value to a threshold, which
is 1 - (1 / p), where p is the number of (virtual) cores on the
machine. This threshold might need to be tuned, so that we
require an entire physical core in order to not annotate the hang,
but for now it seemed the most reasonable line in the sand.
I should note that this considers CPU usage in child or parent
processes as external. While we are responsible for that CPU usage,
it still indicates that the stack we receive from BHR is of little
value to us, since the source of the actual hang is external to
that stack.
MozReview-Commit-ID: JkG53zq1MdY
--HG--
extra : rebase_source : 8ab1bddb8274a074547886ce027df2d7d2b35fe5
Version 4 of the Google Safe Browsing server will return a 404 if any of the
application reputation lists are requested on Android. As a result, we should
avoid these threat types from being sent along with ANDROID_PLATFORM.
MozReview-Commit-ID: 6TUBVxe455y
--HG--
extra : rebase_source : dee095c008f4d328f359c66d20f0cc2dfcd109f3
extra : source : 5d6338807c6b21b7672236cac01b13bd75155225
The FrameLoaderOwner interface has been implemented in WebIDL for several
years now, so these QIs are simply unnecessary overhead.
MozReview-Commit-ID: LAzvfm5Qhy0
--HG--
extra : rebase_source : 2495c07df21c474f5fabc257ff4db43b0d8047e4
In chrome process, we often know which url is going to be loaded.
As a performance optimization, we can start initiating network
connection before sending out the 'LoadURI' message to the content
process.
MozReview-Commit-ID: L79ylHOaxX8
--HG--
extra : rebase_source : cc3aeefedde21dc8eaaf37c67710980b0204f4dc
This is straightforward, with only two notable things.
- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
throughout, because all nsXPIDLString.h did was include nsString.h. The
exception is for files which already include nsString.h, in which case the
patch just removes the nsXPIDLString.h inclusion.
- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
cover some of its ground, e.g. testing Adopt(nullptr).
--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.
--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
This patch is mainly to add a probe to measure sw launch time. To do this, this
patch records the sw launch time when the sw is just spwaned and it's ready to
handle the incoming fetch event.
MozReview-Commit-ID: 3w5MNyhQNnd
--HG--
extra : rebase_source : 3228213d0ea6be1d23b9c49382f1f8d3c2f358f1
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is null checked. The patch uses IsVoid() to replace
the null checks (and get() and EqualsLiteral() calls to replace any implicit
conversions).
--HG--
extra : rebase_source : 484ad42a7816b34b86afbe072e04ba131c1619c6
On very fast builds (OPT, PGO) this test can fail intermittently because the time it takes to send a ping and receive a reply is 0. Account for that by replacing all the "greater than" checks with "greater or equal than".
MozReview-Commit-ID: JvEo2rCbJj6
--HG--
extra : rebase_source : 17ea1ccf2e0a69c98eaaa64ef94db29983b21591
The base Extension class now handles adding shutdown blockers and waiting for
extension startup before beginning shutdown, so the redundant logic only
causes problems.
MozReview-Commit-ID: 2gBWlmIs1KQ
--HG--
extra : rebase_source : 404174754735b8477abf6f13d312bc6b3aebdb83
This may or may not fix the intermittent, but hopefully it will.
MozReview-Commit-ID: BR0BtV4BPdq
--HG--
extra : rebase_source : 017933bd5f53e1e3ea6c082e2240519b25168255
The existing functions work with C strings but almost all the call sites use
Mozilla strings.
The replacement function has the following properties.
- It works with Mozilla strings, which makes it much simpler and also improves
the call sites.
- It appends to the destination string because that's what a lot of the call
sites need. For those that don't, we can just append to an empty string.
- It is declared outside the |extern "C"| section because there is no need for
it to be in that section.
Note: there is no 16-bit variant of nsAppendEscapedHTML(). This is because
there are only two places that need 16-bit variants, both rarely executed,
and so converting to and from 8-bit is good enough.
The patch also adds some testing of the new function, renaming
TestEscapeURL.cpp as TestEscape.cpp in the process, because that file is now
testing other kinds of escaping.
--HG--
rename : xpcom/tests/gtest/TestEscapeURL.cpp => xpcom/tests/gtest/TestEscape.cpp
extra : rebase_source : 51145ae2c9b0b4573c7ea0c342dcb246f9f14fb9
It turns out that stringifying a paths object is much cheaper than normalizing
it, and has the added benefit of allowing us to use cached CSS text for the
result.
MozReview-Commit-ID: 5gIqcDmPiKr
--HG--
extra : rebase_source : 59f6a75eac976abb85fe37440469e589282f7b01
We already do this check at the schema level, so the added check in
IconDetails is unnecessary.
MozReview-Commit-ID: JTEE0xWH0a4
--HG--
extra : rebase_source : baad0a75438cdf126e0ba8df4055be50f3281d2a
Lots of little bits of overhead add up to a significant amount of overhead
over the many, many times this function is called.
MozReview-Commit-ID: BYTWxqc8rH9
--HG--
extra : rebase_source : 3b22f9ca1de504a383eef5760e43dc783c2b3b93
There is no longer any file in components/extensions/ext-* that use require().
Therefore it should be ok to stop exposing it.
MozReview-Commit-ID: EgZYBludlcy
--HG--
extra : source : 50a36fb7c7f97682ea9d2651b0edec306d466b5c
extra : amend_source : af2184bbf188df138b3a2b23d7031b2de5534e25
In chrome process, we often know which url is going to be loaded.
As a performance optimization, we can start initiating network
connection before sending out the 'LoadURI' message to the content
process.
MozReview-Commit-ID: CtTik19NyiM
--HG--
extra : rebase_source : 91801215efa8fbb50f51e79eabc6435472d23622
There is no longer any file in components/extensions/ext-* that use require().
Therefore it should be ok to stop exposing it.
MozReview-Commit-ID: EgZYBludlcy
--HG--
extra : rebase_source : f83d8bf4bb413c246efe3c25767cc203f127423e
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).
In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
checkLoadURIStrWithPrincipal runs URLs through the URI fixup services and
checks against each of the results. This is both expensive and unnecessary for
our purposes.
MozReview-Commit-ID: 4L2Z4KuMZhQ
--HG--
extra : rebase_source : 9b72c8e4c6b0a48541b94871f507ce029be664c7
extra : amend_source : d20b032a6ddf9b9804a14e528094bc6867d5b728
- This patch was written in 3 interdependent parts, which are described below -
Part 1A: Allow HangStack to contain raw PCs and Module offsets, r=froydnj
The HangStack previously consisted of an array of const char* pointers into its
backing string buffer, which represented pseudostack entries. With interleaved
stacks, it is now possible for the stack to contain raw unresolved program
counters (Kind::PC), and module/offset pairs (Kind::MODOFFSET). To do this, we
use a discriminated union, and make the backing array use the discriminated
union instead of const char*s.
The code cannot use mozilla::Variant<const char*, uintptr_t, Module>
unfortuantely, as we cannot use the implementation of ParamTraits for Variant in
HangStack's ParamTraits implementation.
When deserializing a HangStack over IPC, we need to read the string frame
entries into the backing string buffer, and generate const char* entries for
each of the strings which we read in over IPC. The default implementation of
ParamTraits wouldn't give us access to the enclusing HangStack object while
deserializing each individual entry, so we couldn't use it. In fact, Entries
don't have ParamTraits implemented for them at all, and can only be sent over
IPC as part of a HangStack due to this dependency.
Part 1B: Remove nsIHangDetails.pseudoStack, replace ProcessedStack w/ new HangStack type, r=froydnj
Previously there were two stack objects on each HangDetails object: mStack and
mPseudoStack. mStack was a Telemetry::ProcessedStack, while mPseudoStack was a
HangStack. After the changes in part 1A, HangStack can now contain all of the
information of both the old HangStack and ProcessedStack, so the mPseudoStack
field is renamed to mStack, and the old mStack field is removed.
This patch also implements the new GetStack getter, which generates the JS data
format for the new HangStack type.
Part 1C: Collect interleaved stacks w/ ProfilerStackCollector API in ThreadStackHelper, r=froydnj
This new API was added by njn in bug 1380286, and provides both pseudostack and
native stack entries to the consumer of the API.
This patch changes ThreadStackHelper to use this new API instead of the previous
one, and use it to collect the frames directly into HangStack objects.