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

6528 Коммитов

Автор SHA1 Сообщение Дата
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
Robert Mader d2fe090741 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-24 23:47:54 +00:00
Narcis Beleuzu 0d0dc5c19a Backed out changeset 1f42c376724d (bug 1645528) for leakcheck failures on nsTArray. CLOSED TREE 2020-11-25 01:28:12 +02:00
Robert Mader 5f53d70c95 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-24 22:20:35 +00:00
Magnus Melin 75d02b4702 Bug 1679148 - declare template for ParamTraits, so that Thunderbird builds succeed. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D97926
2020-11-24 14:44:29 +00:00
Simon Giesecke dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Simon Giesecke d10d03d076 Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96556

Depends on D96554
2020-11-23 16:10:41 +00:00
Simon Giesecke ae75be244a Bug 1677466 - Split Endpoint.h and ProtocolMessageUtils.h from ProtocolUtils.h. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D93568

Depends on D93567
2020-11-23 16:06:42 +00:00
Simon Giesecke fdf6246294 Bug 1677466 - Remove unnecessary includes from MessageChannel.h and MessageLink.h. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D93567

Depends on D93564
2020-11-23 16:06:24 +00:00
Simon Giesecke dc800202a2 Bug 1660470 - Split SerializedStructuredCloneBuffer.h from IPCMessageUtils.h. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93550

Depends on D93546
2020-11-23 16:05:26 +00:00
Simon Giesecke 5b3084384e Bug 1660470 - Move void_t/null_t to a new IPCCore.h header. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93546

Depends on D93544
2020-11-23 16:05:20 +00:00
Simon Giesecke 16b9f61991 Bug 1660470 - Avoid including ProtocolUtils.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93544

Depends on D93543
2020-11-23 16:05:07 +00:00
Simon Giesecke c902104cdb Bug 1660470 - Split ShmemMessageUtils.h from Shmem.h. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93543

Depends on D93321
2020-11-23 16:05:02 +00:00
Simon Giesecke dfef212e61 Bug 1660470 - Move IPDLParamTraits for FileDescriptor out of FileDescriptor.h. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93321

Depends on D93248
2020-11-23 16:04:55 +00:00
Simon Giesecke c077183836 Bug 1660470 - Avoid including IPCMessageUtils.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93235

Depends on D93234
2020-11-23 16:03:47 +00:00
Simon Giesecke 93dd261db8 Bug 1660470 - Include C++ header files only from cpp file. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93233

Depends on D87865
2020-11-23 16:03:32 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Simon Giesecke 8953086494 Bug 1677284 - Move PackingStrategy::Variant implementation to separate header file. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D97075
2020-11-23 15:49:14 +00:00
Gerald Squelart a56d00ddb7 Bug 1678159 - Move WritePropertyTime to SpliceableJSONWriter::TimeProperty - r=gregtatum
TimeStamps in markers must now be streamed through `SpliceableJSONWriter::TimeProperty(name, timestamp)`.
This is consistent with all other JSON-writing functions being in `SpliceableJSONWriter` (and base class `JSONWriter`).

Depends on D97556

Differential Revision: https://phabricator.services.mozilla.com/D97557
2020-11-20 02:23:08 +00:00
Gerald Squelart 520450ccf0 Bug 1675406 - Don't record IPC markers if one of the profiler mutexes is locked on the current thread - r=canaltinova
Check `profiler_is_locked_on_current_thread()` before recording an IPC marker.

This removes the deadlock found in bug 1675406:
- SamplerThread: During sampling, some data is recorded into the profile buffer, which locks ProfileChunkedBuffer::mMutex, this triggers some chunk updates that are sent to ProfileBufferGlobalController, which attempts to lock its mutex.
- Main thread: An IPC with an update arrives, ProfileBufferGlobalController locks its mutex, then it sends an IPC out, this records a marker into ProfileChunkedBuffer, which attempts to lock its mMutex.
With this patch and bug 1671403, that last IPC will not record a marker anymore.

Differential Revision: https://phabricator.services.mozilla.com/D96971
2020-11-19 11:48:49 +00:00
Jean-Yves Avenard 66a250d472 Bug 1518344 - P1. Remove unnecessary promise allocation. r=jld
A MozPromise::Then() itself can be converted into a MozPromise.

Differential Revision: https://phabricator.services.mozilla.com/D96666
2020-11-12 23:17:21 +00:00
Gerald Squelart a10f7166db Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-18 21:55:51 +00:00
Gerald Squelart bfc0fb9f6d Bug 1675409 - Migrated IPCMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96050
2020-11-18 21:52:41 +00:00
Razvan Maries b7eeb731df Backed out 23 changesets (bug 1675409) for build bustages on Preferences.cpp. CLOSED TREE
Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
2020-11-18 20:06:28 +02:00
Sylvestre Ledru bebb9f9181 Bug 1519636 - Reformat with clang-format-11 to the Google coding style r=andi,sg,geckoview-reviewers,snorp
It is bringing some minor changes

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90795
2020-11-18 09:05:59 +00:00
Gerald Squelart 9506ea6302 Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-17 22:25:06 +00:00
Gerald Squelart f17a3dc5aa Bug 1675409 - Migrated IPCMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96050
2020-11-17 22:22:01 +00:00
Mihai Alexandru Michis c0d25b01b2 Backed out 24 changesets (bug 1666566, bug 1675409) for causing hazard failures in profiler/core/platform.cpp
CLOSED TREE

Backed out changeset 4d8af8533fd4 (bug 1666566)
Backed out changeset f031a3a8a20f (bug 1675409)
Backed out changeset 2b7e1a031921 (bug 1675409)
Backed out changeset bda5a24b2d0a (bug 1675409)
Backed out changeset 4282e2284314 (bug 1675409)
Backed out changeset 0637f1b26e9f (bug 1675409)
Backed out changeset 67ae04c8f607 (bug 1675409)
Backed out changeset 6c7b3f3618ef (bug 1675409)
Backed out changeset 2f325c22d169 (bug 1675409)
Backed out changeset 1e48ff70ad8f (bug 1675409)
Backed out changeset 1dfc32d6871d (bug 1675409)
Backed out changeset 4f1f218a777b (bug 1675409)
Backed out changeset e6ac8722b38e (bug 1675409)
Backed out changeset cf132e15fb57 (bug 1675409)
Backed out changeset a126e6b00ba9 (bug 1675409)
Backed out changeset fbc7fbb04f33 (bug 1675409)
Backed out changeset 554c69681474 (bug 1675409)
Backed out changeset 44d0521c701f (bug 1675409)
Backed out changeset 04653dfe4720 (bug 1675409)
Backed out changeset 41ca2c043a00 (bug 1675409)
Backed out changeset 264ae4c805d4 (bug 1675409)
Backed out changeset 5f3bbdac0d52 (bug 1675409)
Backed out changeset 11311c11a6e8 (bug 1675409)
Backed out changeset 0355fbc44baf (bug 1675409)
2020-11-17 19:31:28 +02:00
Gerald Squelart e89990aa2c Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-17 11:39:42 +00:00
Gerald Squelart 878bf41da1 Bug 1675409 - Migrated IPCMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96050
2020-11-17 11:36:32 +00:00
Sylvestre Ledru 0129dd3f83 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D96608
2020-11-16 22:09:25 +00:00
Aaron Klotz dba13b1668 Bug 1674452: Add interface information to ORPC profiler markers; r=Jamie
* We add a new function to `mscom/Utils.h`: `DiagnosticNameForIID`. Its
  purpose is to generate a friendly name for an interface, given an IID.
  For special interfaces internal to COM, we add our own descriptive strings.
  If the interface does not have a description, we simply convert the IID
  to string format using GUIDToString.
