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

6384 Коммитов

Автор SHA1 Сообщение Дата
Florian Quèze f447ef94de Bug 1688300 - Add 'Runnable' profiler markers showing when runnables are executed and a 'Task' label frame showing which tasks are started by TaskController, r=bas,gerald.
Differential Revision: https://phabricator.services.mozilla.com/D102803
2021-01-26 08:57:19 +00:00
Csoregi Natalia d97e4efd8e Backed out 9 changesets (bug 1681529) for causing bustage on TestSeekableStreamWrapper.cpp. CLOSED TREE
Backed out changeset 99d1c9682dc2 (bug 1681529)
Backed out changeset b562b6038855 (bug 1681529)
Backed out changeset 5a5f514a6cfe (bug 1681529)
Backed out changeset ceb55436928a (bug 1681529)
Backed out changeset 9852de883959 (bug 1681529)
Backed out changeset 1a33ea8b533d (bug 1681529)
Backed out changeset 3385635e9521 (bug 1681529)
Backed out changeset 49c28bfc4da4 (bug 1681529)
Backed out changeset 43cc14af229d (bug 1681529)
2021-01-25 23:40:44 +02:00
Nika Layzell b95186c4e1 Bug 1681529 - Part 5: Serialize `nsIInputStream` over IPC with aDelayedStart by default, r=baku
The current set of cases where a nsIInputStream is directly serialized over IPC
is fairly limited, and includes cases where the IPDL struct may be directly
stored within a content process, having the nsIInputStream left unused.

By switching this serialization to DelayedStart, we can avoid performing
unnecessary streaming copies of IPC data when sending postdata streams related
to session history and document navigation, while also avoiding issues like this
coming up again due to delayed start being the default.

Differential Revision: https://phabricator.services.mozilla.com/D101804
2021-01-20 16:20:11 +00:00
Nika Layzell f48d3f14bd Bug 1681529 - Part 4: Serialize aDelayedStart streams from parent to child as RemoteLazyInputStreams, r=baku
When aDelayedStart is specified, if the created IPCStream contains an internal
IPC stream actor, an actor is used under the hood to send raw data between
processes when needed. This is usually done to reduce overhead in cases where
the target process may not use the nsIInputStream immediately, if at all.

By switching to using RemoteLazyInputStream when sending DelayedStart actors
from parent to content, the amount of data sent in the initial payload is
reduced even further, and the stream is optimized to allow sending it back to
the parent process without streaming the data through the content process again.

Normal delayed start streams are still used when sending payloads from other
processes, as RemoteLazyInputStream is only supported for nsIInputStreams
originating in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D101803
2021-01-20 16:20:34 +00:00
Nika Layzell 9715099994 Bug 1681529 - Part 3: Apply InputStreamLengthWrapper after DelayedStartInputStream, r=baku
Previously, we would apply the InputStreamLengthWrapper before
DelayedStartInputStream, which meant that a stream serialized with aDelayedStart
would not correctly implement nsIInputStreamLength. By inverting the order of
these wrappers, the nsIInputStreamLength implementation is visible, without
impacting the functionality of the DelayedStartInputStream wrapper.

Differential Revision: https://phabricator.services.mozilla.com/D101802
2021-01-20 16:21:07 +00:00
Nika Layzell 1aa0c7b19d Bug 1681529 - Part 1: Add a test for reloading a page with a large postdata payload, r=peterv
Without the other patches in this series, this test fails with both with and
without Fission enabled, for two different reasons.

With Fission disabled, the second reload request appears as empty, due to us
being unable to rewind the postData nsIInputStream. With Fission enabled, the
second reload request causes crashes due to the nsMIMEInputStream's invariant of
requiring a seekable stream is invalidated, causing the nsICloneableInputStream
implementation to misbehave.

