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

2018 Коммитов

Автор SHA1 Сообщение Дата
Imanol Fernandez cee36f038b Bug 1636456 - Implement WebXR idle deadline detection r=kip,daoshengmu,smaug,rbarker
Gecko Idle detection relies heavily on RefreshDriver. GC/CC scheduling, including when to run GC or CC slices, and the length of the slices, is mostly based on idle time. As WebXR isn't using normal RefreshDriver, the content process thinks it's idle and GC and CC get basically up to 50 ms slices.

Not having WebXR idle detection is causing stutter frames during immersive presentation. This patch implements idle deadline hint and sets the correct GC slices budgets during WebXR presentation.

Differential Revision: https://phabricator.services.mozilla.com/D74426
2020-05-13 22:10:27 +00:00
Jean-Yves Avenard e574b42ad5 Bug 1592488 - P13. Add TailDispatchingTarget class. r=bholley
This wraps the current thread such that a call to Dispatch will be done as direct task dispatch instead so that the task will be run in the current event loop.
This allows for have similar (but not identical to) the microtask semantics of JS promises

Differential Revision: https://phabricator.services.mozilla.com/D69995
2020-05-12 10:45:23 +00:00
Jean-Yves Avenard ecf59bcb19 Bug 1592488 - P3. Update AbstractThread comment to reflect current mode of operation. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D74591
2020-05-12 10:42:52 +00:00
Jean-Yves Avenard ab7618f0d9 Bug 1592488 - P2. Add MozPromise::Private::UseDirectTaskDispatch. r=bholley
If set, the callback will be dispatched via a direct task.
Direct tasks are run via the current thread's tail dispatcher.
This mechanism is only available if both the caller and the target are on the same thread and an AbstractThread is available

Differential Revision: https://phabricator.services.mozilla.com/D71592
2020-05-12 10:42:44 +00:00
Jean-Yves Avenard 68431ed26f Bug 1592488 - P1. Add MozPromise::Private::UseSynchronousTaskDispatch. r=bholley
If set, the callback will be run synchronously when the promise is resolved or rejected.

Differential Revision: https://phabricator.services.mozilla.com/D71591
2020-05-12 10:53:48 +00:00
Honza Bambas 281f7b311b Bug 1634950 - Add event dispatch-and-run MOZ_LOG to our xpcom threads, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73622
2020-05-12 12:48:49 +00:00
Jean-Yves Avenard 4f02149e61 Bug 1634253 - P4. Have NS_NewNamedThread take a already_Refed<nsIRunnable. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73823
2020-05-08 20:20:28 +00:00
Jean-Yves Avenard ee2897c234 Bug 1634253 - P3. Don't cause assertion when delay is 0. r=froydnj
already_AddRefed destructor assert that it's nullptr.
DelayedDispatch check that the value passed isn't 0 and return an error code, leaving the already_AddRefed untouched.

Differential Revision: https://phabricator.services.mozilla.com/D73821
2020-05-08 20:20:30 +00:00
Jean-Yves Avenard 0afd0b06c9 Bug 1634253 - P2. Dissociate running a BackgroundHangMonitor from main thread. r=froydnj
This will allow to have other threads to use one such as the compositor thread.

Differential Revision: https://phabricator.services.mozilla.com/D73820
2020-05-08 20:20:32 +00:00
Jean-Yves Avenard dd75a6a8ab Bug 1634253 - P1. Fix constness. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73819
2020-05-08 20:20:35 +00:00
Narcis Beleuzu 58a833221c Backed out 9 changesets (bug 1634253) for bc failures on browser_bug295977_autoscroll_overflow.js . CLOSED TREE
Backed out changeset d41b75c1f7ec (bug 1634253)
Backed out changeset 5f8a1ee17b81 (bug 1634253)
Backed out changeset 43eda078b405 (bug 1634253)
Backed out changeset e98212a74709 (bug 1634253)
Backed out changeset 855e222ceb14 (bug 1634253)
Backed out changeset 9f01acdf4367 (bug 1634253)
Backed out changeset ea62cb1ec472 (bug 1634253)
Backed out changeset fa3e7588e7d6 (bug 1634253)
Backed out changeset 139e7035e736 (bug 1634253)
2020-05-08 23:09:31 +03:00
Jean-Yves Avenard f597eaee8b Bug 1634253 - P4. Have NS_NewNamedThread take a already_Refed<nsIRunnable. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73823
2020-05-07 08:04:34 +00:00
Jean-Yves Avenard efec5e2e85 Bug 1634253 - P3. Don't cause assertion when delay is 0. r=froydnj
already_AddRefed destructor assert that it's nullptr.
DelayedDispatch check that the value passed isn't 0 and return an error code, leaving the already_AddRefed untouched.