* We modify `ProfilerMarkerChannelHook` to include the additional diagnostic
  information for IIDs in its markers.
* Since each marker is now differentiated by IID, we remove the restriction
  that we only use markers for the outermost COM call. In particular, this
  assumption doesn't hold for asynchronous COM calls, so we would be losing
  data in the case where an async call was pending while the main thread was
  still making COM calls on other interfaces.
  * There isn't really an effective way to distinguish between sync and
    async calls at the channel hook layer. I'm thinking about how we could
    perhaps modify `AsyncInvoker` to help mark these, but it's a bit messy.
    I'm going to postpone that to future work.
* Other potential future work is expanding the number of interfaces for which
  we have frendly names. I could see us annotating our various COM interfaces
  in a way that we could automagically generate human-readable descriptions for
  those interfaces.

Differential Revision: https://phabricator.services.mozilla.com/D97042
2020-11-16 19:50:42 +00:00
Aaron Klotz 3c1fe406d7 Bug 1677212: Improved aIsProxy handling within mscom::AsyncInvoker; r=Jamie
I realized that calling `mscom::IsProxy` is kind of redundant when we already
need to query for `ICallFactory`.

We still allow `aIsProxy` as an optional constructor argument, but if not
present then we go straight to `QueryInterface(IID_ICallFactory)`.

Differential Revision: https://phabricator.services.mozilla.com/D97047
2020-11-16 01:19:54 +00:00
Olli Pettay ba16304298 Bug 1676984 - Make IdleScheduler to use CollectProcessInfo to access cpucount, r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D96947
2020-11-13 22:10:18 +00:00
Jean-Yves Avenard 96a9f35dcd Bug 1672072 - P10. Promisify launch of RDD process and remove sync dispatch. r=mattwoodrow,bryce,mjf,padenot
Differential Revision: https://phabricator.services.mozilla.com/D96366
2020-11-13 04:21:16 +00:00
Jean-Yves Avenard 44ad5e249a Bug 1672072 - P9. Make EnsureRDDProcessAndCreateBridge an async API. r=mattwoodrow,bryce,mjf,padenot,ipc-reviewers,mccr8
We can now chaincreation of the decoder to the launch of the RDD process as needed and setting up the PRemoteDecoderManager

Differential Revision: https://phabricator.services.mozilla.com/D96365
2020-11-13 04:21:16 +00:00
Jean-Yves Avenard 6d2df84e41 Bug 1672072 - P8. Create decoder asynchronously. r=mattwoodrow,bryce,padenot,mjf,ipc-reviewers,mccr8
PDMFactory::CreateDecoder is changed to return a MozPromise that will contain the MediaDataDecoder once created.

This will allow to later make RemoteDecoderManager fully asynchronous and no longer require an IPC sync call to start the RDD process.

We also modify the WebrtcMediaDataDecoderCodec to never create a decoder on the main thread, which could cause deadlocks under some circumstances.

Differential Revision: https://phabricator.services.mozilla.com/D96364
2020-11-13 07:46:44 +00:00
Bogdan Tara 266d9ad46c Backed out 13 changesets (bug 1672072) for short.mp4.firstframe.html failures CLOSED TREE
Backed out changeset f093b7969e8b (bug 1672072)
Backed out changeset 28db8276ec2b (bug 1672072)
Backed out changeset ff8fe1b856b3 (bug 1672072)
Backed out changeset 091b9449c786 (bug 1672072)
Backed out changeset 89d9a12c0737 (bug 1672072)
Backed out changeset 9cb71fd4b43b (bug 1672072)
Backed out changeset 09adad7416e1 (bug 1672072)
Backed out changeset 9905650335ef (bug 1672072)
Backed out changeset 6f1d99e9c3a1 (bug 1672072)
Backed out changeset b59655b7a595 (bug 1672072)
Backed out changeset 1ef9d6d10508 (bug 1672072)
Backed out changeset fbf0b5117655 (bug 1672072)
Backed out changeset 65cd3b9de5c6 (bug 1672072)
2020-11-13 06:13:22 +02:00
Jean-Yves Avenard 4cbbb3b157 Bug 1672072 - P10. Promisify launch of RDD process and remove sync dispatch. r=mattwoodrow,bryce,mjf,padenot
Differential Revision: https://phabricator.services.mozilla.com/D96366
2020-11-12 22:53:59 +00:00
Jean-Yves Avenard 8ffdd4eaef Bug 1672072 - P9. Make EnsureRDDProcessAndCreateBridge an async API. r=mattwoodrow,bryce,mjf,padenot,ipc-reviewers,mccr8
We can now chaincreation of the decoder to the launch of the RDD process as needed and setting up the PRemoteDecoderManager

Differential Revision: https://phabricator.services.mozilla.com/D96365
2020-11-12 22:53:49 +00:00
Jean-Yves Avenard 7a6315ba80 Bug 1672072 - P8. Create decoder asynchronously. r=mattwoodrow,bryce,padenot,mjf,ipc-reviewers,mccr8
PDMFactory::CreateDecoder is changed to return a MozPromise that will contain the MediaDataDecoder once created.

This will allow to later make RemoteDecoderManager fully asynchronous and no longer require an IPC sync call to start the RDD process.

We also modify the WebrtcMediaDataDecoderCodec to never create a decoder on the main thread, which could cause deadlocks under some circumstances.