Differential Revision: https://phabricator.services.mozilla.com/D101800
2021-01-20 16:17:15 +00:00
Nika Layzell 39d4397c40 Bug 1683490 - Make PBackground be a refcounted actor, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D102436
2021-01-21 16:26:50 +00:00
Deian Stefan 83f9e8ca5b Bug 1653659 - Part 2: Add support for Wasm sandboxing hunspell. r=firefox-build-system-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D86063
2021-01-14 20:12:19 +00:00
Masatoshi Kimura a29e207781 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 12:07:16 +00:00
Narcis Beleuzu 0322452233 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 04:04:37 +02:00
Masatoshi Kimura b384f14cde Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 04:02:41 +02:00
Dorel Luca 9ed19e2828 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 02:45:34 +02:00
Masatoshi Kimura 87e50835c4 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-14 20:44:54 +00:00
Dorel Luca 869d44f53c Backed out 2 changesets (bug 1653659) for Build bustage in builds/worker/workspace/obj-build/dist/include/mozilla/rlbox/rlbox_type_traits.hpp. CLOSED TREE
Backed out changeset 783310e1f5b8 (bug 1653659)
Backed out changeset 876dfd999d65 (bug 1653659)
2021-01-14 22:09:18 +02:00
Deian Stefan 27b04de0f6 Bug 1653659 - Part 2: Add support for Wasm sandboxing hunspell. r=firefox-build-system-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D86063
2021-01-13 06:39:01 +00:00
Kartik Gautam 7ae6aea145 Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Sylvestre Ledru b58ddc19df Bug 1519636 - Reformat recent changes to the Google coding style r=andi
Updated with Debian clang-format version 11.0.1-1

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D100934
2021-01-06 17:17:23 +00:00
Paul Bone 71f32490f9 Bug 1683032 - Always check active count in IdleSchedulerParent r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D100301
2021-01-06 05:07:20 +00:00
Markus Stange 5cd8830a74 Bug 1683723 - Replace deprecated Cocoa enum constants with their modern replacements. r=spohl
I ran the following command:

