Commit Graph

6177 Commits

Author SHA1 Message Date
Sylvestre Ledru
843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Butkovits Atila
64a8612aa9 Backed out changeset 562a834a3692 (bug 1656349) for build bustages at BackgroundParentImpl. CLOSED TREE 2020-08-01 01:02:44 +03:00
Chris Martin
583e1cc437 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-07-31 19:40:55 +00:00
Nathan Froyd
e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis
a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd
bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
James Teh
de10571c3c Bug 1654969: Always disable COM pings for mscom::FastMarshaler (and thus mscom::Interceptor). r=aklotz
Previously, we only did this when IsCallerExternalProcess() returned false.
There are three reasons for changing this:

1. There seem to be cases where IsCallerExternalProcess() returns true even when marshaling for a COM query in the MTA.
2. After bug 1627084, we pre-build a11y handler payloads on the main thread for bulk fetch calls. That will marshal interceptors. However, IsCallerExternalProcess() can't work in that case because it's not running on the thread on which the COM call is being handled.
3. If MSHLFLAGS_NOPING is used, Release calls from remote clients are never sent to the server. So, as soon as we use NOPING for our parent process, we're already going to leak references, even if we don't use NOPING for external callers. Put another way, as soon as we use NOPING for one caller, we may as well use it for all callers because COM pinging will never release the object anyway.

Differential Revision: https://phabricator.services.mozilla.com/D84778
2020-07-29 21:11:14 +00:00
Jed Davis
8c61fa8fde Bug 1656101 - Delete some IPC dead code (BrowserProcessSubThread types and an unused header). r=mccr8
An actual use of the `BACKGROUND_X11` thread may have briefly existed in
2009 but probably never shipped; it's been unused since then, and even
the comments mentioning it have been pruned (bug 909028, bug 624422).
The other thread types besides IO have been commented out ever since
they were first committed.

This patch also removes `x11_util.h`, which has been unused since 2017
(bug 1426284); earlier in history, it had one of those comments
mentioning the nonexistent X11 thread.

Differential Revision: https://phabricator.services.mozilla.com/D85346
2020-07-29 23:31:38 +00:00
Ricky Stewart
11e536dbb2 Bug 1655993 - Remove Punion_Comparable::test from sync-messages.ini r=mccr8
This shouldn't have been added in the first place.

Differential Revision: https://phabricator.services.mozilla.com/D85292
2020-07-29 15:02:11 +00:00
Sebastian Streich
fb1d1dc1df Bug 1558394 - Pass the TriggeringSandboxFlags to nsILoadinfo r=ckerschb,smaug,necko-reviewers,valentin
Add triggering Sandbox flags to loadinfo
***
Pass triggering Flags into Loadinfo

***
Fix triggeringSandboxflags passing

Differential Revision: https://phabricator.services.mozilla.com/D69588
2020-07-29 11:43:23 +00:00
Ricky Stewart
e8ac99b085 Bug 1655371 - Fix ipdl test breaking Windows ccov builds r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D85067
2020-07-27 22:21:48 +00:00
Ricky Stewart
3419d4de1d Bug 1654589 - Move libpref Python unit test to mozbuild suite r=froydnj,mccr8
It could go into its own test suite, but it 1) depends on `mozbuild` code, so the `mozbuild` suite as well as this new suite would be running on any push that touches `mozbuild` code anyway, and 2) this is code that runs during the build, so it's not out of place.