Differential Revision: https://phabricator.services.mozilla.com/D96364
2020-11-12 22:53:31 +00:00
Nika Layzell 630f9192f8 Bug 1676223 - Use ActorLifecycleProxy instead of WeakPtr for async returns, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D96454
2020-11-12 17:59:03 +00:00
Jan Varga 03e0a91794 Bug 1669437 - Add necessary infrastructure for independent in-memory only local storage database; r=asuth,dom-workers-and-storage-reviewers
The new infrastructure consists of a separate bridge between the content and the
parent process and a separate local storage database in the parent process.
The new infrastructure can be used for storing and sharing of private browsing
data across content processes.
This patch only creates necessary infrastructure, actual enabling of storing and
sharing of data across content processes will be done in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D96562
2020-11-11 13:12:57 +00:00
Haik Aftandilian 0c4a7d9835 Bug 1675441 - Use an x64 Widevine GMP Process for Apple Silicon Native Builds r=bryce,spohl
When running as a "universal" build, use an x64 GMP child process if the CDM library is an x64 binary.

Use ifdefs extensively to reduce risk to Intel builds if the fix needs to be uplifted.

Requires a server-side balrog change to serve an Intel Widevine binary to ARM browser versions.

Differential Revision: https://phabricator.services.mozilla.com/D96288
2020-11-11 02:37:57 +00:00
Andreas Farre c208b33fc0 Bug 1646474 - Remove LoadInfo::mDocumentHasLoaded. r=nika,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96010
2020-11-10 12:45:22 +00:00
Markus Stange 81ba35b3f7 Bug 1675828 - Call OtherPidMaybeInvalid for the IPC marker because this code can run at times when the other pid is not known. r=jld
This avoids a crash from the MOZ_RELEASE_ASSERT in OtherPid() on Android.

Differential Revision: https://phabricator.services.mozilla.com/D96262
2020-11-10 01:45:51 +00:00
Brindusan Cristian 030df1b5cf Backed out changeset 98b994baee88 (bug 1676223) for build bustages at PChromiumCDMChild.cpp. CLOSED TREE 2020-11-10 01:59:18 +02:00
Nika Layzell 2d9159f48c Bug 1676223 - Use ActorLifecycleProxy instead of WeakPtr for async returns, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D96454
2020-11-09 23:29:20 +00:00
julianwels 2efbb0d597 Bug 1674926 - Collect telemetry for mixed display content upgrades. r=necko-reviewers,ckerschb,valentin
Differential Revision: https://phabricator.services.mozilla.com/D95921
2020-11-09 14:40:30 +00:00
Mike Hommey 53fee2f4c4 Bug 1675437 - Use preprocessor to create Info.plist files. r=firefox-build-system-reviewers,mhentges
While we're in the vicinity, change the manual preprocessing of
Info.plist.in to uses of the preprocessor.

Differential Revision: https://phabricator.services.mozilla.com/D96014
2020-11-05 15:03:47 +00:00
Mike Hommey ead183252e Bug 1675437 - Avoid using iconv to create InfoPlist.strings. r=firefox-build-system-reviewers,mhentges
Since python creates little-endian utf-16 consistently whether
cross-compiling from Linux or compiling natively on macOS, we could
write a small script that essentially replaces iconv. On the other hand,
we're also doing some manual preprocessing on the InfoPlist.strings.in
files, and we might as well use the preprocessor for that.

So, we augment the preprocessor to allow an explicit output encoding
other than utf-8, and use the preprocessor instead of `sed | iconv`.

Differential Revision: https://phabricator.services.mozilla.com/D96013
2020-11-05 15:07:30 +00:00
Aaron Klotz 0a1730e26a Bug 1675118: Add a variant of mscom::AsyncInvoker that supports posting completion runnables; r=Jamie
I need this for some changes I want to make to Win32 file pickers.

* We add an event-driven variant to `mscom::AsyncInvoker`. When the async call
  invokes `ISynchronize::Signal`, we post an event to the specified event
  target (or implicitly to the main thread).
* For this to work, the async call needs to temporarily retain a reference to
  itself, otherwise the async call object is destroyed and the in-flight call
  is cancelled. This reference is stored in an "outer runnable" which is
  responsible for executing the inner completion runnable, and then dropping
  the self-reference.
* We only run the completion runnable upon *successful* initiation of the async
  call. If there was a failure, we return that code immediately to the caller.
  Failures also clear the reference to the completion runnable.
* If we could not obtain an async interface and must run synchronously, then
  we run the completion runnable immediately after a successful synchronous
  invocation.

Differential Revision: https://phabricator.services.mozilla.com/D95808
2020-11-05 18:59:12 +00:00
Aaron Klotz d6adf2ddf1 Bug 1674904: Part 3 - Replace dll reg code in mscom/oop/Handler with calls to mscom/oop/Module; r=Jamie
`Handler` should now delegate its registration to `Module`.

Differential Revision: https://phabricator.services.mozilla.com/D95608
2020-11-04 22:11:23 +00:00
Aaron Klotz 87fbdfd39e Bug 1674904: Part 2 - New dll registration code in mscom/oop/module; r=Jamie
We add new DLL registration code. This is a rather generic function that
permits the following:

* Registering multiple `CLSID`s for the same DLL;
* Registering an optional `AppID`. Registering an `AppID` allows us to use a
  `DllSurrogate` to host the DLL out-of-process using Windows' built-in
  `dllhost.exe`. I'll be using this feature in a future bug.
* Supporting all available threading modelsl;
* Capable of registering either inproc servers or inproc handlers;
* Using the transaction-based registry API so that we can cleanly rollback
  during registration if any part(s) of it fail.

Differential Revision: https://phabricator.services.mozilla.com/D95606
2020-11-04 21:49:46 +00:00
Aaron Klotz 99bc464a75 Bug 1674904: Part 1 - Change mscom registration to dynamically link to GetProxyDllInfo when built outside of xul; r=Jamie
We need this so that the registration code is more versatile and may be linked
from outside of xul.

Differential Revision: https://phabricator.services.mozilla.com/D95605
2020-11-04 21:49:28 +00:00
Aaron Klotz f53b856004 Bug 1675370: Mark /ipc/mscom as exclusive to Windows; r=firefox-build-system-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D95925
2020-11-04 21:40:04 +00:00
Dorel Luca e3198dde0a Backed out 4 changesets (bug 1674904) for Build bustage in worker/checkouts/gecko/config/rules.mk. CLOSED TREE
Backed out changeset 50576e0fbd98 (bug 1674904)
Backed out changeset b3b7d68c33f6 (bug 1674904)
Backed out changeset 660cdea23685 (bug 1674904)
Backed out changeset 7322c3af8006 (bug 1674904)
2020-11-04 23:20:51 +02:00
Aaron Klotz 5d88574f69 Bug 1674904: Part 3 - Replace dll reg code in mscom/oop/Handler with calls to mscom/oop/Module; r=Jamie
`Handler` should now delegate its registration to `Module`.