```
rg -l 'NSAlphaShiftKeyMask' . | xargs sed -i '' -e 's/NSAlphaShiftKeyMask/NSEventModifierFlagCapsLock/g'
rg -l 'NSAlternateKeyMask' . | xargs sed -i '' -e 's/NSAlternateKeyMask/NSEventModifierFlagOption/g'
rg -l 'NSAnyEventMask' . | xargs sed -i '' -e 's/NSAnyEventMask/NSEventMaskAny/g'
rg -l 'NSApplicationDefined' . | xargs sed -i '' -e 's/NSApplicationDefined/NSEventTypeApplicationDefined/g'
rg -l 'NSBorderlessWindowMask' . | xargs sed -i '' -e 's/NSBorderlessWindowMask/NSWindowStyleMaskBorderless/g'
rg -l 'NSCenterTextAlignment' . | xargs sed -i '' -e 's/NSCenterTextAlignment/NSTextAlignmentCenter/g'
rg -l 'NSClosableWindowMask' . | xargs sed -i '' -e 's/NSClosableWindowMask/NSWindowStyleMaskClosable/g'
rg -l 'NSCommandKeyMask' . | xargs sed -i '' -e 's/NSCommandKeyMask/NSEventModifierFlagCommand/g'
rg -l 'NSCompositeCopy' . | xargs sed -i '' -e 's/NSCompositeCopy/NSCompositingOperationCopy/g'
rg -l 'NSControlKeyMask' . | xargs sed -i '' -e 's/NSControlKeyMask/NSEventModifierFlagControl/g'
rg -l 'NSDeviceIndependentModifierFlagsMask' . | xargs sed -i '' -e 's/NSDeviceIndependentModifierFlagsMask/NSEventModifierFlagDeviceIndependentFlagsMask/g'
rg -l 'NSFlagsChanged' . | xargs sed -i '' -e 's/NSFlagsChanged/NSEventTypeFlagsChanged/g'
rg -l 'NSFullScreenWindowMask' . | xargs sed -i '' -e 's/NSFullScreenWindowMask/NSWindowStyleMaskFullScreen/g'
rg -l 'NSFullSizeContentViewWindowMask' . | xargs sed -i '' -e 's/NSFullSizeContentViewWindowMask/NSWindowStyleMaskFullSizeContentView/g'
rg -l 'NSFunctionKeyMask' . | xargs sed -i '' -e 's/NSFunctionKeyMask/NSEventModifierFlagFunction/g'
rg -l 'NSHelpKeyMask' . | xargs sed -i '' -e 's/NSHelpKeyMask/NSEventModifierFlagHelp/g'
rg -l 'NSKeyDown' . | xargs sed -i '' -e 's/NSKeyDown/NSEventTypeKeyDown/g'
rg -l 'NSKeyUp' . | xargs sed -i '' -e 's/NSKeyUp/NSEventTypeKeyUp/g'
rg -l 'NSLeftMouseDownMask' . | xargs sed -i '' -e 's/NSLeftMouseDownMask/NSEventMaskLeftMouseDown/g'
rg -l 'NSLeftMouseDown' . | xargs sed -i '' -e 's/NSLeftMouseDown/NSEventTypeLeftMouseDown/g'
rg -l 'NSLeftMouseDragged' . | xargs sed -i '' -e 's/NSLeftMouseDragged/NSEventTypeLeftMouseDragged/g'
rg -l 'NSLeftMouseUp' . | xargs sed -i '' -e 's/NSLeftMouseUp/NSEventTypeLeftMouseUp/g'
rg -l 'NSMiniaturizableWindowMask' . | xargs sed -i '' -e 's/NSMiniaturizableWindowMask/NSWindowStyleMaskMiniaturizable/g'
rg -l 'NSMiniControlSize' . | xargs sed -i '' -e 's/NSMiniControlSize/NSControlSizeMini/g'
rg -l 'NSMouseEntered' . | xargs sed -i '' -e 's/NSMouseEntered/NSEventTypeMouseEntered/g'
rg -l 'NSMouseExited' . | xargs sed -i '' -e 's/NSMouseExited/NSEventTypeMouseExited/g'
rg -l 'NSMouseMoved' . | xargs sed -i '' -e 's/NSMouseMoved/NSEventTypeMouseMoved/g'
rg -l 'NSNumericPadKeyMask' . | xargs sed -i '' -e 's/NSNumericPadKeyMask/NSEventModifierFlagNumericPad/g'
rg -l 'NSOtherMouseDownMask' . | xargs sed -i '' -e 's/NSOtherMouseDownMask/NSEventMaskOtherMouseDown/g'
rg -l 'NSOtherMouseDown' . | xargs sed -i '' -e 's/NSOtherMouseDown/NSEventTypeOtherMouseDown/g'
rg -l 'NSOtherMouseDragged' . | xargs sed -i '' -e 's/NSOtherMouseDragged/NSEventTypeOtherMouseDragged/g'
rg -l 'NSOtherMouseUp' . | xargs sed -i '' -e 's/NSOtherMouseUp/NSEventTypeOtherMouseUp/g'
rg -l 'NSRegularControlSize' . | xargs sed -i '' -e 's/NSRegularControlSize/NSControlSizeRegular/g'
rg -l 'NSResizableWindowMask' . | xargs sed -i '' -e 's/NSResizableWindowMask/NSWindowStyleMaskResizable/g'
rg -l 'NSRightMouseDown' . | xargs sed -i '' -e 's/NSRightMouseDown/NSEventTypeRightMouseDown/g'
rg -l 'NSRightMouseDragged' . | xargs sed -i '' -e 's/NSRightMouseDragged/NSEventTypeRightMouseDragged/g'
rg -l 'NSRightMouseUp' . | xargs sed -i '' -e 's/NSRightMouseUp/NSEventTypeRightMouseUp/g'
rg -l 'NSRightTextAlignment' . | xargs sed -i '' -e 's/NSRightTextAlignment/NSTextAlignmentRight/g'
rg -l 'NSScrollWheelMask' . | xargs sed -i '' -e 's/NSScrollWheelMask/NSEventMaskScrollWheel/g'
rg -l 'NSScrollWheel' . | xargs sed -i '' -e 's/NSScrollWheel/NSEventTypeScrollWheel/g'
rg -l 'NSShiftKeyMask' . | xargs sed -i '' -e 's/NSShiftKeyMask/NSEventModifierFlagShift/g'
rg -l 'NSSmallControlSize' . | xargs sed -i '' -e 's/NSSmallControlSize/NSControlSizeSmall/g'
rg -l 'NSTabletPointEventSubtype' . | xargs sed -i '' -e 's/NSTabletPointEventSubtype/NSEventSubtypeTabletPoint/g'
rg -l 'NSTitledWindowMask' . | xargs sed -i '' -e 's/NSTitledWindowMask/NSWindowStyleMaskTitled/g'
```

Then I removed changes to third-party webrtc code, removed a comment in accessible/mac/mozAccessible.mm,
and performed some manual replacements in native_mouse_mac_window.xhtml.

Differential Revision: https://phabricator.services.mozilla.com/D100260
2021-01-05 21:17:11 +00:00
Eitan Isaacson ca8fda7434 Bug 1681909 - P1: Add IPC stubs for ApplyPostSearchFilter. r=morgan,ipc-reviewers,mccr8
Applying a bulk filter on accessibles in content process allows us to avoid a potentially large (and variable) number of IPC sync calls to retrieve the accessible names. I chose to implement this as a "post filter" and not to actually do the entire search in content because it would cause a lot of duplication of code for non-IPC searching, and we wouldn't have the flexibility to combine a text search with any arbitrary search key as the API requires.