Differential Revision: https://phabricator.services.mozilla.com/D84547
2020-07-23 22:00:46 +00:00
Jon Bauman
e893f80bba Bug 1654379 - Allow filtering the IPC log by multiple toplevel protocol names. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D84587
2020-07-23 17:47:39 +00:00
Simon Giesecke
b0cf19fc3b Bug 1654469 - Fix test protocol names. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D84656
2020-07-23 14:07:02 +00:00
Emilio Cobos Álvarez
ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Jed Davis
0e88912e37 Bug 1632687 - Part 3: Introduce an OS-dependent ChannelId type to reflect that Unix doesn't use channel IDs. r=mccr8
The Chromium-derived IPC code was, as far as I can tell, originally
designed for Windows and assumed that channels would be named pipes,
managed and connected to via `std::wstring` paths.  The port to Unix,
however, used unnamed `socketpair()` and passed them directly from
process to process, so it has no use for these channel IDs...  but it
still computes and propagates them, even though they're not used, using
deprecated wide-string APIs.

This patch introduces a typedef for an abstract channel ID, which is a
`wstring` on Windows and an empty struct on Unix, to allow removing the
string code where it's not needed without needing to completely redesign
the channel abstraction.

Differential Revision: https://phabricator.services.mozilla.com/D72260
2020-07-22 19:04:48 +00:00
Jed Davis
d3f86fcc5c Bug 1632687 - Part 2: Remove the channel ID prefixes, which we've never used. r=mccr8
Chromium's fix for CVE-2011-3079 added an optional prefix parameter for
channel IDs, but we've never used it and have no plans to.  (Chromium
itself doesn't appear to have used it except with the prefixes "gpu"
and "nacl", and the code has since been removed completely in favor of
Mojo.)  So let's simplify things and remove it.

Differential Revision: https://phabricator.services.mozilla.com/D84276
2020-07-22 19:04:46 +00:00
Jed Davis
053045fdbe Bug 1632687 - Part 1.5: Protect the hard-coded IPC child fd from accidental multiple use. r=mccr8
This "create a pipe" operation has a mode where, on Unix, it doesn't
create a new transport but rather uses a hard-coded fd for the initial
IPC channel in a child process.  (It was originally written for Windows
and the assumption of using named pipes and pathnames for everything.)

That seems like a footgun, so this patch checks for trying to "create"
that pipe twice.  However, it doesn't check for accidentally calling it
in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D72259
2020-07-22 19:04:44 +00:00
Jed Davis
c24433b717 Bug 1632687 - Part 1: Remove IPC PipeMap. r=mccr8
The PipeMap class tries to simulate the Windows channel model (named
pipes that the client opens by a pathname) on Unix.  However, it's
effectively dead code -- the map is empty except in some unit tests that
we never imported.

What we do is generate a "channel ID" with string formatting, then don't
pass it to the child or ever insert anything into the map, then the child
looks up an empty string and doesn't find it, so it uses the hard-coded
fixed fd for the initial channel.

Basically, it does nothing except maybe confuse unfamiliar readers, so
let's get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D72258
2020-07-22 19:04:37 +00:00
Simon Giesecke
548e423dad Bug 1654469 - Stop generating operator==/operator != for IPDL structs/unions by default. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D84485
2020-07-22 17:24:33 +00:00
Simon Giesecke
d824054ce7 Bug 1654181 - Add uncomparable keyword for structs and unions. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D84298
2020-07-22 09:11:52 +00:00
Jeff Gilbert
35f892e782 Bug 1607940 - Stand up webgl.out-of-process:true path. r=handyman,nika,froydnj
* Use clearer pref names.
* Default (and only support) IPDL dispatching.
* Make DispatchCommands async-only.
* Sync ipdl command per sync webgl entrypoint.
  * Eat the boilerplate cost, since there's not too many.
* Run SerializedSize off same path as Serialize.
* All shmem uploads go through normal DispatchCommands.
* Defer pruning of dead code for now so we can iterate quickly.
* Use Read/Write(begin,end) instead of (begin,size).
  * This would have prevented a bug where we read/wrote N*sizeof(T)*sizeof(T).

