Commit Graph
14 Commits
Author SHA1 Message Date
Olli Pettay 9375e345e2 Bug 1795624 - remove dom.input_events.strict_input_vsync_alignment, r=sefeng
Had to rename input_event_queue.supported to dom.input_event_queue.supported so that
it could be used as a static pref.

Differential Revision: https://phabricator.services.mozilla.com/D159488
2022-10-17 17:02:24 +00:00
Mike Hommey 18ca062db2 Bug 1733308 - Fix non-unified builds errors in xpcom/threads. r=xpcom-reviewers,mccr8
xpcom/threads/CPUUsageWatcher.cpp:43:23: error: unused variable 'kCPUCheckInterval' [-Werror,-Wunused-const-variable]
xpcom/threads/CPUUsageWatcher.cpp:109:23: error: unused variable 'kCPUCheckInterval' [-Werror,-Wunused-const-variable]
xpcom/threads/InputEventStatistics.cpp:18:5: error: use of undeclared identifier 'ClearOnShutdown'
xpcom/threads/InputTaskManager.cpp:62:9: error: use of undeclared identifier 'InputEventStatistics'
xpcom/threads/InputTaskManager.cpp:89:3: error: use of undeclared identifier 'InputEventStatistics'
xpcom/threads/InputTaskManager.cpp:105:7: error: use of undeclared identifier 'nsRefreshDriver'
xpcom/threads/InputTaskManager.cpp:124:9: error: use of undeclared identifier 'InputEventStatistics'
xpcom/threads/MainThreadIdlePeriod.cpp:29:23: error: unused variable 'kMaxTimerThreadBoundClamp' [-Werror,-Wunused-const-variable]
xpcom/threads/VsyncTaskManager.h:15:67: error: implicit instantiation of undefined template 'mozilla::StaticRefPtr<mozilla::VsyncTaskManager>'
xpcom/threads/VsyncTaskManager.h:16:52: error: no viable overloaded '='
xpcom/threads/nsMemoryPressure.cpp:61:12: error: use of undeclared identifier 'nsIObserverService'
xpcom/threads/nsMemoryPressure.cpp:61:37: error: use of undeclared identifier 'services'
xpcom/threads/nsThreadManager.cpp:422:28: error: member access into incomplete type 'mozilla::ThreadEventTarget'
xpcom/threads/nsThreadManager.cpp:661:5: error: use of undeclared identifier 'CrashReporter'
xpcom/threads/nsThreadManager.cpp:662:59: error: expected ')'
xpcom/threads/nsThreadManager.cpp:662:9: error: use of undeclared identifier 'CrashReporter'
xpcom/threads/nsThreadManager.cpp:669:7: error: use of undeclared identifier 'CrashReporter'
xpcom/threads/nsThreadManager.cpp:670:11: error: use of undeclared identifier 'CrashReporter'
xpcom/threads/nsThreadManager.cpp:670:61: error: expected ')'
xpcom/threads/nsThreadManager.cpp:672:7: error: use of undeclared identifier 'CrashReporter'
xpcom/threads/nsThreadManager.cpp:673:11: error: use of undeclared identifier 'CrashReporter'
xpcom/threads/nsThreadUtils.cpp:636:13: error: member access into incomplete type 'mozilla::Task'

Differential Revision: https://phabricator.services.mozilla.com/D127041
2021-10-01 01:49:18 +00:00
Sean Feng e8be48e49d 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
Sean Feng 1a3148dfaa 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
Sean Feng 1f70573cba 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
Sean Feng dc353ff97a Bug 1708070 - Use VsyncTaskManager::WillRunTask to change InputVsyncState r=smaug
Currently, we use `VsyncTaskManager::DidRunTask` to change state from
`RunVsync` to `NoPendingVsync`, however, the issue is that if the vsync
starts an event loop (for instance, by using requestAnimationFrame), and
the event loop starts another input task, Firefox crashes because input
tasks don't expect the state to be `RunVsync`.

So instead of using `DidRunTask`, we start to use `WillRunTask` to fix
it.

Differential Revision: https://phabricator.services.mozilla.com/D113613
2021-04-29 16:39:30 +00:00
Sean Feng ba4c4152b8 Bug 1706794 - Remove a MOZ_ASSERT from InputTaskManager.cpp r=smaug
This assertion is no longer making sense after the changes we made in
bug 1705251.

Differential Revision: https://phabricator.services.mozilla.com/D113166
2021-04-26 14:27:14 +00:00
Sean Feng d8aea5039f Bug 1705251 - InputTaskManager should expect vsync to run when the input vsync state is InputVsyncState::HasPendingVsync r=smaug
We have seen a lot of crashes with the new vsync input alignment code
because a possible case is
  1. Input event runs when there's a pending vsync (state=HasPendingVsync)
  2. Input event handler starts an event loop (state=HasPendingVsync)
  3. Vsync runs (state=HasPendingVsync) and crashes.

It crashes because the `DidRunTask` method for the input event doesn't
get a chance to run, which supposes to set the state to RunVsync.

Differential Revision: https://phabricator.services.mozilla.com/D112799
2021-04-21 14:46:26 +00:00
Sean Feng 2b9405bd6c Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=smaug
This patch introduces a new way to way to schedule input tasks, such
that input tasks remain at `InputHigh` priority normally, however, when
there's a pending `Vsync` priority task in the task queue, we
increase the priority of input tasks from `InputHigh` to `InputHighest` to
rush processing the pending input tasks.

There are two restrictions to ensure we don't delay vsync too much:
  - There's a hard limit duration
  - We won't process the input tasks that are newly added after we've
    started to process the current number of input tasks

Differential Revision: https://phabricator.services.mozilla.com/D109499
2021-04-14 19:56:42 +00:00
Brindusan Cristian 2e90a569b4 Backed out 5 changesets (bug 1697585) for causing build bustages on nsTimerImpl.h. CLOSED TREE
Backed out changeset e9e4a710e7d1 (bug 1697585)
Backed out changeset bc271f42bcb7 (bug 1697585)
Backed out changeset d8516aec6a5e (bug 1697585)
Backed out changeset 0b1bc6cb84af (bug 1697585)
Backed out changeset 074ebebaee27 (bug 1697585)
2021-04-06 17:45:02 +03:00
Sean Feng e828222dac Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=smaug
This patch introduces a new way to way to schedule input tasks, such
that input tasks remain at `InputHigh` priority normally, however, when
there's a pending `Vsync` priority task in the task queue, we
increase the priority of input tasks from `InputHigh` to `InputHighest` to
rush processing the pending input tasks.

There are two restrictions to ensure we don't delay vsync too much:
  - There's a hard limit duration
  - We won't process the input tasks that are newly added after we've
    started to process the current number of input tasks

Differential Revision: https://phabricator.services.mozilla.com/D109499
2021-04-06 13:10:51 +00:00
Bas Schouten 533b15c0d4 Bug 1669214 - Part 4: Add code to forward runnables from EventQueue::PutEvent to the TaskController. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D92453
2020-10-06 19:06:57 +00:00
Bas Schouten 4ce34dc017 Bug 1661881 - Part 2: Make InputTaskManager a global singleton. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89535
2020-09-14 12:12:06 +00:00
Bas Schouten 797d648764 Bug 1661881 - Part 1: Factor InputTaskManager into its own file. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89534
2020-09-14 12:10:39 +00:00