I also generalized the RangeTypes.h header to PlatformExtTypes so it can be used to define filter types as well.

Differential Revision: https://phabricator.services.mozilla.com/D100730
2021-01-05 20:35:22 +00:00
Cosmin Sabou 2978aa00a3 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam 775cdec032 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Masayuki Nakano 44dced1d87 Bug 1683226 - part 13: Get rid of `nsIWidget::StartPluginFocused()` r=m_kato,ipc-reviewers,mccr8
Depends on D100386

Differential Revision: https://phabricator.services.mozilla.com/D100387
2020-12-24 02:46:46 +00:00
Paul Bone 81d936b141 Bug 1683031 - pt 5. Add an assertion and document idle request IDs r=smaug
Add assertions and comments to explain the behaviour/use of the idle request
IDs.

Depends on D99330

Differential Revision: https://phabricator.services.mozilla.com/D100300
2020-12-22 17:56:46 +00:00
Paul Bone df9efaa79e Bug 1683031 - pt 4. IdleScheduler may now schedule multiple items from a loop r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D99330
2020-12-22 18:07:11 +00:00
Paul Bone 8a3d9b81f9 Bug 1683031 - pt 3. Use a single linked list for idle task queues r=smaug
This refactoring will make the following patches make more sense.

Differential Revision: https://phabricator.services.mozilla.com/D99329
2020-12-22 03:25:50 +00:00
Paul Bone 15aba2b8b9 Bug 1683031 - pt 2. Remove unused variable r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D97715
2020-12-22 03:25:47 +00:00
Paul Bone 3fa07a963a Bug 1683031 - pt 1. Fix some comments in IdleSchedulerParent.cpp r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D97714
2020-12-22 03:25:38 +00:00
Simon Giesecke 9758d919eb Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-17 14:58:18 +00:00
Masatoshi Kimura 3424a95ee0 Bug 1682103 - Make nsContentPolicyType a CEnum type. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D99580
2020-12-16 11:36:47 +00:00
Csoregi Natalia d8c9489b13 Backed out changeset 16d174e7c342 (bug 1583109) for bustage on nsReadableUtils.h. CLOSED TREE 2020-12-16 22:51:26 +02:00
Simon Giesecke 72babae175 Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-16 19:38:23 +00:00
Bryce Seager van Dyk 5c6194a73d Bug 1671246 - Use a union to pass NodeId in GMP. r=jbauman,ipc-reviewers,nika
Passing a union here allows us to reuse code and trim some code which was
duplicated to handle the different NodeId formats. This also consolidates the
former `NodeId` and `NodeIdData` structures into a new structure (working name
`NodeIdParts`) which represents parts that will later be converted to a string
based NodeId.

Differential Revision: https://phabricator.services.mozilla.com/D93569
2020-12-16 16:15:01 +00:00
Simon Giesecke 4cab6ac723 Bug 1677466 - Move ParamTraits specializations with extra dependencies out of IPCMessageUtils.h. r=mccr8
This moves parts of IPCMessageUtils.h to two new header files and adapts
the include directives as necessary. The new header files are:
- EnumSerializer.h, which defines the templates for enum serializers
- IPCMessageUtilsSpecializations.h, which defines template specializations
  of ParamTraits with extra dependencies (building upon both IPCMessageUtils.h
  and EnumSerializer.h)

This should minimize the dependencies pulled in by every consumer of
IPCMessageUtils.h

Differential Revision: https://phabricator.services.mozilla.com/D94459
2020-12-10 11:09:21 +00:00
Markus Stange f60ad7ffdd Bug 1679838 - Rename "Gecko_IOThread" to "IPC I/O Parent" and "Chrome_ChildThread" to "IPC I/O Child". r=jld
Depends on D97082

Differential Revision: https://phabricator.services.mozilla.com/D98210
2020-12-03 00:06:02 +00:00
Markus Stange ecf3a22d4d Bug 1677321 - Annotate the idle stack in MessagePumpLibevent::Run with the profiler IDLE category. r=jld
Also annotate non-idle work that's called inside MessagePumpLibevent::Run with
the OTHER category.