Differential Revision: https://phabricator.services.mozilla.com/D95608
2020-11-04 20:40:31 +00:00
Aaron Klotz a4a05e12e3 Bug 1674904: Part 2 - New dll registration code in mscom/oop/module; r=Jamie
We add new DLL registration code. This is a rather generic function that
permits the following:

* Registering multiple `CLSID`s for the same DLL;
* Registering an optional `AppID`. Registering an `AppID` allows us to use a
  `DllSurrogate` to host the DLL out-of-process using Windows' built-in
  `dllhost.exe`. I'll be using this feature in a future bug.
* Supporting all available threading modelsl;
* Capable of registering either inproc servers or inproc handlers;
* Using the transaction-based registry API so that we can cleanly rollback
  during registration if any part(s) of it fail.

Differential Revision: https://phabricator.services.mozilla.com/D95606
2020-11-04 20:46:30 +00:00
Aaron Klotz 08047a8d78 Bug 1674904: Part 1 - Change mscom registration to dynamically link to GetProxyDllInfo when built outside of xul; r=Jamie
We need this so that the registration code is more versatile and may be linked
from outside of xul.

Differential Revision: https://phabricator.services.mozilla.com/D95605
2020-11-04 20:39:57 +00:00
Jean-Yves Avenard c938c7416c Bug 1674043 - P6. Remove sync PDecoderMananger::Supports API. r=mattwoodrow,bryce,mjf,ipc-reviewers,nika
In bug 1595994 we attempted to streamline the ability to determine which decoder was available regardless of the process they would be running in. This was subsequently done via the PDMFactory.

As there are several JS API that can query which codec are supported, it requires a synchronous mechanism.
This allowed to make a determination during the PlatformDecoderModule::Supports call, depending on which process it was going to be called frome.

Having a synchronous IPC call to the RemoteDecoderManagerParent has too many caveats to be workable.
So what we do instead is first determine at launch if the required external framework are available and pass this information to each content process.

When checking if a decoder is available, we make a best guess at determining if the PDM would support such codec, without actually loading such framework when running in the content process.

Supports can no longer make a decision based on the process currently running and as such PDM::CreateAudio/VideoDecoder using an optional system framework now need to further check the validity of the CreateDecoderParam argument.

Differential Revision: https://phabricator.services.mozilla.com/D95245
2020-11-04 02:22:33 +00:00
Aaron Klotz fd31cffe8e Bug 1674902: Part 5 - mscom::ActivationContext cleanup; r=Jamie
I just wanted to add a better explanation for what the magic `2` constant
is for.

Differential Revision: https://phabricator.services.mozilla.com/D95602
2020-11-03 16:55:07 +00:00
Aaron Klotz 9f37ad4cb5 Bug 1674902: Part 4 - Some mscom::ApartmentRegion cleanup; r=Jamie
Just some additional annotations

Differential Revision: https://phabricator.services.mozilla.com/D95601
2020-11-03 16:55:21 +00:00
Aaron Klotz 4baff096be Bug 1674902: Part 3 - Add IsCurrentThreadNonMainMTA to mscom/Utils.h; r=Jamie
This is a new check that I'd like to use in some future patches.

Differential Revision: https://phabricator.services.mozilla.com/D95599
2020-11-03 16:55:21 +00:00
Aaron Klotz 362d7078a2 Bug 1674902: Part 2 - Use CLSID_NULL instead of a distinct null CLSID; r=Jamie
Just a quick patch to reference an existing zeroed-out GUID instead of
instantiating a new one.

Differential Revision: https://phabricator.services.mozilla.com/D95598
2020-11-03 16:54:50 +00:00
Aaron Klotz d6a168786b Bug 1674902: Part 1 - s/uint32_t/long/ for return codes in mscom/Utils.h; r=Jamie
`HRESULT` is `typedef`'d as `long`, so this patch harmonizes the return codes.

Differential Revision: https://phabricator.services.mozilla.com/D95597
2020-11-03 16:54:48 +00:00
Cristina Coroiu ae74e57f04 Backed out 6 changesets (bug 1674902) for build bustage on a CLOSED TREE
Backed out changeset e4f63ba14348 (bug 1674902)
Backed out changeset 9f6e1866a7c3 (bug 1674902)
Backed out changeset a71e810d79d0 (bug 1674902)
Backed out changeset 071d1d593deb (bug 1674902)
Backed out changeset e88b258d7013 (bug 1674902)
Backed out changeset d1f72c3f70a0 (bug 1674902)
2020-11-03 17:47:35 +02:00
Aaron Klotz 2852676254 Bug 1674902: Part 6 - mscom::ActivationContext cleanup; r=Jamie
I just wanted to add a better explanation for what the magic `2` constant
is for.

Differential Revision: https://phabricator.services.mozilla.com/D95602
2020-11-03 02:53:33 +00:00
Aaron Klotz a89d1612fa Bug 1674902: Part 5 - Some mscom::ApartmentRegion cleanup; r=Jamie
Just some additional annotations

Depends on D95600

Differential Revision: https://phabricator.services.mozilla.com/D95601
2020-11-03 02:50:21 +00:00
Aaron Klotz 331db9d8d2 Bug 1674902: Part 4 - mscom/Ptr.h cleanup; r=Jamie
Some cleanup in our smart pointer stuff: Using `move` semantics lets us avoid
needing to hack around our static analysis.

Depends on D95599

Differential Revision: https://phabricator.services.mozilla.com/D95600
2020-11-03 02:45:39 +00:00
Aaron Klotz 3b4cad3543 Bug 1674902: Part 3 - Add IsCurrentThreadNonMainMTA to mscom/Utils.h; r=Jamie
This is a new check that I'd like to use in some future patches.

Depends on D95598

Differential Revision: https://phabricator.services.mozilla.com/D95599
2020-11-03 02:35:51 +00:00
Aaron Klotz fb52f1b26c Bug 1674902: Part 2 - Use CLSID_NULL instead of a distinct null CLSID; r=Jamie
Just a quick patch to reference an existing zeroed-out GUID instead of
instantiating a new one.

Depends on D95597

Differential Revision: https://phabricator.services.mozilla.com/D95598
2020-11-03 02:11:13 +00:00
Aaron Klotz 8e3b8ba2bb Bug 1674902: Part 1 - s/uint32_t/long/ for return codes in mscom/Utils.h; r=Jamie
`HRESULT` is `typedef`'d as `long`, so this patch harmonizes the return codes.

Differential Revision: https://phabricator.services.mozilla.com/D95597
2020-11-03 02:09:17 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Nika Layzell db195fbaa4 Bug 1670557 - Check for open channel in NotifyImpendingShutdown, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D94598
2020-10-24 01:05:49 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Andrew Osmond bc0f206cd6 Bug 1670939 - Make PImageBridge::WillClose async instead of sync. r=nical,ipc-reviewers,jld
Differential Revision: https://phabricator.services.mozilla.com/D93343
2020-10-23 18:29:15 +00:00
Perry Jiang 0e70329c0d Bug 1653470 - refcount PServiceWorkerRegistration r=dom-workers-and-storage-reviewers,asuth
Depends on D83884

