Many revisions later... this is my best shoehorning attempt of webrtc's trace
events into the profiler.
It is not an optimal fit as the profiler wants a static schema, and the trace
event framework provides labels and values for the args dynamically.
But it allows displaying all args in the profiler which is a big step for
low-maintenance webrtc trace event integration into the profiler.
Differential Revision: https://phabricator.services.mozilla.com/D135031
This patch adds a part of TraceEvent.h that we had previously skipped. It
handles the conversion from the arg-ful TRACE_EVENTn forms to the internal
representation which carries around a dynamic number of args (num_args and
friends).
This allows us to hook into GeckoTraceEvent.h at a higher level, where all trace
events end up, with or without args.
Differential Revision: https://phabricator.services.mozilla.com/D135029
I'm gonna guess there was no existing use of the tuple
serialization/deserialization code, because `Bytes` doesn't exist in the
deserializer, and cannot possibly function properly on tuple members that
serialize to a non-constant size, since it's called on a default-constructed
tuple.
This patch took inspiration in the deserializer for Variant and seems to work
fine.
Differential Revision: https://phabricator.services.mozilla.com/D135028
The Runnable markers in the profilers are handy, but miss many types of
runnables. This includes most of those that wrap another runnable and run that
at a (possibly) later time.
AbstractThread, TaskDispatcher and TaskQueue does this for e.g. tail dispatched
tasks.
TaskQueueWrapper does this when wrapping webrtc tasks (and Mozilla Runnables) to
be run in a Mozilla TaskQueue with some overhead on the stack.
DelayedRunnable wraps a runnable to be run after a timeout.
It would perhaps be better in many cases to ignore the intermediate runnables,
but I haven't seen a straight forward way to achieve this.
More detailed data could be added on a case by case basis, for instance the
delay for a DelayedRunnable (incl. actual vs. target delay) or the scope of a
task in which a tail-dispatched runnable was dispatched. But this is also true
for the status quo (for instance the time from dispatch to run) so I leave these
ideas as future work.
Differential Revision: https://phabricator.services.mozilla.com/D135027
There's a race condition where the page navigation caused by swipe gestures has
already stopped when the promise for the pan gestures was resolved.
Differential Revision: https://phabricator.services.mozilla.com/D134638
Calling NSS_IsInitialized() off the main thread caused intermittent tsan failures because NSS_IsInitialized() reads global variable nssIsInitted without acquiring the nssInitLock lock.
During Firefox startup, about 1000 nsIDs are generated, but only about 10 are generated off the main thread, so this change has very little impact on how often nsID::GenerateUUID() will use NSS's RNG. Of the nsIDs generated on the main thread during startup, about 600 are generated before NSS is initialized (so they use MFBT's RNG) and 400 are generated after NSS is initialized.
After Firefox reaches a steady state, loading a light web page like google.com generates about 300 nsIDs and a heavy web page like cnn.com generates about 2000 nsIDs. All these nsIDs are generated on the main thread using NSS's RNG.
Differential Revision: https://phabricator.services.mozilla.com/D134233
Currently, using any of the functions defined in
`ConfigureSandbox.OS.path` in a `@depends` function will have a different
behavior if the function has an `@imports("os")` or not. In the former
case, we get plain `os.path.$function`, while in the latter we get the
function from `ConfigureSandbox.OS.path`, which handles path separators
differently, which makes a significant difference on Windows.
With this change, we now consistently use the versions from
`ConfigureSandbox.OS.path`.
Differential Revision: https://phabricator.services.mozilla.com/D135003
The problem for detached tabs is that the new window's delayed startup is not
finished when we try to format the value, so we bail. Fortunately there's a
promise we can await instead of bailing, `delayedStartupPromise`.
Differential Revision: https://phabricator.services.mozilla.com/D135000
The VS backend is always built when building on Windows for Windows, so
in practice, the message isn't printed... except when cross-compiling on
Windows, in which case the VS backend doesn't work.
Differential Revision: https://phabricator.services.mozilla.com/D135015
The compiler might already be smart enough to not generate code in an
if-statement that guarantees to be `false` at compile time. However it's no harm
to make it explicit by using `if constexpr`.
Differential Revision: https://phabricator.services.mozilla.com/D135017
Currently, using any of the functions defined in
`ConfigureSandbox.OS.path` in a `@depends` function will have a different
behavior if the function has an `@imports("os")` or not. In the former
case, we get plain `os.path.$function`, while in the latter we get the
function from `ConfigureSandbox.OS.path`, which handles path separators
differently, which makes a significant difference on Windows.
With this change, we now consistently use the versions from
`ConfigureSandbox.OS.path`.
Differential Revision: https://phabricator.services.mozilla.com/D135003
pkgconf is an alternative implementation of pkg-config that is more
cross-platform. It has also become the default on Fedora, so it's not
some random project.
Differential Revision: https://phabricator.services.mozilla.com/D135009
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8
This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:
- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
to a new mochitest at test_ext_runtime_connect_iframe.html.
- Simplify test_ext_contentscript_in_background.js to continue to
provide test coverage for contentScripts.register + allFrames.
- Replace runtime.onConnect with runtime.getFrameId in
test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
longer available in xpcshell tests (because internals to support the
tabs extension API are not available in xpcshell tests). The test
cannot be moved to a mochitest because its purpose is to provide test
coverage for process switching in a xpcshell test (bug 1580811).
Differential Revision: https://phabricator.services.mozilla.com/D135057