Differential Revision: https://phabricator.services.mozilla.com/D97082
2020-12-03 00:06:15 +00:00
Simon Giesecke 1c53236b70 Bug 1679272 - Include ScopeExit.h exactly where used. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98888
2020-12-07 14:25:59 +00:00
Karl Tomlinson 88c7f3ad66 Bug 1119956 derive from DiscardableRunnable instead of CancelableRunnable when Cancel() is not supported r=asuth,sg
Differential Revision: https://phabricator.services.mozilla.com/D98118
2020-12-03 09:04:44 +00:00
Tom Tung 80a5716001 Bug 1656768 - Propagate SessionStorage data in BackgroundSessionStorageManager to the new top browsing context while replacing the top context id; r=nika,dom-workers-and-storage-reviewers,asuth
### Story

While the exisiting top browsing context is replaced, SessionStorage relies on
itself been propagated by SessionStore. However, this has been disabled in
SessionHistory in the parent process.

Therefore, we need to propagate SessionStorage data by propagating
BackgroundSessionStorageManager.

### Notes

This patch assumes that the target top-level browsing context shouldn't have
been registered to BackgroundSessionStorageManager. If this can happen, we will
either need to merge SessionStorage data into it or find a proper (earlier)
place to update sManagers.

### Test Plan

Test: D97763
Try: https://treeherder.mozilla.org/jobs?repo=try&revision=2acc7b393fb80b640f4fbe3ade1da7dd440c380e&selectedTaskRun=KK6XhR-sQuqv5lcntVLc2w.0

Differential Revision: https://phabricator.services.mozilla.com/D98082
2020-12-03 14:19:35 +00:00
Karl Tomlinson fe53cdd395 Bug 1119956 introduce DiscardableRunnable for tasks that might not run but might not implement cancellation r=asuth,sg
Classes that inherit from DiscardableRunnable are only promising that it is OK
for Run() to be skipped, rather than promising that Cancel() is effective.

Differential Revision: https://phabricator.services.mozilla.com/D98117
2020-12-02 09:36:25 +00:00
Robert Mader 529f433f65 Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
To allow `requestAnimationFrame()` and similar things to run at monitor
speed if there is only a window-specific vsyncsource available.
This is the case for Wayland and, in the future, EGL/X11. Other backends
may opt for window specific vsyncsources as well at some point.

The idea is to, instead of using global vsync objects, expose a vsyncsource
from nsWindow and use it for refresh drivers. For the content process, move
VsyncChild to BrowserChild, so for each Browserchild there is only one
VsyncChild to which all refresh drivers connect.

IPC in managed either by PBrowser or PBackground. Right now, PBrowser is
only used on Wayland, as both PBrowser and the Wayland vsyncsource run
on the main thread. Other backends keep using the background thread for
now.

While at it, make it so that we constantly update the refresh rate. This
is necessary for Wayland, but also on other platforms variable refresh rates
are increasingly common. Do that by transimitting the vsync rate `SendNotify()`.

How to test:
 - run the Wayland backend
 - enable `widget.wayland_vsync.enabled`
 - optionally: disable `privacy.reduceTimerPrecision`
 - run `vsynctester.com` or `testufo.com`

Expected results:
Instead of fixed 60Hz, things should update at monitor refresh rate -
e.g. 144Hz

Original patch by Kenny Levinsen.

Depends on D98254

Differential Revision: https://phabricator.services.mozilla.com/D93173
2020-12-02 09:47:53 +00:00
Haik Aftandilian ba86698ecc Bug 1678445 - Crash related to Widevine playback on macOS 11 with Apples Silicon/arm64 r=jld,bryce
When using an x64 GMP child process with an arm64 parent process on arm64 Mac's, use a 16k Shmem pagesize in the child process.

Differential Revision: https://phabricator.services.mozilla.com/D98241
2020-12-01 19:05:20 +00:00
Thinker Li 56aff226ee Bug 1667183 - Restart fork server on error. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D91385
2020-12-01 13:43:52 +00:00
Narcis Beleuzu 012f0b504c Backed out 2 changesets (bug 1645528) for wdspec failures on user_prompts.py CLOSED TREE
Backed out changeset 986bd930bab7 (bug 1645528)
Backed out changeset 2fbe8c11cecb (bug 1645528)
2020-11-30 06:08:18 +02:00
Robert Mader 5ccb38b25c Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
To allow `requestAnimationFrame()` and similar things to run at monitor
speed if there is only a window-specific vsyncsource available.
This is the case for Wayland and, in the future, EGL/X11. Other backends
may opt for window specific vsyncsources as well at some point.

The idea is to, instead of using global vsync objects, expose a vsyncsource
from nsWindow and use it for refresh drivers. For the content process, move
VsyncChild to BrowserChild, so for each Browserchild there is only one
VsyncChild to which all refresh drivers connect.