Differential Revision: https://phabricator.services.mozilla.com/D83885
2020-10-23 11:52:49 +00:00
Perry Jiang 260415ed7c Bug 1653470 - refcount PServiceWorkerContainer r=dom-workers-and-storage-reviewers,asuth
Depends on D83883

Differential Revision: https://phabricator.services.mozilla.com/D83884
2020-10-23 11:51:24 +00:00
Perry Jiang bad3dff4d7 Bug 1653470 - refcount PServiceWorker r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D83883
2020-10-23 11:50:00 +00:00
Jed Davis cc6e7ab133 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-22 21:23:32 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Dorel Luca 5d3bd01bca Backed out 2 changesets (bug 1440203) for Backout conflicts with Bug 1654103. CLOSED TREE
Backed out changeset 6e44c037b2dc (bug 1440203)
Backed out changeset ab11665d8607 (bug 1440203)
2020-10-22 03:47:17 +03:00
Jed Davis 61a83c3467 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-21 23:34:46 +00:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Jean-Yves Avenard 47a23ae770 Bug 1595994 - P27. Remove redundant virtual keyword. r=mattwoodrow
Remove unnecessary virtual for method not used as such.

Depends on D93476

Differential Revision: https://phabricator.services.mozilla.com/D93709
2020-10-20 23:33:00 +00:00
Jean-Yves Avenard 6307ec0451 Bug 1595994 - P26. Simplify and rename RecvLaunchRDDProcess. r=mattwoodrow,nika,ipc-reviewers
And we remove unnecessary checks, BackgroundParent only run in the parent process and if e10s is on. Also RecvLauchRDDProcess will only ever be called if the rdd pref is on already.

By streamlining the call we also reduce the number of sync dispatch to 1.

Depends on D93317

Differential Revision: https://phabricator.services.mozilla.com/D93476
2020-10-20 23:32:57 +00:00
Jean-Yves Avenard d06384295b Bug 1595994 - P25. Have launch rdd be signalled over the PBackground channel. r=mattwoodrow,nika,ipc-reviewers
This remove the need for a sync dispatch to the main thread, that lead to deadlocks.

Depends on D93316

Differential Revision: https://phabricator.services.mozilla.com/D93317
2020-10-20 23:32:54 +00:00
Dan Glastonbury a70a2c09f1 Bug 1595994 - P7: Add Supports messages to PRemoteDecoderManager. r=kamidphish,nika,ipc-reviewers
Add a synchronous Supports message to the IPDL PRemoteDecoderManager protocol so
decoder modules can query for playback support in the actual process that will
attempt to do the decoding.

Depends on D54878

Differential Revision: https://phabricator.services.mozilla.com/D54879
2020-10-20 23:26:27 +00:00
Andrew McCreight 1425ce2012 Bug 1671577 - Use OtherPid() in AddProfilerMarker(). r=jld
Aside from its use in AddProfilerMarker(), after initialization mPeerPid
is only used on the IO thread, so the write to it does not hold the monitor.
This means that the read in AddProfilerMarker() can cause a race, even
though we hold the monitor. This method is only called when we hold
the monitor and everything is set up, so I think we can just use
mListener->OtherPid() to get the PID.

Differential Revision: https://phabricator.services.mozilla.com/D93810
2020-10-16 17:53:42 +00:00
Jed Davis 74dc0d9253 Bug 1609668 - Move 32k buffer in IPCStreamSource::DoRead to the heap to avoid stack overflow. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D92524
2020-10-12 21:38:30 +00:00
Ricky Stewart 362abcf949 Bug 1670357 - Remove `make` targets for cleaning: `clean`, `realclean`, `clobber`, `distclean`, `clobber_all`, `everything` r=firefox-build-system-reviewers,mhentges
The `clobber` targets are superseded by `mach clobber`, so we don't need them for any reason. The `clean` target is meant to get you to a post-`configure` state, but it doesn't really work, and if it's necessary for you to be in that state for some reason you can just clobber and re-`configure`, so it doesn't seem worth it to get it working again. Instead, delete all of them. Also delete `everything` which is not useful when `clobber` doesn't exist.

Differential Revision: https://phabricator.services.mozilla.com/D93514
2020-10-15 20:37:18 +00:00
Chris Martin e2f2de6530 Bug 1657404 - Change PGamepadTestChannel to "refcounted protocol" r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D93023
2020-10-14 20:33:55 +00:00
Chris Martin bcd28df3be Bug 1657404 - Prepare GamepadTestChannelChild for "refcounted protocol" r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D93022
2020-10-14 20:33:32 +00:00
Chris Martin 54487648eb Bug 1657404 - Prepare GamepadTestChannelParent for "refcounted protocol" r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D93021
2020-10-14 20:33:13 +00:00
Chris Martin eb0f286337 Bug 1657404 - Change PGamepadEventChannel to "refcounted protocol" r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D93119
2020-10-14 15:58:36 +00:00
Tom Tung 45a97b5b83 Bug 1654080 - Use PBackground for syncing SessionStorageCache and use LSWriteOptimizer to send data changes; r=dom-workers-and-storage-reviewers,janv,nika
This patch does:
- Use LSWriteOptimizer
- Remove SessionStorageService since it's unused.
- Move IPC from PContent to PBackground
(by SessionStorageManager{Child, Parent} and SessionStorageCache{Child, Parent}).
- Extract SessionStorageManagerBase and add PBackgroundSessionStorageManager.
- Expose a getter function to get a BackgroundParentManager for top context id
on the parent.

IPC
- Before this patch:
  - Copy from parent while loading a document.
    - Mark cache entry on the parent process as loaded by the child id.
  - Update change on checkpoint.
  - Unmark cache entry on the parent process as unloaded for the child id while
  the parent actor is destorying.
- After this patch:
  - Sync IPC load in the first SessionStorage operation.
  - Update change on checkpoint

`BackgroundSessionStorageManager`'s lifecycle on the parent process.
- Create by `SessionStorageManagerParent` and register to the `sManagers`.
- Hold by `SessionStorageManagerParent` and `sManagers`.
- Remove from the `sManagers` while the corresponding `BrowsingContext` is
destructed (on the parent process).

Depends on D89341

