Граф коммитов

21305 Коммитов

Автор SHA1 Сообщение Дата
Toshihito Kikuchi 37bb76635c Bug 1701368 - Part6: Tab unloading precedes memory pressure events. r=gsvelto
This is the main part to address bug 1701368.

Before this patch, `nsAvailableMemoryWatcher` directly broadcasted a memory-pressure
event when we enter into a low-memory situation and `TabUnloader` unloaded a tab in
response to the memory-pressure message.  We want to decouple `TabUnloader` from
memory-pressure listeners because unloading a tab may solve a low-memory situation
alone.

With this patch, if `nsAvailableMemoryWatcher` detects a low-memory situation,
it invokes `TabUnloader` synchronously via an XPCOM interface.  If `TabUnloader`
unloads a tab, we don't do any further action.  If there is no discardable tab,
`TabUnloader` notifies back `nsAvailableMemoryWatcher` via another XPCOM interface,
so that `nsAvailableMemoryWatcher` can notify of a memory-pressure event.

Differential Revision: https://phabricator.services.mozilla.com/D117673
2021-07-06 18:59:10 +00:00
Toshihito Kikuchi 42a8a18b8f Bug 1701368 - Part5: Convert nsAvailableMemoryWatcher to an XPCOM object. r=gsvelto
This patch introduces an XPCOM object which is represented by the single instance of
`nsAvailableMemoryWatcherBase` so that `nsAvailableMemoryWatcher` can synchronously
access `TabUnloader`.

We currently implement a watcher class for Windows only.  For other platforms, what
we need to do is to define a class inherinting `nsAvailableMemoryWatcherBase` and
a simple factory method `CreateAvailableMemoryWatcher()` returning an instance of
that class.

Differential Revision: https://phabricator.services.mozilla.com/D118393
2021-07-06 18:59:09 +00:00
Toshihito Kikuchi 8388201ef2 Bug 1701368 - Part4: Make the nsAvailableMemoryWatcher timer commit-space driven. r=gsvelto
This patch removes dependency on the available physical memory.
With this patch, `nsAvailableMemoryWatcher` triggers `OnLowMemory` when the available
commit space is low, and triggers `OnHighMemory` when the available commit space is
no longer low.

The key part of this change is the `if` block in `nsAvailableMemoryWatcher::Notify`,
where we use a single condition `IsCommitSpaceLow()` to declare either Low or High.

After this change, `OnLowMemory` is called not only in the main thread but also in
a worker thread.  So `StartPollingIfUserInteracting` also needs a lock to protect
`mPolling`.

Differential Revision: https://phabricator.services.mozilla.com/D117672
2021-07-06 18:59:09 +00:00
Toshihito Kikuchi 238b1bf932 Bug 1701368 - Part3: Remove the MemPressure_Ongoing request. r=gsvelto
We had `NS_DispatchMemoryPressure` and `NS_DispatchEventualMemoryPressure`
to dispatch a memory-pressure event which took `MemPressure_New` and
`MemPressure_Ongoing` to translate into "low-memory" and "low-memory-ongoing"
message respectively.

With that model, we could end up sending a wrong message if somebody
called the API with `MemPressure_Ongoing` without sending `MemPressure_New`.
To avoid that, this patch removes `MemPressure_Ongoing` and makes
the API decide whether it should dispatch a "new" event or "ongoing" event.

Differential Revision: https://phabricator.services.mozilla.com/D119122
2021-07-06 18:59:08 +00:00
Toshihito Kikuchi 9f5d899015 Bug 1701368 - Part2: Clean up nsAvailableMemoryWatcher. r=gsvelto
1. Use `nsAutoHandle` instead of a raw `HANDLE`
2. Add a dtor with `MOZ_ASSERT`
3. Prevent double init
4. Cache `nsAvailableMemoryWatcher::mObserverSvc`

Differential Revision: https://phabricator.services.mozilla.com/D117670
2021-07-06 18:59:08 +00:00
Toshihito Kikuchi 9dd46ef933 Bug 1701368 - Part1: Extract nsAvailableMemoryWatcher as AvailableMemoryWatcherWin.cpp. r=gsvelto
This patch splits `nsAvailableMemoryWatcher` into 1) an nsISupports-derived class
`nsAvailableMemoryWatcherBase` and 2) a platform-specific class `nsAvailableMemoryWatcher`,
taking out the 2) part as a new file AvailableMemoryWatcherWin.cpp without any change.

Test cases for `nsAvailableMemoryWatcher` will be added by a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D117669
2021-07-06 18:59:07 +00:00
Jeff Muizelaar c8d65b5b73 Bug 1718262 - Remove duplicated declaration of NS_GetCurrentThread. r=mccr8
The other definition is in nsThreadUtils.h

Differential Revision: https://phabricator.services.mozilla.com/D118831
2021-06-25 18:35:09 +00:00
Florian Quèze cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Jeff Muizelaar 8a78449866 Bug 1718154 - Remove unneeded MOZILLA_INTERNAL_API from nsThreadUtils.cpp. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D118771
2021-06-25 03:06:35 +00:00
Toshihito Kikuchi b293d8345b Bug 1718074 - Early return from the callback when the object was shut down. r=gsvelto
`nsAvailableMemoryWatcher::mTimer` was nullptr when `LowMemoryCallback()` tried to
initialize a timer via `OnLowMemory()`.  There are two possible reasons.

The first case is that NS_NewTimer() returned nullptr because the available memory was
already low when initializing `nsAvailableMemoryWatcher`.  In this case, we should not
register the callback.

The second case is the low-memory callback was queued while shutting down
`nsAvailableMemoryWatcher` (just before we unregiter the callback).  We do refcount
the object and use the mutex correctly, but we touch the nulled out member.  We should
make an early return if the object was shut down.

Differential Revision: https://phabricator.services.mozilla.com/D118745
2021-06-24 19:31:29 +00:00
Jon Coppeard 6e8963d230 Bug 1717204 - Increase the number of threads used by the XPCOM thread pool to match the number of cores r=bas
Currently the XPCOM thead pool creates one less thread than the number of
cores. The JS helper thread pool creates an equal number.

I tested increasing the number of threads to match the number of cores and
found it resolved this regression.

Differential Revision: https://phabricator.services.mozilla.com/D118327
2021-06-23 14:09:18 +00:00
Nika Layzell 5731c1747c Bug 1717526 - String's implicit conversion operator causes COW relocations, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D118430
2021-06-23 01:57:00 +00:00
Alexandru Michis e3d24b013a Backed out changeset 3beb01f5d643 (bug 1717526) for causing gtest failures in SpanTest.from_xpcom_collections
CLOSED TREE
2021-06-23 01:58:49 +03:00
Nika Layzell c14de7eabc Bug 1717526 - String's implicit conversion operator causes COW relocations, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D118430
2021-06-22 21:18:03 +00:00
Nika Layzell eaa7724180 Bug 1714226 - Return the number of removed elements from nsTArray::RemoveElementsBy, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D116664
2021-06-22 18:17:17 +00:00
Kris Maglione cd43e30d8b Bug 1714112: Add new Fission decision value for phased rollout enablement. r=nika,fluent-reviewers,flod
This should be less confusing to users, and makes it easier to triage
about:support data.