Differential Revision: https://phabricator.services.mozilla.com/D73821
2020-05-07 08:04:37 +00:00
Jean-Yves Avenard 3e533d2327 Bug 1634253 - P2. Dissociate running a BackgroundHangMonitor from main thread. r=froydnj
This will allow to have other threads to use one such as the compositor thread.

Differential Revision: https://phabricator.services.mozilla.com/D73820
2020-05-07 08:04:39 +00:00
Jean-Yves Avenard 2494dc377e Bug 1634253 - P1. Fix constness. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73819
2020-05-07 08:04:41 +00:00
Mirko Brodesser 99d8db5e8a Bug 1635709: part 2) Add unit to `nsITimer`'s `init` methods. r=froydnj
`Selection`'s `nsAutoScrollTimer` uses it and it's clearer when the unit
is known.

Depends on D74051

Differential Revision: https://phabricator.services.mozilla.com/D74052
2020-05-06 15:23:22 +00:00
Dorel Luca 9340fa2b2d Backed out 11 changesets (bug 1635001, bug 1634253) for Browser-chrome failures in browser_bug295977_autoscroll_overflow.js
Backed out changeset c3c27cb46db6 (bug 1635001)
Backed out changeset 6cea251e5910 (bug 1635001)
Backed out changeset 3cb0a05be7fc (bug 1635001)
Backed out changeset 1cbb2866a3ad (bug 1634253)
Backed out changeset 53fd00dcf95c (bug 1634253)
Backed out changeset e3acd9db7065 (bug 1634253)
Backed out changeset 5c0b7aa99406 (bug 1634253)
Backed out changeset dc7e17f772be (bug 1634253)
Backed out changeset 6e47af64396a (bug 1634253)
Backed out changeset 8865de9ae0ef (bug 1634253)
Backed out changeset 6fac93b596c2 (bug 1634253)
2020-05-07 11:00:04 +03:00
Jean-Yves Avenard 19c4486bed Bug 1634253 - P4. Have NS_NewNamedThread take a already_Refed<nsIRunnable. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73823
2020-05-07 05:02:46 +00:00
Jean-Yves Avenard 50d25d73f4 Bug 1634253 - P3. Don't cause assertion when delay is 0. r=froydnj
already_AddRefed destructor assert that it's nullptr.
DelayedDispatch check that the value passed isn't 0 and return an error code, leaving the already_AddRefed untouched.

Differential Revision: https://phabricator.services.mozilla.com/D73821
2020-05-07 05:02:39 +00:00
Jean-Yves Avenard d792bf2e0c Bug 1634253 - P2. Dissociate running a BackgroundHangMonitor from main thread. r=froydnj
This will allow to have other threads to use one such as the compositor thread.

Differential Revision: https://phabricator.services.mozilla.com/D73820
2020-05-07 05:02:31 +00:00
Jean-Yves Avenard 151a0ccd4e Bug 1634253 - P1. Fix constness. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73819
2020-05-07 05:02:21 +00:00
Simon Giesecke 97d4011b9b Bug 1626570 - Improve handling of copying arrays in MozPromise. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73641
2020-05-05 13:01:43 +00:00
Gerald Squelart 02d4f51396 Bug 1609907 - Add AUTO_PROFILER_THREAD_SLEEP around wait_for in DEBUG OffTheBooksCondVar::Wait - r=mstange
In non-DEBUG builds, `OffTheBooksCondVar::Wait` has `AUTO_PROFILER_THREAD_SLEEP`, but it's not in DEBUG builds.
`profiler_thread_sleep` does a `MOZ_ASSERT(mSleep == AWAKE)` in DEBUG builds, so the double call that happens in non-DEBUG wouldn't trigger the assertion!

This patch adds `AUTO_PROFILER_THREAD_SLEEP` in DEBUG `OffTheBooksCondVar::Wait`, to catch more misuses during development.

Depends on D72851

Differential Revision: https://phabricator.services.mozilla.com/D72852
2020-05-01 22:12:56 +00:00
Gerald Squelart 6f36a3fdb8 Bug 1609907 - Remove AUTO_PROFILER_THREAD_SLEEP before mozilla::CondVar waits - r=mstange
CondVar already calls `AUTO_PROFILER_THREAD_SLEEP`, which shouldn't be called recursively.

mozilla::Monitor also uses CondVar, so it shouldn't be surrounded by `AUTO_PROFILER_THREAD_SLEEP` either.