Differential Revision: https://phabricator.services.mozilla.com/D89342
2020-10-14 00:19:33 +00:00
Cameron McCormack cff9802c01 Bug 1656114 - Part 2: Add mozilla::BitSet. r=froydnj
Adding this to be used when the bit set needs to be sent across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D87186
2020-10-11 22:03:33 +00:00
Bas Schouten 25a1b0f61f Bug 1669256 - Part 1: Remove AbstractEventQueue and de-templatize ThreadEventQueue. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D92709
2020-10-09 17:56:34 +00:00
Razvan Maries 5fa72e54df Backed out 2 changesets (bug 1440203) for causing bug 1670277. CLOSED TREE
Backed out changeset 0b10bf76fe35 (bug 1440203)
Backed out changeset 468878422866 (bug 1440203)
2020-10-10 03:39:33 +03:00
Razvan Maries ea34810caa Backed out 4 changesets (bug 1657404) for perma failures on GamepadPlatformService.cpp. CLOSED TREE
Backed out changeset a79143c550d7 (bug 1657404)
Backed out changeset ae904c76b6cc (bug 1657404)
Backed out changeset b225f6a01afe (bug 1657404)
Backed out changeset e6e1924fb688 (bug 1657404)
2020-10-09 21:56:28 +03:00
Chris Martin 666018b3dd Bug 1657404 - Change PGamepadTestChannel to "refcounted protocol" r=handyman
Depends on D93022

Differential Revision: https://phabricator.services.mozilla.com/D93023
2020-10-09 16:42:30 +00:00
Chris Martin c1246c7e52 Bug 1657404 - Prepare GamepadTestChannelChild for "refcounted protocol" r=handyman
Depends on D93021

Differential Revision: https://phabricator.services.mozilla.com/D93022
2020-10-09 16:42:17 +00:00
Chris Martin ce23fd6cf4 Bug 1657404 - Prepare GamepadTestChannelParent for "refcounted protocol" r=handyman
Depends on D93019

Differential Revision: https://phabricator.services.mozilla.com/D93021
2020-10-09 16:42:09 +00:00
Jed Davis 3680ce4b19 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-08 02:25:20 +00:00
Chris Martin 079c0ec673 Bug 1658416 - Allow gamepad test channel to observe gamepad monitoring state r=handyman
Each existing GamepadTestChannel needs to know when gamepad monitoring is
started or stopped so it knows whether it's safe to deliver messages.

Differential Revision: https://phabricator.services.mozilla.com/D86747
2020-10-07 17:25:26 +00:00
Jed Davis 8805b6cb8f Bug 1662564 - Use RAII for the memory mapping in IPC base::SharedMemory, and default its constructors. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90602
2020-10-07 17:31:34 +00:00
Jed Davis 679d26c651 Bug 1662564 - Change IPC base::SharedMemory to use RAII for file descriptors/handles. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90601
2020-10-07 17:31:32 +00:00
Razvan Maries 75a5750a87 Backed out 5 changesets (bug 1662564, bug 1664922, bug 1440203) for Valgrind bustages. CLOSED TREE
Backed out changeset 9366b15ee97c (bug 1440203)
Backed out changeset bb512f5fdeda (bug 1440203)
Backed out changeset be90d6aec690 (bug 1664922)
Backed out changeset f6527a1d0f14 (bug 1662564)
Backed out changeset 3a2941fa7d4b (bug 1662564)
2020-10-07 08:38:13 +03:00
Jed Davis c4968e6653 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-06 19:20:29 +00:00
Jed Davis 1487466d5a Bug 1662564 - Use RAII for the memory mapping in IPC base::SharedMemory, and default its constructors. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90602
2020-10-06 19:36:21 +00:00
Jed Davis 262e21fc30 Bug 1662564 - Change IPC base::SharedMemory to use RAII for file descriptors/handles. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90601
2020-10-06 19:36:49 +00:00
sotaro 5d38dcb24c Bug 1668706 - Fix invalid handle handling of FileDescriptor::Clone() on Windows r=jld
It needs to check for both nullptr and INVALID_HANDLE_VALUE

Differential Revision: https://phabricator.services.mozilla.com/D92186
2020-10-06 00:16:43 +00:00
Dan Minor 45562522d9 Bug 1665166 - Updates to moz.build files; r=ng
Depends on D91318

Differential Revision: https://phabricator.services.mozilla.com/D91319
2020-09-24 18:40:21 +00:00
Eitan Isaacson 10d6dd02bc Bug 1661760 - Part 1: Unify all range from offset methods to one. r=morgan,nika
There are at least 8 different methods for getting a range from an offset:
1. left word
2. right word
3. line
4. left line
5. right line
6. sentence
7. paragraph
8. range with same style.

Having a single wrapper and IPDL method for all of those with an enum would remove
a lot of redundancies.

Differential Revision: https://phabricator.services.mozilla.com/D90936
2020-09-24 16:04:41 +00:00
Jean-Yves Avenard 6716cfb826 Bug 1664362. Use move semantics with IPC's MozPromise resolver. r=nika
We use C++14's generic lambdas and its auto&& type in the generated code, in combination with a typed local variable to ensure the argument type is enforced.

The object is moved as necessary, no copies will occur.

The code generated will now be:
  [this, self__, id__, seqno__](auto&& aParam) {
    if ((!(self__))) {
      NS_WARNING("Not resolving response because actor is dead.");
      return;
    }
    bool resolve__ = true;
    InitResultIPDL result = std::forward<decltype(aParam)>(aParam);
    IPC::Message* reply__ = PRemoteDecoder::Reply_Decode(id__);
    WriteIPDLParam(reply__, self__, resolve__);
    // Sentinel = 'resolve__'
    (reply__)->WriteSentinel(322044863);
    WriteIPDLParam(reply__, self__, std::move(result));
    // Sentinel = 'result'
    (reply__)->WriteSentinel(153223840);
    (reply__)->set_seqno(seqno__);
  }

For multiple arguments return, creation of Tuple via Tie is also moved, though currently Tie method doesn't support move semantics.

Differential Revision: https://phabricator.services.mozilla.com/D90090
2020-09-24 04:05:28 +00:00
Kris Maglione 061206b7f2 Bug 1646573: Part 3 - Fix OriginalFrameSrcLoad with DocumentChannel. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90341
2020-09-23 18:26:25 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Csoregi Natalia 951443150a Backed out changeset cd7ec0e4fea4 (bug 1646573) for failures on test_ext_contentscript_activeTab.html. CLOSED TREE 2020-09-23 01:53:37 +03:00
Kris Maglione 4f05d51b11 Bug 1646573: Part 3 - Fix OriginalFrameSrcLoad with DocumentChannel. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90341
2020-09-22 17:41:39 +00:00
shawnjohnjr ac567b3186 Bug 1665534 - Rename fork server process name to forkserver. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D90532
2020-09-21 07:02:42 +00:00
Gerald Squelart 782cf5d3ad Bug 1657033 - Use Span<const char> in JSONWriter - r=froydnj
In most situations, JSONWriter users already know string lengths (either directly, or through `nsCString` and friends), so we should keep this information through JSONWriter and not recompute it again.
This also allows using JSONWriter with sub-strings (e.g., from a bigger buffer), without having to create null-terminated strings.