Differential Revision: https://phabricator.services.mozilla.com/D118416
2021-06-22 17:28:34 +00:00
Butkovits Atila 83f57b5c69 Backed out 22 changesets (bug 1714226, bug 1706374, bug 1713148) for causing build bustages on MessageChannel.cpp. CLOSED TREE
Backed out changeset ea469eaa54ca (bug 1713148)
Backed out changeset fd8523d5126e (bug 1713148)
Backed out changeset f2e5309c914c (bug 1713148)
Backed out changeset 2da57973ed55 (bug 1713148)
Backed out changeset 677e1ee99bb2 (bug 1713148)
Backed out changeset b4c0619e79bf (bug 1706374)
Backed out changeset c02fa459e77d (bug 1706374)
Backed out changeset 72dc6537cf0b (bug 1706374)
Backed out changeset 48088463c656 (bug 1706374)
Backed out changeset b09ae4c3a94b (bug 1706374)
Backed out changeset 04422175004b (bug 1706374)
Backed out changeset 110b2384e7d1 (bug 1706374)
Backed out changeset ab2b086abbd4 (bug 1706374)
Backed out changeset ffde07f73249 (bug 1706374)
Backed out changeset c6303af17ff4 (bug 1706374)
Backed out changeset 02249671c2f9 (bug 1706374)
Backed out changeset a6a5d05b5636 (bug 1706374)
Backed out changeset e21b6defb805 (bug 1706374)
Backed out changeset c72c5be9ddb1 (bug 1706374)
Backed out changeset 23cd961575a6 (bug 1706374)
Backed out changeset b412d6e9e145 (bug 1706374)
Backed out changeset a8ec285d6472 (bug 1714226)
2021-06-22 04:03:56 +03:00
Nika Layzell 55b81f9748 Bug 1714226 - Return the number of removed elements from nsTArray::RemoveElementsBy, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D116664
2021-06-21 21:53:05 +00:00
R Aravind 4e0ddca83e Bug 1713525 - removed 'else' after 'return'. r=gerald
- added 'return true' for non null stream
- removed 'else' and 'return stream != nullptr'

Differential Revision: https://phabricator.services.mozilla.com/D118289
2021-06-21 15:33:01 +00:00
Andrew Osmond 98f810e4e4 Bug 1715515 - Part 1. Switch Windows 32 and mingwclang tests to WebRender. r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D117287
2021-06-21 12:46:32 +00:00
Brindusan Cristian 97b71ee13f Backed out 2 changesets (bug 1715515) for breaking the decision task.
CLOSED TREE

Backed out changeset 2e674ac39f8f (bug 1715515)
Backed out changeset 39580a1b4188 (bug 1715515)
2021-06-18 03:20:07 +03:00
Andrew Osmond be550ad9c9 Bug 1715515 - Part 1. Switch Windows 32 and mingwclang tests to WebRender. r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D117287
2021-06-17 23:53:39 +00:00
Jon Coppeard c69960a99b Bug 1716940 - Increase TaskController thread stack size r=bas
This increases the stack size used for task controller threads to the size
previously used for JS helper threads. Some parsing use cases can use a lot of
stack.

Differential Revision: https://phabricator.services.mozilla.com/D118184
2021-06-17 16:14:20 +00:00
Jon Coppeard b4a00f01a6 Bug 1716940 - Pass external thread stack size through to the JS engine r=sfink,bas
This adds plumbing to make the JS engine set the stack quota based on the
actual stack size for external thread pool threads (and internal thread pool
ones).

The quota is calculated as 90% of the size, which is currently hardcoded into
the constants.

Differential Revision: https://phabricator.services.mozilla.com/D118183
2021-06-17 16:14:19 +00:00
kriswright 058d3e6e68 Bug 1683404 - Wrap the timer thread behind a mutex. r=nika
This particular race is a tricky one - there's no perfect solution to protecting the timer thread from being called in `cancel` while being dereferenced. This ensures that we won't run into that problem by locking all of our TimerThread calls behind a mutex inside a wrapper class. Then we hold onto the wrapper class until after we shutdown `nsThreadManager`, in which case no background thread pools should be active anymore to call `nsTimerImpl::Cancel`.

