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

6162 Коммитов

Автор SHA1 Сообщение Дата
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
Jean-Yves Avenard afea3c617d Bug 1634846 - P3. Get around NS_INLINE_DECL_REFCOUNTING not working with TaskQueue. r=nika,froydnj
NS_INLINE_DECL_REFCOUNTING macro doesn't properly work when the object is used on a thread that isn't backed by a single PRThread (such as TaskQueue). See bug 1648031.

The resolution of this issue is rather complex, and outside the scope of this series of change.

So for now, we create a new macro NS_INLINE_DECL_REFCOUNTING_ONEVENTTHREAD which will use a different mechanism to ensure the thread-safe usage of a class.

Differential Revision: https://phabricator.services.mozilla.com/D81269
2020-07-02 00:26:43 +00:00
Jean-Yves Avenard b2cf09ec3e Bug 1634846 - P2. Make ipc's MessageChannel works with TaskQueue, r=nika
We no longer rely of having a message loop for the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D80655
2020-07-02 00:26:41 +00:00
Jean-Yves Avenard 8ad7f1ba8e Bug 1634846 - P1. Remove unused method. r=nika,jld
And the less use of MessageLoop, the better.

Differential Revision: https://phabricator.services.mozilla.com/D80654
2020-07-02 00:25:35 +00:00
Ricky Stewart 8fe43501ec Bug 1648129 - Use faster hash for ipdl generator r=froydnj
`adler32` is about 3x as fast overall as `md5` on my machine.

Differential Revision: https://phabricator.services.mozilla.com/D81892
2020-07-01 18:31:01 +00:00
Nathan Froyd 3f6228a465 Bug 1649573 - run IPDL ipdl tests in parallel; r=firefox-build-system-reviewers,rstewart
The speedup here is not great because the Python/IPDL parser overhead is
very high, but this cuts ~10 seconds off a `-j12` build (~15s -> 4s) on
my machine.

Differential Revision: https://phabricator.services.mozilla.com/D81751
2020-07-01 15:49:32 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Jim Porter 632c7aa9aa Bug 1613496 - Add IPC profiler markers to track when messages are processed by the IO thread queues r=gerald,froydnj
This adds 3 new profiler markers for each IPC message:

 * One just before the first byte is sent over the IPC channel
 * One just after the last byte is sent over the IPC channel
 * One just after the last byte is received from the IPC channel

With the already-existing IPC markers (for when SendXXX and RecvXXX are
called), this allows us to calculate the following statistics:

 * Send thread latency
 * IPC send duration
 * IPC recv latency
 * Recv thread latency

For more information on how this is presented in the UI, see:
<https://github.com/firefox-devtools/profiler/pull/2535>.

Differential Revision: https://phabricator.services.mozilla.com/D70790
2020-06-30 18:39:42 +00:00
Jean-Yves Avenard 4a24fe3c8e Bug 1647958 - P3. Have GetCurrentSerialEventTarget returns the currently running MessageLoop. r=nika
We want it to returning the actual nsThread if that's where the MessageLoop would dispatch its tasks; otherwise return the MessageLoop's EventTarget

Depends on D80357

Differential Revision: https://phabricator.services.mozilla.com/D80811
2020-06-30 08:04:10 +00:00
Jean-Yves Avenard 29e935bf80 Bug 1647958 - P1. Protects MessageLoop::EventTarget's mLoop member. r=nika
EventTarget::Dispatch can be called on any threads ; there's a potential of a race when accessing the mLoop member.

Differential Revision: https://phabricator.services.mozilla.com/D80810
2020-06-30 08:04:13 +00:00
Brindusan Cristian 6f757f82da Backed out 2 changesets (bug 1647958) for conflicting with the backout of Bug 1648898. CLOSED TREE
Backed out changeset 55ecb48a0504 (bug 1647958)
Backed out changeset af210e0df79f (bug 1647958)
2020-06-30 10:59:29 +03:00
Narcis Beleuzu 3700aab557 Backed out 7 changesets (bug 1634846, bug 1647628, bug 1649294, bug 1647112) for webgl-conf crashes. CLOSED TREE
Backed out changeset 4441d06e96c3 (bug 1647628)
Backed out changeset 4efaf32bc8f7 (bug 1647112)
Backed out changeset 2d24ad813039 (bug 1647112)
Backed out changeset fda262d73a13 (bug 1649294)
Backed out changeset 5863f9c5229f (bug 1634846)
Backed out changeset bca79526745d (bug 1634846)
Backed out changeset d539408a0048 (bug 1634846)
2020-06-30 09:50:00 +03:00
Jean-Yves Avenard 9f996ba331 Bug 1634846 - P3. Get around NS_INLINE_DECL_REFCOUNTING not working with TaskQueue. r=nika,froydnj
NS_INLINE_DECL_REFCOUNTING macro doesn't properly work when the object is used on a thread that isn't backed by a single PRThread (such as TaskQueue). See bug 1648031.

The resolution of this issue is rather complex, and outside the scope of this series of change.

So for now, we create a new macro NS_INLINE_DECL_REFCOUNTING_ONEVENTTHREAD which will use a different mechanism to ensure the thread-safe usage of a class.

Differential Revision: https://phabricator.services.mozilla.com/D81269
2020-06-30 02:50:07 +00:00
Jean-Yves Avenard 35101e741b Bug 1634846 - P2. Make ipc's MessageChannel works with TaskQueue, r=nika
We no longer rely of having a message loop for the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D80655
2020-06-26 09:34:47 +00:00
Jean-Yves Avenard b28f4edba4 Bug 1634846 - P1. Remove unused method. r=nika,jld
And the less use of MessageLoop, the better.

Differential Revision: https://phabricator.services.mozilla.com/D80654
2020-06-25 18:28:04 +00:00