Depends on D72850

Differential Revision: https://phabricator.services.mozilla.com/D72851
2020-05-01 22:12:22 +00:00
Bobby Holley 6e85e332ad Bug 1631304 - Use thread observers for the tail dispatcher. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D71710
2020-04-28 21:18:24 +00:00
Bobby Holley 216d17b976 Bug 1631304 - Mark the tail dispatcher as unavailable outside of event dispatch. r=jya
This is in preparation for running the tail dispatcher off
nsIThreadObserver callbacks, which only work during regular
event processing.

Differential Revision: https://phabricator.services.mozilla.com/D72264
2020-04-28 21:18:21 +00:00
Bobby Holley d90069e220 Bug 1631304 - Reject AbstractThread dispatches after the main thread has ceased event proccessing. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D72263
2020-04-28 21:18:19 +00:00
Bobby Holley a50600019a Bug 1631304 - Replace EventTargetWrapper with XPCOMThreadWrapper. r=jya
This is how it used to be, before the Quantum DOM stuff. We use
nsIThreadInternal because that supports thread observers, which we
leverage in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D71709
2020-04-28 21:18:17 +00:00
Bobby Holley b5422991d2 Bug 1631304 - Don't lazily create a TailDispatcher from MaybeDrainDirectTasks. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D72262
2020-04-28 21:18:15 +00:00
Bobby Holley b90c44273e Bug 1631304 - Drill a fast path to accessing the main thread. r=erahm
I'm surprised we don't have this already.

Differential Revision: https://phabricator.services.mozilla.com/D71486
2020-04-28 21:18:10 +00:00
Sylvestre Ledru 34acbb653a Bug 1619165 - Reformat recent changes to the Google coding style r=andi
First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
2020-04-25 09:40:08 +00:00
Jean-Yves Avenard 6fa1bb5971 Bug 1630802 - P9. EventTargetWrapper runners don't need to be cancellable. r=bholley
It was required once upon a time to be able to use MozPromise on Workers.
Today a MozPromise work with nsISerialEventTarget and no longer rely on this. It can go.

Differential Revision: https://phabricator.services.mozilla.com/D71442
2020-04-20 02:08:23 +00:00
Jean-Yves Avenard d882415a98 Bug 1630802 - P8. Remove unnecessary AutoEnter. r=bholley
AutoEnter was an attempt around a race between AbstractThread and MessageLoopAbstractThreadWrap that would cause AbstractThread::GetCurrent() to return an incorrect value. MessageLoopAbstractThreadWrapper is no more and as such AutoEnter is no longer required.

Differential Revision: https://phabricator.services.mozilla.com/D71279
2020-04-20 02:13:31 +00:00
Jean-Yves Avenard f739ba2873 Bug 1630802 - P7. Remove CreateEventTargetWrapper and ensure that only a single AbstractThread exists par nsIThread. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D71492
2020-04-21 03:02:39 +00:00
Jean-Yves Avenard 61ac17fa16 Bug 1630802 - P3. Make AbstractThread::GetCurrent() return MainThread on the main thread. r=bholley
prior bug 1364821, AbstractThread::GetCurrent() would always return AbstractThread::MainThread() when called from the main thread.
After this change, we had to run within an AutoEnter scope.

A hidden side effect of this change was that under most cases AbstractThread::MainThread::Dispatch() would no longer use the tail dispatcher to dispatch a task.

It can be safely assume that whenever you're on the main thread, the equivalent AbstractThread is usable.

In the next commit, we will be removing AutoEnter entirely.

Differential Revision: https://phabricator.services.mozilla.com/D71148
2020-04-20 02:07:10 +00:00
Jean-Yves Avenard 08cdd889a1 Bug 1630802 - P1. Cleanup AbstractThread TLS lookup. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D69994
2020-04-20 02:06:51 +00:00
Ciure Andrei 82b75f7098 Backed out 3 changesets (bug 1631304) for causing MediaStream-MediaElement-srcObject.https.html wpt failures CLOSED TREE
Backed out changeset 54e27b897b3a (bug 1631304)
Backed out changeset 9ffa1843a04b (bug 1631304)
Backed out changeset 700adf5d3779 (bug 1631304)
2020-04-21 04:25:48 +03:00
Bobby Holley db090baf2a Bug 1631304 - Run the TailDispatcher off the Microtask queue. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D71488
2020-04-20 19:12:43 +00:00
Bobby Holley a15d363d2d Bug 1631304 - Add a mechanism to dispatch runnables as microtasks. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D71487
2020-04-20 20:39:46 +00:00
Bobby Holley 67208f946c Bug 1631304 - Drill a fast path to accessing the main thread. r=erahm
I'm surprised we don't have this already.