For reference, the worst-case scenario happens when another thread dereferences `gThread` [between these two calls](https://searchfox.org/mozilla-central/rev/98a9257ca2847fad9a19631ac76199474516b31e/xpcom/threads/nsTimerImpl.cpp#402-403), in which case we will get stuck on a dereferenced mutex. By putting the check and the actual call into `gThread` behind a mutex maybe we can prevent this issue.

Differential Revision: https://phabricator.services.mozilla.com/D115453
2021-06-17 15:36:00 +00:00
Florian Quèze dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00
Iulian Moraru b02492de66 Backed out changeset 617a466d0cce (bug 1715257) for causing build bustages. CLOSED TREE 2021-06-17 10:58:16 +03:00
Florian Quèze 7b4906a6bd Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 06:12:10 +00:00
Sean Feng eb8464f241 Bug 1632733 - Always use InputTaskManager for InputHigh tasks regardless InputEventQueueState r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D118028
2021-06-16 19:54:37 +00:00
Aaron Klotz e46f2fb521 Bug 1716036: Use StaticLocalAutoPtr for magic statics in nsThread; r=KrisWright
The "magic static" objects created in `nsThread::ThreadList` and
`nsThread::ThreadListMutex` have non-trivial destructors, so they end up
setting `atexit` hooks.

I'd like to switch these over to be `StaticLocalAutoPtr`s which were added
specifically for the purpose of holding magic statics, and have trivial
destructors.

Differential Revision: https://phabricator.services.mozilla.com/D117549
2021-06-14 21:40:07 +00:00
Mats Palmgren e4d7dd995a Bug 1542807 part 3 - Add some style quirks for legacy ::markers created from list-style-type/list-style-image. r=emilio
Specifically:
For "bullets", i.e. 'list-style-type:disc|circle|square|
disclosure-closed|disclosure-open', we use a built-in font
(-moz-bullet-font, which has glyphs for those symbols + space) to
retain mostly backwards compatible rendering for those.  Authors may
override that with an explicit 'font-family' ::marker style though.
We also use this font for 'list-style-image' in case it would
fallback to one of the above when the image fails to load (so that
we get the same width space).

When the -moz-bullet-font is used we also set 'font-synthesis' to
avoid synthesizing italic/bold for this font. Authors may override
this with an explicit ::marker declaration.

We also set 'letter-spacing' and 'word-spacing' to the initial value
for bullets for web-compat reasons.  Again, authors may override
this with an explicit ::marker declaration. (This breaks backwards-
compat slightly but makes us compatible with Chrome.  We used to
ignore these for list-style-type:<string> too.)

Differential Revision: https://phabricator.services.mozilla.com/D111693
2021-06-14 01:22:06 +00:00
Gabriele Svelto 0c7c411099 Bug 1715026 - Properly transfer ownership of the memory pressure watcher to the memory resource callback r=tkikuchi
Differential Revision: https://phabricator.services.mozilla.com/D117051
2021-06-12 05:54:01 +00:00
Butkovits Atila ed3da455ae Backed out 7 changesets (bug 1542807) for causing failures at inert-retargeting-iframe.tentative.html. CLOSED TREE
Backed out changeset e9ef32fa2f2e (bug 1542807)
Backed out changeset 8fa0cb199975 (bug 1542807)
Backed out changeset 38daf64afe59 (bug 1542807)
Backed out changeset e3aee052c495 (bug 1542807)
Backed out changeset a71056d4c7cc (bug 1542807)
Backed out changeset cf91e7d0a37f (bug 1542807)
Backed out changeset eee949e5fd67 (bug 1542807)
2021-06-12 01:38:25 +03:00
Michelle Goossens e4e6b27045 Bug 1714349 - Remove browser.proton.modals.enabled pref r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D116903
2021-06-11 18:14:26 +00:00
Mats Palmgren 0372796619 Bug 1542807 part 3 - Add some style quirks for legacy ::markers created from list-style-type/list-style-image. r=emilio
Specifically:
For "bullets", i.e. 'list-style-type:disc|circle|square|
disclosure-closed|disclosure-open', we use a built-in font
(-moz-bullet-font, which has glyphs for those symbols + space) to
retain mostly backwards compatible rendering for those.  Authors may
override that with an explicit 'font-family' ::marker style though.
We also use this font for 'list-style-image' in case it would
fallback to one of the above when the image fails to load (so that
we get the same width space).

When the -moz-bullet-font is used we also set 'font-synthesis' to
avoid synthesizing italic/bold for this font. Authors may override
this with an explicit ::marker declaration.

We also set 'letter-spacing' and 'word-spacing' to the initial value
for bullets for web-compat reasons.  Again, authors may override
this with an explicit ::marker declaration. (This breaks backwards-
compat slightly but makes us compatible with Chrome.  We used to
ignore these for list-style-type:<string> too.)

Differential Revision: https://phabricator.services.mozilla.com/D111693
2021-06-11 18:10:39 +00:00
Eitan Isaacson 349592fb91 Bug 1714390 - P6: Make more attribute keys static atoms. r=Jamie
Keys should be static atoms whenever possible.

Differential Revision: https://phabricator.services.mozilla.com/D116787
2021-06-10 23:07:07 +00:00
Eitan Isaacson 4fc2c36ea8 Bug 1714390 - P5: Use static aria_* atoms for aria attributes. r=Jamie
ATK, Windows and XPCOM expect aria attribute keys to be stripped of
their aria- prefix. We should still store the item using the aria_ atom
and then strip the prefix when converting the key to a string.

Differential Revision: https://phabricator.services.mozilla.com/D116786
2021-06-10 23:07:07 +00:00
Sean Feng e903455002 Bug 1708070 - Change InputVsyncState in InputPriorityController::WillRunTask r=smaug
Before this patch, we use InputPriorityController::DidRunTask to change
InputVsyncState which is problematic.

Consider this scenario
  1. Two events are in the queue, vsync(V1) and input(I1)
  2. I1 runs and starts an inner event loop (We only expect one input
     event to be run because there's only one input event)
  3. Another input event(I2) arrives
  4. Inner event loop picks I2 to run
  5. When I2 is finished, it sets the InputVsyncState to `RunVsync`
  6. I1's DidRunTask is called and crashed because the state shouldn't
     be `RunVsync`.

This patch moves the code which checks InputVsyncState from `DidRunTask`
to `WillRunTask` so that the state is correctly checked and updated
before the input task is about to run.

Differential Revision: https://phabricator.services.mozilla.com/D117336
2021-06-09 17:01:30 +00:00
Jon Coppeard 50c5254a22 Bug 1713287 - Change the number of threads TaskController creates to match those required by the JS engine r=bas
Currently parallel Wasm compilation requires at least two threads for
architectural reasons. This patch updates the TaskController thread policy such
that there are always two threads available, even on single core systems.

Differential Revision: https://phabricator.services.mozilla.com/D117002
2021-06-09 09:23:20 +00:00
Dorel Luca 816a6098d2 Backed out 3 changesets (bug 1714349) for Browser-chrome failures in browser/components/places/tests/browser/browser_addBookmarkForFrame.js. CLOSED TREE
Backed out changeset 598f8e7d73ef (bug 1714349)
Backed out changeset cc7365aacdbb (bug 1714349)
Backed out changeset f0f942a93495 (bug 1714349)
2021-06-09 04:48:41 +03:00
Michelle Goossens 6e11a4ab14 Bug 1714349 - Fix test failures on test_chrome_only_media_queries.html
Differential Revision: https://phabricator.services.mozilla.com/D117249
2021-06-09 00:02:38 +00:00
Andrey Bienkowski 888618300d Bug 1714376 - Replace a number of "exception.message" usages. r=mhentges,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D116723
2021-06-08 15:50:10 +00:00
Michelle Goossens 1895a736f3 Bug 1714352 - Remove browser.proton.doorhangers.enabled pref r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D117091
2021-06-08 00:41:43 +00:00
Brindusan Cristian 08feb9e246 Backed out changeset f9eb0924a327 (bug 1711398) for causing xpcshell failures in test_TelemetryLateWrites.js.
CLOSED TREE
2021-06-07 21:54:55 +03:00
Doug Thayer f2c9eecfd2 Bug 1711398 - Include JS stacks in late write data r=florian,gerald
This mirrors the BHR stack collection code, and uses some of its utilities,
such as the ThreadStackHelper class.

Differential Revision: https://phabricator.services.mozilla.com/D115215
2021-06-07 18:04:17 +00:00
Csoregi Natalia 0a9e50b29c Bug 1714561 - Fix black lint. r=fix CLOSED TREE 2021-06-07 18:52:35 +03:00
Jon Coppeard 97ba8e2712 Bug 1714561 - Add test that single-zone JS holders can contain a pointer into the atoms zone r=mccr8
Depends on D116848

Differential Revision: https://phabricator.services.mozilla.com/D116978
2021-06-07 15:19:30 +00:00
Jon Coppeard 39dcc0ea21 Bug 1714561 - Allow single-zone JS holders to contain pointers into the atoms zone r=mccr8,sfink
Differential Revision: https://phabricator.services.mozilla.com/D116848
2021-06-07 15:19:29 +00:00
Toshihito Kikuchi a2c93279d1 Bug 1713100 - Move AvailableMemoryTracker::Init() back to NS_InitXPCOM. r=gsvelto
Bug 1711610 moved `AvailableMemoryTracker::Init()` from `NS_InitXPCOM` to `XRE_mainRun`,
but it caused memory degradation because `AvailableMemoryTracker` was no longer initialized
in the child processes.

I made that part for `nsAvailableMemoryWatcher` to cache the pref value in the earlier design,
but it's not needed at all in the current design because `nsAvailableMemoryWatcher` loads
a mirror value every time.

This patch reverts `AvailableMemoryTracker::Init()` back to `NS_InitXPCOM`.

Differential Revision: https://phabricator.services.mozilla.com/D116742
2021-06-04 14:16:02 +00:00
Dorel Luca f021feb29f Backed out changeset 68f73772f51e (bug 1714376) for Xpcom failures in builds/worker/checkouts/gecko/xpcom/idl-parser/xpidl/runtests.py. CLOSED TREE 2021-06-04 02:19:33 +03:00
Andrey Bienkowski a7a4542e20 Bug 1714376 - Replace a number of "exception.message" usages. r=mhentges,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D116723
2021-06-03 20:08:51 +00:00
Emilio Cobos Álvarez a92eb7c353 Bug 1714357 - Use a nicer media query for proton context menus. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D116736
2021-06-03 17:51:48 +00:00
Jon Coppeard 0f11271b15 Bug 1704923 - Pass the number of threads when setting up an external thread pool r=sfink,bas
The JS helper thread system needs to know how many threads are available, in
particular because parallel Wasm compilation needs at least two threads to
avoid deadlock. This adds a method to get the count from TaskController and
passes it through to the JS engine when setting up the thread pool.

Differential Revision: https://phabricator.services.mozilla.com/D116220
2021-06-03 10:24:13 +00:00
Sandor Molnar 3da6a04bc0 Backed out 4 changesets (bug 1704923) for causing multiple failures in js::wasm::CompilerEnvironment::computeParameters. CLOSED TREE
Backed out changeset 498f9f3927f9 (bug 1704923)
Backed out changeset 9eabc7fc9b81 (bug 1704923)
Backed out changeset fedb48e21c75 (bug 1704923)
Backed out changeset 59c3af3d6e7f (bug 1704923)
2021-06-03 12:02:43 +03:00
Jon Coppeard 7440bcfa65 Bug 1704923 - Pass the number of threads when setting up an external thread pool r=sfink,bas
The JS helper thread system needs to know how many threads are available, in
particular because parallel Wasm compilation needs at least two threads to
avoid deadlock. This adds a method to get the count from TaskController and
passes it through to the JS engine when setting up the thread pool.

Differential Revision: https://phabricator.services.mozilla.com/D116220
2021-06-03 07:31:31 +00:00
Toshihito Kikuchi cfc57683ac Bug 1712630 - Introduce ProcessType.jsm to manage process type strings. r=Gijs,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D116438
2021-06-01 17:44:22 +00:00
Luca Greco 665f72549b Bug 1710917 - Introduced internal:svgContextPropertiesAllowed webextension permission. r=dholbert,mixedpuppy
This patch does change the extension-related special case in SVGContextPaint::IsAllowedForImageFromURI
to check the "internal:svgContextPropertiesAllowed" extension permission, and move the existing
criteria in the Extension class (which takes care of adding the internal permission when those
criteria as met).

This patch does not contain yet a new explicit test case for the new internal permission (which is
part of the patch build on top of this one and attached to the same bugzilla issue), but it does
pass the existing mochitest-chrome (test_chrome_ext_svg_context_fill.html).

Differential Revision: https://phabricator.services.mozilla.com/D115835
2021-06-01 14:46:03 +00:00
Edgar Chen c80e2f09d3 Bug 1712930 - Part 7: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED; r=smaug,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D116081
2021-06-01 13:10:48 +00:00
Edgar Chen 8effa3808d Bug 1712930 - Part 6: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_SENDING; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116080
2021-06-01 13:10:48 +00:00
Edgar Chen b4a690870e Bug 1712930 - Part 5: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_RESPONSE_TYPE; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116079
2021-06-01 13:10:47 +00:00
Edgar Chen 2f19ad2de5 Bug 1712930 - Part 4: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_OVERRIDE_MIME_TYPE; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116078
2021-06-01 13:10:47 +00:00
Edgar Chen 79a3f4a3a1 Bug 1712930 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116077
2021-06-01 13:10:46 +00:00
Edgar Chen bededd95ac Bug 1712930 - Part 2: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSETEXT; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116076
2021-06-01 13:10:46 +00:00
Edgar Chen 7664189944 Bug 1712930 - Part 1: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_CHUNKED_RESPONSETYPES_UNSUPPORTED_FOR_SYNC; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116075
2021-06-01 13:10:46 +00:00
Sandor Molnar 87e56c4f1a Merge mozilla-central to autoland. a=merge CLOSED TREE 2021-05-31 20:33:32 +03:00
Sandor Molnar 7b1d598d24 Backed out 7 changesets (bug 1712930) for causing damp failures. CLOSED TREE
Backed out changeset 4a03c8b2aa1a (bug 1712930)
Backed out changeset 311ccf17a01d (bug 1712930)
Backed out changeset c42f2270b5f8 (bug 1712930)
Backed out changeset b117c37b1e7e (bug 1712930)
Backed out changeset dd0ab5fc70a0 (bug 1712930)
Backed out changeset ab9bb2ee0c98 (bug 1712930)
Backed out changeset ec01575cb276 (bug 1712930)
2021-05-31 20:29:32 +03:00
Mozilla Releng Treescript e9eb869e90 Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2021-05-31 17:00:15 +00:00
Olli Pettay 73bad4abf2 Bug 1713320, ensure idle tasks get run, r=bas
If IdleTaskManager is suspended and non-idle task _is_run_, nothing seems to guarantee idle tasks get run later.
Calling UpdateCachedIdleDeadline triggers child->parent->child ipc messages if needed and ends up enabling
IdleTaskManager.

Differential Revision: https://phabricator.services.mozilla.com/D116316
2021-05-31 13:32:36 +00:00
Neil Deakin 0b4418c6a7 Bug 1696214, use moveToAnchor to position the tab and places tooltips so that the close and mute button tooltips appear correctly, r=jaws
This involves changing moveToAnchor to be allowed while the popup is showing. This change allows the buttons within the tab to use the normal algorithm for determining the tooltip position. This also fixes bug 1695900 so that tooltips for items in bookmarks menus also appear offset as well. Only the main tab and bookmarks on the toolbar appear aligned with the button's bottom edge.

Differential Revision: https://phabricator.services.mozilla.com/D115558
2021-05-31 13:07:35 +00:00
Edgar Chen 529a31571f Bug 1712930 - Part 7: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116081
2021-05-31 12:57:18 +00:00
Edgar Chen bd505df613 Bug 1712930 - Part 6: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_SENDING; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116080
2021-05-31 12:57:17 +00:00
Edgar Chen 71290465e8 Bug 1712930 - Part 5: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_RESPONSE_TYPE; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116079
2021-05-31 12:57:17 +00:00
Edgar Chen 8fdabf5210 Bug 1712930 - Part 4: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_OVERRIDE_MIME_TYPE; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116078
2021-05-31 12:57:16 +00:00
Edgar Chen fa6e0c0091 Bug 1712930 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116077
2021-05-31 12:57:16 +00:00
Edgar Chen a55011f761 Bug 1712930 - Part 2: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSETEXT; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116076
2021-05-31 12:57:16 +00:00
Edgar Chen b615b3fa01 Bug 1712930 - Part 1: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_CHUNKED_RESPONSETYPES_UNSUPPORTED_FOR_SYNC; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116075
2021-05-31 12:57:15 +00:00
Brindusan Cristian ca49f15f7d Backed out 14 changesets (bug 1705659, bug 472823, bug 669675) as requested by valentin for causing regressions. CLOSED TREE
Backed out changeset d920aa17a468 (bug 669675)
Backed out changeset adad38c05584 (bug 1705659)
Backed out changeset 361c177ed131 (bug 1705659)
Backed out changeset 46e559f45338 (bug 1705659)
Backed out changeset 3c9556a8df55 (bug 1705659)
Backed out changeset a179695a56c9 (bug 1705659)
Backed out changeset e688986c7011 (bug 1705659)
Backed out changeset de990e6c944d (bug 1705659)
Backed out changeset 0ea348abee78 (bug 1705659)
Backed out changeset 2f0aacbd42b1 (bug 1705659)
Backed out changeset c977551bad6e (bug 1705659)
Backed out changeset 5449d9e08034 (bug 1705659)
Backed out changeset b6b51bc167ac (bug 1705659)
Backed out changeset 27e709923ecb (bug 472823)
2021-05-31 13:16:34 +03:00
Toshihito Kikuchi 718f8615db Bug 1695817 - Part 6: Show name and publisher of an application owning a module. r=Gijs,fluent-reviewers,mhowell
This patch adds application info (Name and Publisher for now) in the
about:third-party page if a module is a part of an installed application,
which is registered in the registry and shown in Windows Control Panel.
To achieve this, we parse the registry to collect installed applications
in the background task.

Differential Revision: https://phabricator.services.mozilla.com/D109306
2021-05-28 22:35:59 +00:00
Noemi Erli e1fde28a85 Backed out 7 changesets (bug 1712930) for causing Android mochitest failures in test_onerror_message.html
Backed out changeset 4b93e808e72f (bug 1712930)
Backed out changeset f1cb609c78a0 (bug 1712930)
Backed out changeset 36e48f6e43ae (bug 1712930)
Backed out changeset b2da173c9337 (bug 1712930)
Backed out changeset d2eb6df1ec5f (bug 1712930)
Backed out changeset 78e1d6847f0a (bug 1712930)
Backed out changeset 6f842a2bf026 (bug 1712930)
2021-05-29 01:30:47 +03:00
Edgar Chen 7b47184b2c Bug 1712930 - Part 7: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116081
2021-05-28 21:12:13 +00:00
Edgar Chen 18ac9679bb Bug 1712930 - Part 6: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_SENDING; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116080
2021-05-28 21:12:13 +00:00
Edgar Chen 5b4acdb4c5 Bug 1712930 - Part 5: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_RESPONSE_TYPE; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116079
2021-05-28 21:12:12 +00:00
Edgar Chen a60d37c138 Bug 1712930 - Part 4: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_OVERRIDE_MIME_TYPE; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116078
2021-05-28 21:12:12 +00:00
Edgar Chen 582f4e1fe3 Bug 1712930 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116077
2021-05-28 21:12:12 +00:00
Edgar Chen ffe19c6879 Bug 1712930 - Part 2: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSETEXT; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116076
2021-05-28 21:12:11 +00:00
Edgar Chen b070511ab0 Bug 1712930 - Part 1: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_CHUNKED_RESPONSETYPES_UNSUPPORTED_FOR_SYNC; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116075
2021-05-28 21:12:10 +00:00
Kris Wright 68285a5475 Bug 1704887 - Fix a UAF in the DelayedRunnable gtests. r=xpcom-reviewers,nika
In the gtest for these patches, we can encounter a hang in the following steps:
- Monitor waits in the main thread (for async steps to finish)
- Offthread, monitor waits for the timer to fire
- Timer notifies the waiting monitors
- Monitor on the main thread continues first, wrapping up the test. It assumes all async steps are finished.
- The offthread monitor wait follows, but at this point the main thread has dereferenced the monitor. Because of this race, we run into a UAF and hang on the offthread monitor.

My solution for this is to use two monitors, and notify the outer one after we have=completed all of the async steps including the wait for the timer notification. This should avoid a race between the inner `monitor.wait()` and the free at the end of the tests.

Tentative try push for the fix: https://treeherder.mozilla.org/jobs?repo=try&revision=307960b2899b320ef5a82d276b86d633a9653941

Differential Revision: https://phabricator.services.mozilla.com/D116163
2021-05-28 19:05:30 +00:00
Kris Wright e9dca94b9d Bug 1704887 - Discard results of RemoveElement for DelayedRunnable r=necko-reviewers,xpcom-reviewers,mccr8,valentin
This silences a lint error on the previous patches in the series.

Differential Revision: https://phabricator.services.mozilla.com/D113160
2021-05-28 19:05:29 +00:00
Andreas Pehrson ca1c3d2196 Bug 1704887 - Remove assertions in OnDelayedRunnableRan. r=KrisWright,necko-reviewers,valentin
DelayedDispatch, in all current implementations, will set up a timer sync and
then Dispatch() a runnable. Since the timer is set up before the Dispatch, there
is a theoretical chance that the timer fires and dispatches a TimerEvent to the
target thread before DelayedDispatch managed to do so. When this happens the
internal DelayedDispatch runnable exits early, i.e., in practice it never runs.

The chance increases dramatically if the Dispatch() to the target in question is
tail dispatched, since the time between DelayedDispatch and the tail could be
non-trivial.

This patch removes the assert that checks that all DelayedRunnables that have
run have also been scheduled, since per the above no such guarantee exists.

Differential Revision: https://phabricator.services.mozilla.com/D112876
2021-05-28 19:05:29 +00:00
Andreas Pehrson 31a1263a94 Bug 1704887 - Add gtest for TaskQueue impl. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D112875
2021-05-28 19:05:28 +00:00
Alexandru Michis 8fbcd44dc4 Backed out 9 changesets (bug 1695817) for causing bc failures in content/aboutThirdParty.js
CLOSED TREE

Backed out changeset 6b7f451e911e (bug 1695817)
Backed out changeset ad3ea67b3d70 (bug 1695817)
Backed out changeset b4f971059f3f (bug 1695817)
Backed out changeset 9c9a928d4a70 (bug 1695817)
Backed out changeset 4a9bcb38fddf (bug 1695817)
Backed out changeset 48c0eed38628 (bug 1695817)
Backed out changeset 7583675dccb1 (bug 1695817)
Backed out changeset e3f2bed63c33 (bug 1695817)
Backed out changeset 1c45ba4fba61 (bug 1695817)
2021-05-28 21:53:41 +03:00
Sean Feng 4bbea0e5be Bug 1713327 - Use MOZ_DIAGNOSTIC_ASSERT in InputPriorityController::DidRunTask instead of MOZ_CRASH r=smaug
We should use MOZ_DIAGNOSTIC_ASSERT for the investigation, however, there's no need to crash the browser.

Differential Revision: https://phabricator.services.mozilla.com/D116247
2021-05-28 18:26:58 +00:00
Toshihito Kikuchi ad10c6f549 Bug 1695817 - Part 6: Show name and publisher of an application owning a module. r=Gijs,fluent-reviewers,mhowell
This patch adds application info (Name and Publisher for now) in the
about:third-party page if a module is a part of an installed application,
which is registered in the registry and shown in Windows Control Panel.
To achieve this, we parse the registry to collect installed applications
in the background task.

Differential Revision: https://phabricator.services.mozilla.com/D109306
2021-05-28 15:32:31 +00:00
Butkovits Atila 3735a33d14 Backed out 9 changesets (bug 1695817) for causing build bustages. CLOSED TREE
Backed out changeset 49be1caf6501 (bug 1695817)
Backed out changeset 30f1382d6058 (bug 1695817)
Backed out changeset ab9fa7f3b633 (bug 1695817)
Backed out changeset b03b122438cc (bug 1695817)
Backed out changeset 812a6bbfbe0e (bug 1695817)
Backed out changeset 3551230a7522 (bug 1695817)
Backed out changeset c7354b48fbee (bug 1695817)
Backed out changeset 4860450c2e23 (bug 1695817)
Backed out changeset 29dee289f866 (bug 1695817)
2021-05-28 07:52:30 +03:00
Toshihito Kikuchi 562f126952 Bug 1695817 - Part 6: Show name and publisher of an application owning a module. r=Gijs,fluent-reviewers,mhowell
This patch adds application info (Name and Publisher for now) in the
about:third-party page if a module is a part of an installed application,
which is registered in the registry and shown in Windows Control Panel.
To achieve this, we parse the registry to collect installed applications
in the background task.

Differential Revision: https://phabricator.services.mozilla.com/D109306
2021-05-28 04:19:07 +00:00
Butkovits Atila 711401ea39 Backed out 9 changesets (bug 1695817) for causing failures at browser_all_files_referenced.js. CLOSED TREE
Backed out changeset df4086427aaf (bug 1695817)
Backed out changeset 119a24f8be08 (bug 1695817)
Backed out changeset fd277ae2a7b8 (bug 1695817)
Backed out changeset a2c86a645fa8 (bug 1695817)
Backed out changeset c73705233fc4 (bug 1695817)
Backed out changeset 0a80eea3c0fa (bug 1695817)
Backed out changeset 9af42c7a3ca7 (bug 1695817)
Backed out changeset a2d11a0849d5 (bug 1695817)
Backed out changeset ba3ddcc28cbf (bug 1695817)
2021-05-28 03:05:09 +03:00
Toshihito Kikuchi e8ef8d92ad Bug 1695817 - Part 6: Show name and publisher of an application owning a module. r=Gijs,fluent-reviewers,mhowell
This patch adds application info (Name and Publisher for now) in the
about:third-party page if a module is a part of an installed application,
which is registered in the registry and shown in Windows Control Panel.
To achieve this, we parse the registry to collect installed applications
in the background task.

Differential Revision: https://phabricator.services.mozilla.com/D109306
2021-05-27 21:14:14 +00:00
Peter Van der Beken 3956d16cb3 Bug 1712725 - Disallow using HoldJSObjects/DropJSObjects for non-nsISupports classes that don't have a CC participant. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D116018
2021-05-27 08:35:41 +00:00
Peter Van der Beken af93c19a09 Bug 1712725 - Pass the correct object to mozilla::DropJSObjects. r=mccr8
Various code was passing 'this' to mozilla::DropJSObjects in unlink, but that's
the CC participant. The right object to pass is 'tmp'. I also added static
asserts in mozilla::Hold/DropJSObjects to block this in the future.

Differential Revision: https://phabricator.services.mozilla.com/D115884
2021-05-27 08:35:40 +00:00
Toshihito Kikuchi 96cdb7c193 Bug 1712693 - Generate a memory report when we detect a low-memory situation. r=gsvelto
This patch reinstate the code to call `SaveMemoryReport` when we enter a low-memory
situation from a normal state, which was removed by bug 1586236.

Differential Revision: https://phabricator.services.mozilla.com/D115960
2021-05-26 17:12:25 +00:00
Gabriele Svelto 1bbc08dfb1 Bug 1712084 - Keep alive the available memory tracker during shutdown r=tkikuchi
Differential Revision: https://phabricator.services.mozilla.com/D115599
2021-05-26 13:15:27 +00:00
Edgar Chen eb9e50c536 Bug 1712861 - Get rid of NS_ERROR_DOM_INVALID_ACCESS_XHR_TIMEOUT_AND_RESPONSETYPE_UNSUPPORTED_FOR_SYNC; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D115946
2021-05-26 12:12:09 +00:00
Andi-Bogdan Postelnicu a5cd8949a1 Bug 1707096 - fix `deprecated-copy` detected by clang-trunk. r=sfink,jandem
Differential Revision: https://phabricator.services.mozilla.com/D114087
2021-05-26 10:20:32 +00:00
Valentin Gosu 69c6a23516 Bug 1705659 - Static-analysis check auto fix for auth code r=necko-reviewers,dragana
Depends on D112604

Differential Revision: https://phabricator.services.mozilla.com/D112605
2021-05-26 09:27:21 +00:00
Henrik Skupin fa4fbb78b4 Bug 1695031 - Combine build flags --disable-marionette and --enable-cdp as --disable-webdriver. r=firefox-build-system-reviewers,Gijs,smaug,keeler,jdescottes,glandium
Differential Revision: https://phabricator.services.mozilla.com/D115583
2021-05-25 09:13:28 +00:00
Toshihito Kikuchi 0b6b4d9629 Bug 1711610 - Should not trigger the memory pressure event if the available commit space is not low. r=gsvelto
After bug 1586236, we use the memory resource notification object to detect a low
memory situation on Windows, which is signaled when the available physical memory
is low.  If the available physical memory is low, however, it's possible that there
is still commit space enough for the application to run.  In such a situation, we
don't want to make aggressive efforts to reduce memory usage.

This patch makes sure we send the memory pressure event (both New and Ongoing) only
when the available commit space is lower than the threshold value defined by the pref
"browser.low_commit_space_threshold_mb".  Its default value is set to 200MB
based on our telemetry data indicating ~60% of OOM crashes with <100MB, ~75% with <300MB.

To use the pref in `nsAvailableMemoryWatcher`, this patch moves the call to
`AvailableMemoryTracker::Init()` to `XRE_mainRun()`.  It was in `NS_InitXPCOM`
because the old initialization code hooked APIs and needed to be done while
the process has only one thread (bug 741540).  The current `AvailableMemoryTracker`
does not use hooks, so it doesn't have to be initialized that early.

Differential Revision: https://phabricator.services.mozilla.com/D115605
2021-05-24 21:29:46 +00:00
Olli Pettay 19f47e75ab Bug 1708042, add control priority to the main thread, r=bas
Differential Revision: https://phabricator.services.mozilla.com/D115404
2021-05-21 15:46:45 +00:00
Iulian Moraru e0b2722506 Backed out 3 changesets (bug 1708042) for causing wr failures on background-color-animation-in-body.html.
Backed out changeset f8febc2db198 (bug 1708042)
Backed out changeset a0fccd7121b5 (bug 1708042)
Backed out changeset ddc6d95f0601 (bug 1708042)
2021-05-21 16:39:38 +03:00
Agi Sferro 114966c6e0 Bug 1701269 - Remove mobile/android/base. r=nalexander,flod,owlish
Differential Revision: https://phabricator.services.mozilla.com/D109918
2021-05-20 22:03:03 +00:00
Olli Pettay 80a68b9bcf Bug 1708042, add control priority to the main thread, r=bas
Differential Revision: https://phabricator.services.mozilla.com/D115404
2021-05-20 12:42:31 +00:00
Mike Hommey b006fe6c37 Bug 1711627 - Avoid xptdata.h being (indirectly) included so much. r=xpcom-reviewers,nika
cf. bug 1710755, touching idl files regenerates xptdata.cpp and
xptdata.h, and the latter currently triggers tons of things to be
rebuilt because xptdata.h is included from xptinfo.h, which is directly
or indirectly included in many other places.

But there's only one thing defined in xptdata.h: nsXPTInterface, and
there's actually only one place that actively uses it:
StaticComponents.cpp.in, via a function defined in xptinfo.h.

Using a forward declaration in xptinfo.h allows to only include
xptdata.h from StaticComponents.cpp.in.

While here, add an include guard to xptdata.h.

Differential Revision: https://phabricator.services.mozilla.com/D115329
2021-05-19 20:41:39 +00:00
Nika Layzell 40a0ecc65f Bug 1709935 - Support XPCOM refcount logging with rust-xpcom, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D115086
2021-05-19 17:29:23 +00:00
Nika Layzell 3a56bcbaeb Bug 1709227 - Include offset information in rust-xpcom vtables, r=mccr8
In the Itanium C++ ABI VTables contain extra fields before the virtual function
pointer list for RTTI information, and these fields are not eliminated even
when RTTI is disabled using -fno-rtti. The two relevant fields for rust-xpcom's
vtables are the "offset to top" field, which contains the displacement to the
top of the object from the corresponding vtable pointer as a `ptrdiff_t`
(`isize`), and the "typeinfo pointer" field which points to the typeinfo object
and is null when building with -fno-rtti. The VTable pointer points after these
fields to the beginning of the virtual function pointer list.

While these extra fields would generally not be accessed in -fno-rtti
situations, gcc and clang still support `dynamic_cast<void*>` even when
-fno-rtti is passed, meaning that the "offset to top" field should be present.

Although I was unable to find documentation for the C++ ABI used on Darwin, it
appears to behave the same as the Itanium C++ ABI when it comes to VTable
layout.

In order to include these fields in the manual vtables built by the rust-xpcom
macros, a `&'static VTableExtra<VTableType>` is used instead of directly using
the vtable type, and the vtable reference stored in the struct is offset into
the allocation.

As the only platform I know of to not include these extra fields is Windows,
they are generated on all non-Windows platforms.

Differential Revision: https://phabricator.services.mozilla.com/D115085
2021-05-18 20:56:40 +00:00
Nika Layzell 01fe70071d Bug 1711090 - Part 4: Remove non-string func timer names, r=KrisWright
They are not used anywhere in the codebase and come with
non-insignificant complexity which we can drop.

Differential Revision: https://phabricator.services.mozilla.com/D115267
2021-05-18 20:45:17 +00:00
Nika Layzell 3d32bd50a0 Bug 1711090 - Part 2: Allow creating a nsITimer with a std::function callback, r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D115089
2021-05-18 20:45:16 +00:00
Nika Layzell 2bf842f8bb Bug 1711090 - Part 1: Simplify nsTimerImpl's Callback implementation, r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D115088
2021-05-18 20:45:16 +00:00
Alexandru Michis 08e0f3cf36 Backed out 4 changesets (bug 1711090) for causing bustages in nsTimerImpl.cpp
CLOSED TREE

Backed out changeset 5c6f0950714d (bug 1711090)
Backed out changeset 0b6a886eea8a (bug 1711090)
Backed out changeset fc9c788ff41d (bug 1711090)
Backed out changeset ecc51d9ad027 (bug 1711090)
2021-05-18 20:25:56 +03:00
Nika Layzell 4a4b5a6171 Bug 1711090 - Part 4: Remove non-string func timer names, r=KrisWright
They are not used anywhere in the codebase and come with
non-insignificant complexity which we can drop.

Differential Revision: https://phabricator.services.mozilla.com/D115267
2021-05-18 16:24:49 +00:00
Nika Layzell 4c32cf1fe5 Bug 1711090 - Part 2: Allow creating a nsITimer with a std::function callback, r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D115089
2021-05-18 16:24:48 +00:00
Nika Layzell 4b3f75001a Bug 1711090 - Part 1: Simplify nsTimerImpl's Callback implementation, r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D115088
2021-05-18 16:24:48 +00:00
Nika Layzell 407423d88c Bug 1711100 - Remove XPCOM leak logging from nsTArray_base, r=mccr8
This is for a few reasons:

* The leak logging isn't as useful as other types of logging, as
  nsTArray_base is frequently relocated without invoking a constructor,
  such as when stored within another nsTArray. This means that
  XPCOM_MEM_LOG_CLASSES cannot be used to identify specific leaks of
  nsTArray objects.

* The nsTArray type is layout compatible with the ThinVec crate with the
  correct flags, and ThinVec does not currently perform leak logging.
  This means that if a large number of arrays are transferred between rust
  and C++ code using ThinVec, for example within another ThinVec, they
  will not be logged correctly and might appear as e.g. negative leaks.

* Leaks which have been found thanks to the leak logging added by this
  type have often not been significant, and/or have needed to be
  circumvented using some other mechanism. Most leaks found with this type
  in them also include other types which will continue to be tracked.

Differential Revision: https://phabricator.services.mozilla.com/D115087
2021-05-13 23:20:31 +00:00
Edgar Chen 72168631b0 Bug 1710845 - Get rid of NS_ERROR_DOM_INVALID_EXPRESSION_ERR; r=smaug;
Differential Revision: https://phabricator.services.mozilla.com/D114967
2021-05-12 23:32:38 +00:00
Edgar Chen acf4edd8ea Bug 1710840 - Part 2: Get rid of NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; r=smaug
Depends on D114964

Differential Revision: https://phabricator.services.mozilla.com/D114965
2021-05-12 23:32:38 +00:00
Edgar Chen c681831600 Bug 1710840 - Part 1: Get rid of NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE; r=smaug;
Differential Revision: https://phabricator.services.mozilla.com/D114964
2021-05-12 23:32:37 +00:00
Nicolas B. Pierron a4aef929a1 Bug 1698045 part 1 - Add xpc::SelfHostedShmem to hold shared memory for JS initialization. r=smaug,tcampbell,ipc-reviewers,jld
This change adds the ground work to share content provided by the JS engine of
the Parent process to initialize the JS engine of other threads and Content
processes.

The singleton class xpc::SelfHostedShmem is used to wrap the logic behind
holding the memory. The memory is initialized with `InitFromParent` or
`InitFromChild`. The memory is accessible using either the `Content` or
`Handle`.

The shared memory is transfered through the command line using
`mozilla::ipc::ExportSharedJSInit` and read using
`mozilla::ipc::ImportSharedJSInit` functions. The command line is used, as we
need the shared memory to be avilable for the JS engine initialization. The
command line is composed of a single command named `-jsInit` which is followed
by the handle (on Windows) and the length of the shared content.

The memory associated with the shared memory is cleared in `ShutdownXPCOM` after
closing all threads, and shuting down the JS engine. This is necessary as we
expect the JS engine to borrow content from the shared memory.

Differential Revision: https://phabricator.services.mozilla.com/D110576
2021-05-12 13:57:55 +00:00
Paul Bone 831e9abe44 Bug 1629064 - pt 9. Use the current idle slice to start the GC if we can r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D110378
2021-05-12 06:46:11 +00:00
Edgar Chen f10ffb593c Bug 1709217 - Part 6: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_VALUE; r=smaug
Depends on D114185

Differential Revision: https://phabricator.services.mozilla.com/D114186
2021-05-11 19:38:46 +00:00
Edgar Chen 22ee127c8b Bug 1709217 - Part 5: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_SUPPORTED; r=smaug
Depends on D114184

Differential Revision: https://phabricator.services.mozilla.com/D114185
2021-05-11 19:38:46 +00:00
Edgar Chen 0362d20990 Bug 1709217 - Part 4: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_STATE; r=smaug
Depends on D114183

Differential Revision: https://phabricator.services.mozilla.com/D114184
2021-05-11 19:38:45 +00:00
Edgar Chen d1ca0306a2 Bug 1709217 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_INDETERM; r=smaug
Depends on D114182

Differential Revision: https://phabricator.services.mozilla.com/D114183
2021-05-11 19:38:45 +00:00
Edgar Chen b6a7d80197 Bug 1709217 - Part 2: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_ENABLED; r=smaug
Depends on D114181

Differential Revision: https://phabricator.services.mozilla.com/D114182
2021-05-11 19:38:44 +00:00
Edgar Chen 567d46362c Bug 1709217 - Part 1: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_EXEC_COMMAND; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D114181
2021-05-11 19:38:44 +00:00
Alexandre Lissy bb8254d3dd Bug 1704683 - Avoid loop for closing fd r=jld
Differential Revision: https://phabricator.services.mozilla.com/D114088
2021-05-11 07:45:16 +00:00
Andreea Pavel 2d45c54c8f Bug 1683062 - disable 1113005.html on linux-qr r=intermittent-reviewers,ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D114647
2021-05-10 13:41:14 +00:00
Edgar Chen f8605ff45d Bug 1709214 - Get rid of NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D114179
2021-05-10 12:20:17 +00:00
Andi-Bogdan Postelnicu eab549fd19 Bug 1519636 - Initial reformat of C/C++ code with clang-format version 12.0.0. r=sylvestre
clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D114211
2021-05-10 07:15:07 +00:00
Jens Stutte 50a5a1110d Bug 1709887: Add missing #define in mingw builds. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D114569
2021-05-07 14:02:26 +00:00
Jon Coppeard 52d33f4288 Bug 1709849 - Replace use of JSGCInvocationKind with JS::GCOptions in the browser r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D114512
2021-05-07 07:39:50 +00:00
Nika Layzell 1403a31aba Bug 1706365 - Part 2: Add tests for mozilla::Queue, r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D114523
2021-05-06 20:05:34 +00:00
Nika Layzell 151f89a2ab Bug 1706365 - Part 1: Safely invoke destructors and constructors in mozilla::Queue, r=xpcom-reviewers,kmag
This allows the `mozilla::Queue` type to be used more easily and without
causing assertion failures, leaks, or unsafe behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D112763
2021-05-06 20:05:34 +00:00
Nika Layzell ddfc865bf0 Bug 1706376 - Remove loud warning from BlockingResourceBase::Release(), r=xpcom-reviewers,mccr8
This warning previously fired loudly from the ports logic being added in bug
1706374 were acquired. As the warning also occasionally fires in existing code
and provides no safety guarantees, I think we should consider removing it.

Differential Revision: https://phabricator.services.mozilla.com/D112762
2021-05-06 20:05:33 +00:00
Alexandru Michis 574bea557a Backed out 14 changesets (bug 1705659, bug 472823, bug 669675) for causing bustages in nsHttpChannelAuthProvider.cpp
CLOSED TREE

Backed out changeset 42561f42313d (bug 669675)
Backed out changeset 2aee05c2d6f3 (bug 1705659)
Backed out changeset ff4348e0a307 (bug 1705659)
Backed out changeset 897868e22c81 (bug 1705659)
Backed out changeset c808bf01dfe8 (bug 1705659)
Backed out changeset 5c13ec25cc2e (bug 1705659)
Backed out changeset 4337214c8846 (bug 1705659)
Backed out changeset 18d3a604336a (bug 1705659)
Backed out changeset 3af362aa2b25 (bug 1705659)
Backed out changeset 36eff14cf2ea (bug 1705659)
Backed out changeset 8af29f96ac77 (bug 1705659)
Backed out changeset eab68e8bea29 (bug 1705659)
Backed out changeset 05492b6578a9 (bug 1705659)
Backed out changeset 3259a8cb3db1 (bug 472823)
2021-05-06 17:37:17 +03:00
Jens Stutte f2f68509d3 Bug 1690326: Add mappings for ERROR_DEVICE_HARDWARE_ERROR, ERROR_DEVICE_NOT_CONNECTED, ERROR_DISK_FULL and remove error NS_ERROR_FILE_DISK_FULL in favor of existing NS_ERROR_FILE_NO_DEVICE_SPACE r=xpcom-reviewers,necko-reviewers,nika,valentin
Win32 errors ERROR_DEVICE_HARDWARE_ERROR, ERROR_DEVICE_NOT_CONNECTED, ERROR_DISK_FULL need a mapping.
NS_ERROR_FILE_DISK_FULL is duplicate to NS_ERROR_FILE_NO_DEVICE_SPACE
Drive by: RejectJSPromise lacked some NS_ERROR_* mappings

Differential Revision: https://phabricator.services.mozilla.com/D113974
2021-05-06 14:00:06 +00:00
Valentin Gosu ec981ec694 Bug 1705659 - Static-analysis check auto fix for auth code r=necko-reviewers,dragana
Depends on D112604

Differential Revision: https://phabricator.services.mozilla.com/D112605
2021-05-06 13:17:23 +00:00
Christian Holler ad1556611a Bug 1709559 - Avoid using PL_str implementations when fuzzing network. r=valentin,necko-reviewers,xpcom-reviewers,KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D114347
2021-05-05 18:09:28 +00:00
Toshihito Kikuchi fee87c9b39 Bug 1705579 - Skip WinIOAutoObservation if TLS is not available. r=gerald,aklotz
We hook several file APIs to record I/O performance data.  Since TLS is not
allocated in ntdll's loader worker thread, however, if someone does a file
operation, we hit read AV because `WinIOAutoObservation` uses `nsString` and
a thread local variable.

Currently we can see this crash happens only when a DLL rule of AppLocker is
defined, but theoretically this can happen when any module loaded in a worker
thread does file operation in its entrypoint.

The proposed fix is to skip `WinIOAutoObservation` if TLS is not available.

Differential Revision: https://phabricator.services.mozilla.com/D113032
2021-05-05 17:00:09 +00:00
Jesse Schwartzentruber 24ef473acb Bug 1708409 - Include libFuzzer in xpcshell r=decoder
libFuzzer is already included in the firefox binary, so including it in
libxul is problematic.

Differential Revision: https://phabricator.services.mozilla.com/D113899
2021-04-30 17:46:15 +00:00
Dorel Luca 440b9916fe Backed out 2 changesets (bug 1707924) for multiple failures with crash [@ BackgroundEventTarget::CreateBackgroundTaskQueue(char const*)]. CLOSED TREE
Backed out changeset 7fda47840322 (bug 1707924)
Backed out changeset c6213e0b8024 (bug 1707924)
2021-04-30 06:20:24 +03:00
Dorel Luca 67f232e72a Backed out changeset 1d91ad1c6c6e (bug 1704391) for multiple failures in xpcom/threads/nsTimerImpl.cpp. CLOSED TREE 2021-04-30 06:17:37 +03:00
kriswright 46818f47fb Bug 1707924 - Assert on DelayedRunnable dispatch on non debug builds. r=xpcom-reviewers,nika
This assertion currently only happens on debug builds, but attempts to dispatch delayed runnables after we have started or finished cancelling all delayed runnables in a TaskQueue may be causing shutdown hangs.

Differential Revision: https://phabricator.services.mozilla.com/D113839
2021-04-30 00:58:48 +00:00