IPC in managed either by PBrowser or PBackground. Right now, PBrowser is
only used on Wayland, as both PBrowser and the Wayland vsyncsource run
on the main thread. Other backends keep using the background thread for
now.

While at it, make it so that we constantly update the refresh rate. This
is necessary for Wayland, but also on other platforms variable refresh rates
are increasingly common. Do that by transimitting the vsync rate `SendNotify()`.

How to test:
 - run the Wayland backend
 - enable `widget.wayland_vsync.enabled`
 - optionally: disable `privacy.reduceTimerPrecision`
 - run `vsynctester.com` or `testufo.com`

Expected results:
Instead of fixed 60Hz, things should update at monitor refresh rate -
e.g. 144Hz

Original patch by Kenny Levinsen.

Differential Revision: https://phabricator.services.mozilla.com/D93173
2020-11-29 19:13:40 +00:00
Bogdan Tara 7d0503248d Backed out 2 changesets (bug 1645528) for scroll related mochitest failures CLOSED TREE
Backed out changeset 08cd8d747c33 (bug 1645528)
Backed out changeset 4bc8953d9bed (bug 1645528)
2020-11-28 04:21:50 +02:00
Robert Mader 0d501f3c38 Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
To allow `requestAnimationFrame()` and similar things to run at monitor
speed if there is only a window-specific vsyncsource available.
This is the case for Wayland and, in the future, EGL/X11. Other backends
may opt for window specific vsyncsources as well at some point.

The idea is to, instead of using global vsync objects, expose a vsyncsource
from nsWindow and use it for refresh drivers. For the content process, move
VsyncChild to BrowserChild, so for each Browserchild there is only one
VsyncChild to which all refresh drivers connect.

IPC in managed either by PBrowser or PBackground. Right now, PBrowser is
only used on Wayland, as both PBrowser and the Wayland vsyncsource run
on the main thread. Other backends keep using the background thread for
now.

While at it, make it so that we constantly update the refresh rate. This
is necessary for Wayland, but also on other platforms variable refresh rates
are increasingly common. Do that by transimitting the vsync rate `SendNotify()`.

How to test:
 - run the Wayland backend
 - enable `widget.wayland_vsync.enabled`
 - optionally: disable `privacy.reduceTimerPrecision`
 - run `vsynctester.com` or `testufo.com`

Expected results:
Instead of fixed 60Hz, things should update at monitor refresh rate -
e.g. 144Hz

Original patch by Kenny Levinsen.

Differential Revision: https://phabricator.services.mozilla.com/D93173
2020-11-27 23:33:18 +00:00
Noemi Erli c5213774a6 Backed out changeset 3a9dce735340 (bug 1645528) for causing crashes with nsRefreshDriver CLOSED TREE 2020-11-26 22:57:56 +02:00
Robert Mader a84aa40ad4 Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
To allow `requestAnimationFrame()` and similar things to run at monitor
speed if there is only a window-specific vsyncsource available.
This is the case for Wayland and, in the future, EGL/X11. Other backends
may opt for window specific vsyncsources as well at some point.

The idea is to, instead of using global vsync objects, expose a vsyncsource
from nsWindow and use it for refresh drivers. For the content process, move
VsyncChild to BrowserChild, so for each Browserchild there is only one
VsyncChild to which all refresh drivers connect.

IPC in managed either by PBrowser or PBackground. Right now, PBrowser is
only used on Wayland, as both PBrowser and the Wayland vsyncsource run
on the main thread. Other backends keep using the background thread for
now.

While at it, make it so that we constantly update the refresh rate. This
is necessary for Wayland, but also on other platforms variable refresh rates
are increasingly common. When using PVsync, limit updates to once in every
250ms in order to minimize overhead while still updating fast.

How to test:
 - run the Wayland backend
 - enable `widget.wayland_vsync.enabled`
 - optionally: disable `privacy.reduceTimerPrecision`
 - run `vsynctester.com` or `testufo.com`

Expected results:
Instead of fixed 60Hz, things should update at monitor refresh rate -
e.g. 144Hz

Original patch by Kenny Levinsen.

Differential Revision: https://phabricator.services.mozilla.com/D93173
2020-11-26 19:15:04 +00:00
Narcis Beleuzu efbd3dc42f Backed out 2 changesets (bug 1645528) for leakcheck failures on nsTArray. CLOSED TREE
Backed out changeset df3577321bfe (bug 1645528)
Backed out changeset fbc13c3ea551 (bug 1645528)
2020-11-25 02:59:47 +02:00