Public JSONWriter functions have overloads that accept literal strings.

Differential Revision: https://phabricator.services.mozilla.com/D86192
2020-09-14 02:33:20 +00:00
Jed Davis c0cd7e11b5 Bug 1660826 - Work around apparent bug with sendmsg() in some 64-bit Android devices. r=nika
Some Android ARM64 devices appear to have a bug where sendmsg sometimes
returns 0xFFFFFFFF, which we're assuming is a -1 that was incorrectly
truncated to 32-bit and then zero-extended.  This patch detects that
value (which should never legitimately be returned, because it's 16x
the maximum message size) and replaces it with -1, with some additional
assertions.

The workaround is also enabled on x86_64 Android on debug builds only,
so that the code has CI coverage.

Differential Revision: https://phabricator.services.mozilla.com/D89845
2020-09-11 04:31:50 +00:00
Nika Layzell e0c3e2f9a8 Bug 1664553 - Default initialize outparameters in ipdl generated code, r=jld
Doing this helps lower the chances of accidentally trying to send an
uninitialized primitive value, like a raw pointer or integer, over IPC due to a
sync method or IPDLParamTraits::Read implementation failing to initialize the
outparameter.

Differential Revision: https://phabricator.services.mozilla.com/D89963
2020-09-11 19:49:20 +00:00
Mark Banner 3d9ea7d179 Bug 1375244 - Remove sync KeywordToURI and related IPC messages as they are no longer required. r=Gijs,mak,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D89486
2020-09-11 07:15:21 +00:00
Eitan Isaacson 1959904dc6 Bug 1661758 - Part 2: Introduce sync IPDL methods for getting leaf at offset. r=morgan,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D89064
2020-09-11 05:07:48 +00:00
Eitan Isaacson e3872eb448 Bug 1661758 - Part 1: Introduce sync IPDL methods for getting text range of child. r=morgan,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D89063
2020-09-11 05:07:46 +00:00
Brindusan Cristian c5f2ef7f15 Backed out 5 changesets (bug 1661758) for build bustages on GeckoTextMarker.h.
Backed out changeset 9b086da1f8f1 (bug 1661758)
Backed out changeset 8def1d51ae3d (bug 1661758)
Backed out changeset 17532cdc54ae (bug 1661758)
Backed out changeset be0ea9159b11 (bug 1661758)
Backed out changeset 2ca136e7d279 (bug 1661758)
2020-09-11 02:16:49 +03:00
Eitan Isaacson f613d9f64e Bug 1661758 - Part 2: Introduce sync IPDL methods for getting leaf at offset. r=morgan,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D89064
2020-09-10 21:52:20 +00:00
Eitan Isaacson d0576060fa Bug 1661758 - Part 1: Introduce sync IPDL methods for getting text range of child. r=morgan,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D89063
2020-09-10 21:52:13 +00:00
Anny Gakhokidze e12736fa36 Bug 1663238 - Only use the principal to inherit if it's equal to the flattened one, r=nika
With fission enabled, when we are starting a load, we might be saving
principals for a specific browsing context in process A, and then end up
targetting process B for the load, so during deserialization of the
LoadInfoArgs struct, we will end up using principals that were saved during a
previous load targetting that browsing context (with the same id) but in
process B.

Therefore, we cannot assert (without clearing the saved principals in the
original browsing context when a load is done, which can be done as a follow up
work) that the saved principal will be equal to the serialized one from
LoadInfoArgs.

Differential Revision: https://phabricator.services.mozilla.com/D89728
2020-09-10 14:40:31 +00:00
Masatoshi Kimura 99eff289ec Bug 1663300 - Remove MessageChannel::IsInTransaction(). r=jld
Differential Revision: https://phabricator.services.mozilla.com/D89317
2020-09-09 17:34:22 +00:00
Luca Greco bf5f2935f7 Bug 1568597 - RemoteWorkerManager::SelectTargetActorForSharedWorker should select an actor that is kept alive. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D88412
2020-08-28 18:11:22 +00:00
Anny Gakhokidze 46b53bc947 Bug 1589102 - Part 4: Allow (de)serialization of nested about: uris, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D85082
2020-08-28 17:20:43 +00:00
Anny Gakhokidze 8b553ecfcf Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
This patch enables sandboxed srcdoc loads to take place via DocumentChannel,
and adds mechanisms for enabling unsandboxed ones.

Both unsandboxed srcdoc, and in subsequent patches, about:blank, loads require
that the triggering principal and the principal to inherit point to the same
instance if the load takes place in the same process as where we are inheriting
those principals from. We save those principals on a target browsing context before
we load the URI, and later, when we are deserializing LoadInfoArgs into
LoadInfo in the content process, we retrieve the saved principals if the
current load identifier of the target BC matches the load identifier saved
along with the principals.

We also need to make sure that during a process switch for about:srcdoc load,
we don't use the original URI for about:srcdoc to determine the remote type and
instead we use channel's result principal.

Differential Revision: https://phabricator.services.mozilla.com/D85079
2020-08-28 17:20:30 +00:00
Eitan Isaacson 1962242b94 Bug 1660364 - Introduce IPDL getters for text range length, and absolute offsets. r=morgan,mccr8
We need a sync IPC call for this because otherwise the number of smaller sync messages we would need to call would be variable.

Differential Revision: https://phabricator.services.mozilla.com/D88076
2020-08-27 20:06:42 +00:00
Gerald Squelart 3cbc9b5572 Bug 1659404 - Fix non-MOZ_GECKO_PROFILER build - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D88375
2020-08-27 14:41:46 +00:00
David Parks 9fcae06581 Bug 1659523: Check CanSend() before calling Send() when allocating Shmems r=nika
CanSend() is called (in ChannelSend()) by SendFoo() IPDL calls to prevent calling Send() on a dead actor but shmem creation uses a different code path to Send() -- one that does not use ChannelSend.  This adds the guard to shmem allocation as well.

Differential Revision: https://phabricator.services.mozilla.com/D87357
2020-08-25 16:10:17 +00:00
Eitan Isaacson 1b3266b806 Bug 1660109 - Add BoundsForRange sync ipc call. r=Jamie,nika
Differential Revision: https://phabricator.services.mozilla.com/D87669
2020-08-20 22:11:41 +00:00
Andrew Osmond 67cd43209f Bug 1658847 - Put profiler thread to sleep when allocating memory for shmems. r=mstange
posix_fallocate iterates over each page/block in a shmem to ensure the
OS allocates memory to back it. Large shmems will cause many read/write
calls to be made, and when profiling, it is very likely a SIGPROF signal
will interrupt us at sufficiently high sampling rates. Most attempts at
retrying will fail for the same reason, and this can cause the threads
to block for an indeterminate period of time.