Differential Revision: https://phabricator.services.mozilla.com/D71486
2020-04-20 22:49:39 +00:00
Olli Pettay ebe2702267 Bug 1627935 - PrioritizedEventQueue::GetEvent doesn't return the correct priority value, r=bas
One could possibly make larger changes to make the setup less error prone, but hopefully we'll
replace this code with the new scheduler relatively soon.
And the assertion there should still enforce correct behavior.

Differential Revision: https://phabricator.services.mozilla.com/D69988

--HG--
extra : moz-landing-system : lando
2020-04-13 22:22:57 +00:00
Nicholas Nethercote 8139b4051e Bug 1619840 - Remove `fix_{linux,macosx}_stack.py` and `fix_stack_using_bpsyms.py`. r=erahm
This commit removes `test_fix_stack_using_bpsyms.py`. That test can't easily be
modified to work with `fix_stacks.py` because it relies on internal
implementation details of `fix_stack_using_bpsym.py`. The unit testing done in
the `fix-stacks` repo provides test coverage that is as good or better.

Differential Revision: https://phabricator.services.mozilla.com/D66924

--HG--
extra : moz-landing-system : lando
2020-04-08 06:55:54 +00:00
Eric Rahm 73c5285b22 Bug 1627391 - Add missing includes and namespaces to xpcom/threads. r=xpcom-reviewers,sg
Also moves `nsThreadShutdownContext` to `nsThread.h` so it can be used by `nsThreadPool`.

Differential Revision: https://phabricator.services.mozilla.com/D69657

--HG--
extra : moz-landing-system : lando
2020-04-07 22:10:29 +00:00
Andreas Farre 25ca8d7890 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
TabGroup never really made any difference in which thread something go
dispatched to. This was the intended use, but development of TabGroups
with abstract main threads never made it that far. The good thing is
that thish makes it safe to also remove to the SystemGroup and instead
switch all SystemGroup dispatches to dispatches to main thread.

Timers for setTimeout and workers were the sole users of wrapped and
throttled event targets, that those throttled queues have been moved
to the BrowsingContextGroup and are now accessed explicitly.

The SchedulerEventTarget has been removed, since there are no longer a
separate event target for every TaskCategory. Instead a
LabellingEventTarget has been added to DocGroup to handle the case
where an event is dispatched do DocGroup or when an AbstractThread is
created using a DocGroup. This means that we'll actually label more
events correctly with the DocGroup that they belong to.

DocGroups have also been moved to BrowsingContextGroup.

Depends on D67636

Differential Revision: https://phabricator.services.mozilla.com/D65936

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:47 +00:00
Andreas Farre 9e36af2ab6 Bug 1620594 - Part 3: Use default target for timers using SystemGroup. r=nika
Depends on D67632

Differential Revision: https://phabricator.services.mozilla.com/D67633

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:46 +00:00
Andreas Farre 36eaf82163 Bug 1620594 - Part 2: Use SchedulerGroup::Dispatch instead of SystemGroup::Dispatch. r=nika
Depends on D67631

Differential Revision: https://phabricator.services.mozilla.com/D67632

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:33 +00:00
Andreas Farre 63e21eec70 Bug 1620594 - Part 1: Rework NS_ReleaseOnMainThreadSystemGroup. r=nika
To be able to remove SystemGroup, NS_ReleaseOnMainThreadSystemGroup
needs to have its dependency on SystemGroup removed. Since all
releases using SystemGroup would've released on the main thread anyway
we can safely replace NS_ReleaseOnMainThreadSystemGroup with
NS_ReleaseOnMainThread.

Depends on D64390

Differential Revision: https://phabricator.services.mozilla.com/D67631

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:23 +00:00
Bas Schouten 3c7916f406 Bug 1627741: Expect an idle token only if we're actually using cross-process idle scheduling. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D69846

--HG--
extra : moz-landing-system : lando
2020-04-06 17:25:06 +00:00
André Bargull 14ca007916 Bug 1625138 - Part 41: Remove no longer needed includes for mozilla/TypeTraits. r=froydnj
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.

Differential Revision: https://phabricator.services.mozilla.com/D68561

--HG--
extra : moz-landing-system : lando
2020-03-28 16:00:09 +00:00
André Bargull f70fd1c1bd Bug 1625138 - Part 37: Replace mozilla::IsSame with std::is_same in xpcom/. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68556

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:21 +00:00