Differential Revision: https://phabricator.services.mozilla.com/D81495
2020-07-21 22:56:52 +00:00
Andrew Osmond
d933968108 Bug 1582954 - Use posix_fallocate if available to avoid lazy allocation for shared memory. r=jld
WebRender makes extensive use of shared memory buffers, particularly for
images decoded in the content process. These images can be arbitrarily
large, and there being insufficient memory for an allocation must be
handled gracefully.

On Linux, we will currently crash with a SIGBUS signal during image
decoding instead of just displaying the broken image tag. This is
because the pages backing the shared memory are only allocated when we
write to them. This blocks shipping WebRender on Linux.

This patch uses posix_fallocate to force the reservation of the pages,
and allows failing gracefully if they are unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D80650
2020-07-20 17:47:52 +00:00
Andrew McCreight
6fce3d2191 Bug 1653587 - Fix "Genreate" typo. DONOTBUILD r=jld
Differential Revision: https://phabricator.services.mozilla.com/D83956
2020-07-20 16:52:29 +00:00
David Teller
94b50d3de1 Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
2020-07-20 09:42:48 +00:00
Cosmin Sabou
c562fee6cd Backed out 2 changesets (bug 1652000) for causing Bug 1653749.
Backed out changeset 69dbf38f4071 (bug 1652000)
Backed out changeset 0a6cb920a247 (bug 1652000)
2020-07-19 05:54:07 +03:00
David Teller
15c3a336eb Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
2020-07-17 19:48:21 +00:00
Anny Gakhokidze
deced955d5 Bug 1642468 - Part 1: Remove all outer windowId fields from LoadInfo, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D83562
2020-07-17 17:13:26 +00:00
Narcis Beleuzu
a475e11422 Backed out 2 changesets (bug 1652000) for bustages on ChromeUtils.cpp . CLOSED TREE
Backed out changeset 5f02a357671c (bug 1652000)
Backed out changeset 22bb2a5032b7 (bug 1652000)
2020-07-17 20:16:32 +03:00
Agi Sferro
489dd44cdd Bug 1651838 - Remove unused --appomni on Android. r=glandium,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83195
2020-07-17 16:58:29 +00:00
David Teller
37dd44228b Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
2020-07-17 16:21:26 +00:00
Jed Davis
75573b020f Bug 1325918 - Ignore MsgDropped errors in BackgroundChildImpl. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83558
2020-07-14 20:23:49 +00:00
Sylvestre Ledru
1dbb63db2b Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D83258
2020-07-14 09:34:19 +00:00
Jed Davis
127b9aecbb Bug 1635572 - Remove workaround for shared memory security bug in old macOS versions. r=spohl
CVE-2018-4435 (https://crbug.com/project-zero/1671) was fixed in macOS
10.12 and up, but when we added uses of shm_open that would be affected
by it we still supported 10.9, so we added a workaround that tests for
the bug (by trying to exploit it) and falls back to the slower
alternative of temporary files if necessary.

The minimum supported version is now 10.12, and we've already
committed changes (e.g., to sandboxing) that would break the browser
on older versions, so we can remove this code.  Note that we also have
cross-platform gtests that check for this type of bug, so we'll have some
warning if it's ever reintroduced.

Differential Revision: https://phabricator.services.mozilla.com/D83197
2020-07-13 21:35:22 +00:00
Cosmin Sabou
3576443b99 Backed out changeset 3229e30f7721 (bug 1649573) as requested by froydnj. CLOSED TREE 2020-07-13 17:18:41 +03:00
Jed Davis
ba9cf29223 Bug 1652081 - Verify that newly allocated shared memory is zeroed. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D83144
2020-07-10 22:08:07 +00:00
Tom Prince
204d796929 Bug 1651731: [lint] Python and shell files without #! should not be executable; r=linter-reviewers,perftest-reviewers,geckoview-reviewers,agi,sylvestre,sparky
Differential Revision: https://phabricator.services.mozilla.com/D82954
2020-07-09 20:29:18 +00:00
Nika Layzell
22a65a237e Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-08 20:15:59 +00:00
Mihai Alexandru Michis
1ba2a3f6f6 Backed out 3 changesets (bug 1650163) for causing bustages in nsContentSecurityManager.cpp
CLOSED TREE

Backed out changeset 51d7c644a1e6 (bug 1650163)
Backed out changeset 3d2b6908447a (bug 1650163)
Backed out changeset 79141707d47b (bug 1650163)
2020-07-08 21:18:44 +03:00
Nika Layzell
c850a94434 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-08 14:54:48 +00:00
Kris Maglione
5837ad4bdd Bug 1580764: Part 3 - Remove unused AncestorOuterWindowIDs from LoadInfo. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D82465
2020-07-07 21:14:34 +00:00
Kris Maglione
01ca404c30 Bug 1580764: Part 1 - Add ancestor BrowsingContext IDs to LoadInfo. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D82463
2020-07-07 21:14:42 +00:00
Narcis Beleuzu
8359f16846 Backed out 7 changesets (bug 1650163, bug 1649477) for bustages on JSActor.cpp . CLOSED TREE
Backed out changeset 4a21afb65254 (bug 1650163)
Backed out changeset c41753a56f5a (bug 1650163)
Backed out changeset 5fb444c35764 (bug 1650163)
Backed out changeset 830aa93d2b0c (bug 1649477)
Backed out changeset eca6e9dce450 (bug 1649477)
Backed out changeset 5b217aa88289 (bug 1649477)
Backed out changeset 8959d02b840f (bug 1649477)
2020-07-08 04:09:27 +03:00
Nika Layzell
df351180c3 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-06 20:30:58 +00:00
ssengupta
a9e4714041 Bug 1633880 - P2 - RemoteLazyInputStreamStorage::Get() now returns mozilla::Result<RefPtr<RemoteLazyInputStreamStorage>, nsresult> r=baku
Differential Revision: https://phabricator.services.mozilla.com/D80541
2020-07-03 12:59:19 +00:00
Kashav Madan
4fb30e0688 Bug 1643862 - Move channel buffers into separate heap allocations, r=jld
Moving these out-of-line reduces some IPC::Channel::ChannelImpl slop.

Differential Revision: https://phabricator.services.mozilla.com/D79183
2020-07-03 14:01:41 +00:00
Kashav Madan
cfc4c0e2cf Bug 1643732 - Choose a more conservative size for input_cmsg_buf_, r=jld
We'll never read more than MAX_DESCRIPTORS_PER_MESSAGE file descriptors in a
single message, so size the buffer based on that value.

Differential Revision: https://phabricator.services.mozilla.com/D79162
2020-07-03 14:01:28 +00:00
Simon Giesecke
b13b4d3deb Bug 1650076 - Clean up ThreadLocal. r=dom-workers-and-storage-reviewers,asuth
Move ThreadLocal to a separate header file.
Reuse LoggingIdString in ThreadLocal (and make use of nsAutoCStringN).

Differential Revision: https://phabricator.services.mozilla.com/D82018
2020-07-03 09:40:12 +00:00
Cosmin Sabou
a40ede8ab7 Backed out 4 changesets (bug 1650076) for build bustages on indexedDB/ProfilerHelpers.h. CLOSED TREE
Backed out changeset 42951b61e9dc (bug 1650076)
Backed out changeset 18b34fb0ddbd (bug 1650076)
Backed out changeset 1d378f2af866 (bug 1650076)
Backed out changeset 42df520d1cff (bug 1650076)
2020-07-03 11:49:58 +03:00
Simon Giesecke
4c5ca225c9 Bug 1650076 - Clean up ThreadLocal. r=dom-workers-and-storage-reviewers,asuth
Move ThreadLocal to a separate header file.
Reuse LoggingIdString in ThreadLocal (and make use of nsAutoCStringN).

Differential Revision: https://phabricator.services.mozilla.com/D82018
2020-07-03 08:08:27 +00:00