To work around this we use the profiler's "thread sleep" mechanism to
indicate that the sampler thread should not interrupt this thread with
the sampling signal more than once.

Differential Revision: https://phabricator.services.mozilla.com/D87373
2020-08-18 21:40:11 +00:00
Andrew McCreight 681e8793ff Bug 1641614 - Use mozilla::Queue for ChannelImpl::output_queue_h_. r=froydnj
The goal of this patch is to reduce memory usage. On at least OSX, std::Queue
can use 4kb of memory even with nothing in it. This can be around 52kb of
memory per content process.

The segment size of 64 is fairly arbitrary, but these queues didn't have
more than a few hundred items in them, so it seemed like a reasonable
trade off between space for mostly-empty queues and segment overhead.

Differential Revision: https://phabricator.services.mozilla.com/D87325
2020-08-18 17:03:55 +00:00
Simon Giesecke 1fccb4c60f Bug 1634436 - Make cipher-strategy stateful and keep mode, key and IV as state. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D80014
2020-08-17 08:42:20 +00:00
Eitan Isaacson 58ae94661e Bug 1657765 - Add IPDL interface for platform-specific mac API. r=morgan,Jamie,nika
Differential Revision: https://phabricator.services.mozilla.com/D86606
2020-08-14 19:33:00 +00:00
Butkovits Atila ca6c19bf18 Backed out changeset c574dd7d46ef (bug 1616462) as requested by jld 2020-08-08 01:18:19 +03:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
Andrew McCreight 85e0be181d Bug 1657504, part 2 - Fix deprecation warning in ipdl.py. r=nika
This is unrelated to the main issue in the bug, but I noticed
a deprecation warning in the log spew.

Differential Revision: https://phabricator.services.mozilla.com/D86229
2020-08-06 17:36:45 +00:00
Andrew McCreight bd21b11225 Bug 1657504, part 1 - Don't allow a protocol to be defined in two different files. r=nika
This changes the duplicate checking/caching implemented by |parsed| to be
based on the name of the protocol etc. we're loading, not the file name.
This lets us detect when a protocol is being defined in two different
files.

This can happen if one file is included earlier in the resolve path than
a file explicitly specified on the command line. Any includes will resolve
to the former, and then we'll attempt to parse the latter. Before this
patch, this would result in weird errors, because there would be multiple
protocol types with the same name.

Differential Revision: https://phabricator.services.mozilla.com/D86113
2020-08-06 17:42:13 +00:00
Kartikaya Gupta 39167fa7cd Bug 1251612 - Support the GetFrameUniformity API in content processes. r=botond,froydnj
This moves the IPC mechanism from PCompositorBridge to PLayerTransaction/
PWebRenderBridge, so that it can be used by content processes like the other
test APIs. It still only produces actual data for the layers backend; for
WR it will just return empty datasets.

Differential Revision: https://phabricator.services.mozilla.com/D86016
2020-08-05 21:42:06 +00:00
Butkovits Atila 3bd0e5497c Backed out 10 changesets (bug 1589102) for failure at browser_saveHeapSnapshot_e10s_01.js CLOSED TREE
Backed out changeset 0d22ad297b19 (bug 1589102)
Backed out changeset 14bcaf2a452c (bug 1589102)
Backed out changeset 20905f91e2bb (bug 1589102)
Backed out changeset 29ee0fbe855f (bug 1589102)
Backed out changeset d1f6185030af (bug 1589102)
Backed out changeset 31949872cc1d (bug 1589102)
Backed out changeset ec04e1a20597 (bug 1589102)
Backed out changeset ffe8da473b91 (bug 1589102)
Backed out changeset 3b92f7306c64 (bug 1589102)
Backed out changeset b187548e258f (bug 1589102)
2020-08-05 21:47:50 +03:00
Anny Gakhokidze 6c0bc76392 Bug 1589102 - Part 4: Allow (de)serialization of nested about: uris, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D85082
2020-08-05 16:45:57 +00:00
Anny Gakhokidze e903c66d34 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
This patch enables sandboxed srcdoc loads to take place via DocumentChannel,
and adds mechanisms for enabling unsandboxed ones.

Both unsandboxed srcdoc, and in subsequent patches, about:blank, loads require
that the triggering principal and the principal to inherit point to the same
instance if the load takes place in the same process as where we are inheriting
those principals from. We save those principals on a target browsing context before
we load the URI, and later, when we are deserializing LoadInfoArgs into
LoadInfo in the content process, we retrieve the saved principals if the
current load identifier of the target BC matches the load identifier saved
along with the principals.

We also need to make sure that during a process switch for about:srcdoc load,
we don't use the original URI for about:srcdoc to determine the remote type and
instead we use channel's result principal.

Differential Revision: https://phabricator.services.mozilla.com/D85079
2020-08-05 16:44:01 +00:00
Chris Martin c946e6eaf9 Bug 1656349 - Refactor the IPC lifetimes for the PGamepadEventChannel object r=daoshengmu
Change the GamepadEventChannel so it is fully-initialized by the IPC
constuctor and needs no separate "init" message, and so its completely
destroyed by the ActorDestroy() message so it needs no "cleanup" message.

This simplifies the object lifetime, as well as unifies the IPC error vs
clean shutdown paths.

Differential Revision: https://phabricator.services.mozilla.com/D85481
2020-08-04 21:27:53 +00:00
Jed Davis 7b4c21f949 Bug 1616462 - Make event_base_fd atomic to avoid a TSan error. r=froydnj
See comment #13 on the bug for an explanation of what this fixes, what it
doesn't fix, and why this hasn't been fixed upstream yet.

See also https://github.com/libevent/libevent/issues/779 (upstream bug report)
and https://github.com/libevent/libevent/pull/741 (stalled pull request
with comments explaining the larger problem in more detail).

Differential Revision: https://phabricator.services.mozilla.com/D85781
2020-08-04 15:06:32 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Kershaw Chang 13c4c8d567 Bug 1648996 - Keep the source stream open after serializing, r=baku
The main reason of this patch is that the source stream will be closed when `InputStreamHelper::SerializeInputStreamAsPipe` is called, but when `InputStreamHelper::SerializeInputStreamAsPipe` is not called, the stream is stayed opened. I think we should make the behavior of serialization stream consistent, which is keeping the source stream opened.

Differential Revision: https://phabricator.services.mozilla.com/D81978
2020-08-03 10:39:48 +00:00