Commit Graph

5556 Commits

Author SHA1 Message Date
Nika Layzell
17ed6763d2 Bug 1550560 - Part 1: Parse refcounted protocols in IPDL, r=mccr8
The syntax for the new construct looks like the following, and re-uses the
refcounted keyword from refcounted using statements:

async refcounted protocol PFoo { ... }

Differential Revision: https://phabricator.services.mozilla.com/D39501

--HG--
extra : moz-landing-system : lando
2019-07-29 19:54:14 +00:00
Nika Layzell
7d9769c5e3 Bug 1565405 - Fail async ctor call if !Manager()->CanSend(), r=froydnj
The previous behaviour of failing unconditionally was performed as, during
shutdown, the channel could become unable to send without worker threads having
a chance to react. This change keeps that behaviour, isolating async message
senders from impending IPC shutdown, while performing expected actor teardown if
the manager actor has already been destroyed, and should no longer send messages.

An alternate behaviour here could be to crash if !Manager()->CanSend(). That
behaviour may be preferable if a sufficient number of callsites don't check the
return value of the `SendPFooConstructor()` method.

Differential Revision: https://phabricator.services.mozilla.com/D39534

--HG--
extra : moz-landing-system : lando
2019-07-29 16:37:40 +00:00
Kershaw Chang
0d30d95291 Bug 1566808 - Add STARTF_FORCEOFFFEEDBACK when launching process on windows r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D39682

--HG--
extra : moz-landing-system : lando
2019-07-29 14:59:27 +00:00
Andrea Marchesini
cef26c06c6 Bug 1567892 - PeerConnectionMedia should use nsIProtocolProxyService on the parent process - PProxyConfigLookup IPC protocol, r=bwc,kershaw,jld
Differential Revision: https://phabricator.services.mozilla.com/D39010

--HG--
extra : moz-landing-system : lando
2019-07-29 12:27:59 +00:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Bobby Holley
5d23efb2eb Bug 1566583 - Bridge GeckoResult to MozPromise and return a GeckoResult from GeckoProcessManager::start. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D38436

--HG--
extra : moz-landing-system : lando
2019-07-24 21:10:14 +00:00
Coroiu Cristina
f3386dea34 Backed out 4 changesets (bug 1566583) for apilint and checkstyle failure at geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java on a CLOSED TREE
Backed out changeset 3700ef585384 (bug 1566583)
Backed out changeset fbc829be6c4f (bug 1566583)
Backed out changeset 14ea9c84bb0e (bug 1566583)
Backed out changeset 92f3b1bb34a4 (bug 1566583)
2019-07-24 22:59:54 +03:00
Bobby Holley
53719788a1 Bug 1566583 - Bridge GeckoResult to MozPromise and return a GeckoResult from GeckoProcessManager::start. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D38436

--HG--
extra : moz-landing-system : lando
2019-07-24 19:19:40 +00:00
Christian Holler
cd7a74b452 Bug 1499041 - Remove libFuzzer flags from ipc/chromium/. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D39165

--HG--
extra : moz-landing-system : lando
2019-07-24 14:13:30 +00:00
Ciure Andrei
c0756f3389 Backed out 10 changesets (bug 1523638) for causing high frequency Android 7.0 mochitests failures CLOSED TREE
Backed out changeset 644ceb2fe568 (bug 1523638)
Backed out changeset 27647ee7a927 (bug 1523638)
Backed out changeset 96f1ccb95570 (bug 1523638)
Backed out changeset b60a17ea716a (bug 1523638)
Backed out changeset 507e63186c5f (bug 1523638)
Backed out changeset 33255408ca61 (bug 1523638)
Backed out changeset d97b2d223616 (bug 1523638)
Backed out changeset eba2a0514cde (bug 1523638)
Backed out changeset d7065174c5c4 (bug 1523638)
Backed out changeset c21b361e175d (bug 1523638)
2019-07-23 05:13:32 +03:00
Nika Layzell
b1f124f20a Bug 1523638 - Part 3: Construct WindowGlobal actors using ManagedEndpoint, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D37650

--HG--
extra : moz-landing-system : lando
2019-07-18 19:38:10 +00:00
Benjamin
6da0bbfd32 Bug 1566453: Added flag to detect if a load was initiated by a form submission r=ckerschb
The flag in loadinfo can be used to detect if a load was initiated by a form submission. This is crucial for implmenting the CSP directive navigate-to. https://www.w3.org/TR/CSP3/#navigate-to-pre-navigate

Differential Revision: https://phabricator.services.mozilla.com/D38403

--HG--
extra : moz-landing-system : lando
2019-07-22 13:41:47 +00:00
Cosmin Sabou
76dc1b363b Merge mozilla-central to mozilla-inbound. 2019-07-18 12:57:56 +03:00
Aaron Klotz
8b94200412 Bug 1566955: Make EnsureMTA fully thread-safe; r=Jamie
Until now we asserted that EnsureMTA was being called from the main thread
unless the current thread was already in the MTA.

This patch makes MTA thread initialization thread-safe by using a C++11
"magic static," thus allowing EnsureMTA to be safely invoked from any thread.

Differential Revision: https://phabricator.services.mozilla.com/D38422

--HG--
extra : moz-landing-system : lando
2019-07-18 00:48:41 +00:00
Brian Hackett
3725f222ae Bug 1566294 - Use distinct sequence numbers for messages sent from middleman processes, r=nika.
Differential Revision: https://phabricator.services.mozilla.com/D38359

--HG--
extra : rebase_source : a7c9072d996eabc94e453267448eb2a35c89d1a1
2019-07-17 05:47:35 -10:00
Bobby Holley
5b2d1df481 Bug 1566592 - Use a dedicated thread for launching on android. r=jld
At the moment, this shouldn't make any difference because we only ever
launch one child process on android.

Differential Revision: https://phabricator.services.mozilla.com/D38244

--HG--
extra : moz-landing-system : lando
2019-07-16 22:52:48 +00:00
Bogdan Tara
ca45889546 Backed out 9 changesets (bug 1523638) for browser_contextmenu.js failures CLOSED TREE
Backed out changeset 0a584a07b696 (bug 1523638)
Backed out changeset 8c5af2289900 (bug 1523638)
Backed out changeset 40ed1bd64b09 (bug 1523638)
Backed out changeset 9a99a0391979 (bug 1523638)
Backed out changeset 07fb4748b91a (bug 1523638)
Backed out changeset 49047c3ebae9 (bug 1523638)
Backed out changeset d606d072126c (bug 1523638)
Backed out changeset 76dc1937fc77 (bug 1523638)
Backed out changeset c784c14b5d5d (bug 1523638)
2019-07-16 23:40:47 +03:00
Olli Pettay
5474e37783 Bug 1566459, add a way to check underlying IPC message type from runnable, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D38215

--HG--
extra : moz-landing-system : lando
2019-07-16 19:21:40 +00:00
Nika Layzell
a711231390 Bug 1523638 - Part 3: Construct WindowGlobal actors using ManagedEndpoint, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D37650

--HG--
extra : moz-landing-system : lando
2019-07-16 18:47:39 +00:00
Jed Davis
0ba66c379f Bug 1534780 - Add free interconversion between UniqueFileHandle and ipc::FileDescriptor and use it in a few places. r=froydnj
Now that UniqueFileHandle can be used more widely, and with
ipc::FileDescriptor being essentially a copyable UniqueFileHandle, it
makes sense to add a move constructor and a "forget"-like method to
convert between them when needed.

Depends on D26737

Differential Revision: https://phabricator.services.mozilla.com/D26738

--HG--
extra : moz-landing-system : lando
2019-06-28 19:46:58 +00:00
Jed Davis
370bd5030f Bug 1534780 - Move ipc::FileDescriptor's UniquePtr instance into MFBT as UniqueFileHandle. r=froydnj
MozReview-Commit-ID: 7bbGVIjTTaJ

Differential Revision: https://phabricator.services.mozilla.com/D26737

--HG--
extra : moz-landing-system : lando
2019-06-28 19:46:58 +00:00
Byron Campen [:bwc]
6480f0a928 Bug 1560636: Avoid using main thread with PMediaTransport. r=mjf,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D36818

--HG--
extra : moz-landing-system : lando
2019-07-15 15:49:30 +00:00
Andreea Pavel
6665820f48 Backed out 3 changesets (bug 1547351) for assertion failures on a CLOSED TREE
Backed out changeset 77ef8e8bc669 (bug 1547351)
Backed out changeset b594f8e47025 (bug 1547351)
Backed out changeset 6e5d426cd313 (bug 1547351)
2019-07-15 17:47:40 +03:00
Alexis Beingessner
340a9acb9f Bug 1547351 - Add support for mozilla::HashMap to ipdl. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D37927

--HG--
extra : moz-landing-system : lando
2019-07-15 13:20:31 +00:00
Bobby Holley
1a1203d4f9 Bug 1562762 - Return a Promise from DoLaunch. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D37602

--HG--
extra : moz-landing-system : lando
2019-07-12 04:48:44 +00:00
Bogdan Tara
b3b754d03c Backed out changeset a82b17a644d7 (bug 1562762) for geckoview crashes on Android 4.3 CLOSED TREE 2019-07-12 02:40:19 +03:00
Bobby Holley
879947f772 Bug 1562762 - Return a Promise from DoLaunch. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D37602

--HG--
extra : moz-landing-system : lando
2019-07-11 15:28:00 +00:00
Bobby Holley
b950ce25f8 Bug 1563832 - Decompose PerformAsyncLaunch into the platform hierarchy. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D37306

--HG--
extra : moz-landing-system : lando
2019-07-11 15:27:58 +00:00
Bobby Holley
6be1da5376 Bug 1563832 - Move a few things into BaseProcessLauncher. r=jld
I'm not convinced the current comment about being race-free is accurate
in context of the launcher pool. It probably _is_ correct under this
patch, because ProcessLaunchers should only be constructed on a single
thread, but it's easy enough just to make it atomic.

Hopefully moving the timestamp doesn't perturb telemetry too much.

Differential Revision: https://phabricator.services.mozilla.com/D37305

--HG--
extra : moz-landing-system : lando
2019-07-11 15:27:51 +00:00
Bobby Holley
9eac67a792 Bug 1563832 - Create an inheritance hierarchy for the platform-specific bits of process launching. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D37304

--HG--
extra : moz-landing-system : lando
2019-07-11 15:27:47 +00:00
Bobby Holley
a2b5e1de1e Bug 1562763 - Factor process launching into a helper class, and use more promises. r=jld
This is intended to facilitate future work to break up
PerformAsyncLaunch into asynchronous pieces. It also aims to fix some
raciness around access to state in the GeckoChildProcessHost instance.
There appears to be at least one data race in the existing code, in which
OpenPrivilegedHandle are run on both the launcher thread and the IO
thread without synchronization.

Differential Revision: https://phabricator.services.mozilla.com/D36539

--HG--
extra : moz-landing-system : lando
2019-07-10 22:37:37 +00:00
Bobby Holley
3b7fbc734f Bug 1562763 - Move some types around. r=jld
Having to namespace these into GeckoChildProcessHost is annoying. The
|using| declarations help to some extent, but it's easier to just put
them in mozilla::ipc.

Differential Revision: https://phabricator.services.mozilla.com/D36538

--HG--
extra : moz-landing-system : lando
2019-07-10 22:37:35 +00:00
Bobby Holley
e40b45dc28 Bug 1562763 - Don't crash child or parent on failed InitBackground. r=nika
This can happen if the parent starts shutting down before a child has
finished starting up.

The main thread case in the child has always just warned, and this MOZ_CRASH was
added recently to the dispatch case in [1]. This can happen if the
parent starts shutting down while the child is still initializing.

[1] https://hg.mozilla.org/mozilla-central/rev/bd8fd9a22dc08d63cec68de475182a1b8eeeca4b

Differential Revision: https://phabricator.services.mozilla.com/D37302

--HG--
extra : moz-landing-system : lando
2019-07-10 22:37:32 +00:00
Barret Rennie
0b66a71420 Bug 1289211 - Rename InfallibleTArray to nsTArray in ipc/ r=nika
Differential Revision: https://phabricator.services.mozilla.com/D36961

--HG--
extra : moz-landing-system : lando
2019-07-10 03:31:24 +00:00
Jonathan Kingston
31441f82ea Bug 1560455 - rename CodebasePrincipal to ContentPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35504

--HG--
extra : moz-landing-system : lando
2019-07-08 16:37:45 +00:00
Sylvestre Ledru
fc2eb5393c Bug 1562642 - Part 2 - Add missing MPL2 headers r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D37146

--HG--
extra : moz-landing-system : lando
2019-07-08 09:27:47 +00:00
Victor Porof
251f88082d Bug 1561435 - Format ipc/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35909

--HG--
extra : source : 2fa9743b80561bb68a7b4bf76b1b636d97d82942
2019-07-05 10:48:16 +02:00
Narcis Beleuzu
a89b67e772 Backed out 15 changesets (bug 1479960, bug 1426526, bug 1534780, bug 1536697) for toolchain bustages on UniquePtrExtensions.h . CLOSED TREE
Backed out changeset a8518ea4b594 (bug 1479960)
Backed out changeset 7172762c4b87 (bug 1536697)
Backed out changeset 2ea5ccb8f3a1 (bug 1426526)
Backed out changeset d892a888fe9c (bug 1426526)
Backed out changeset 2c4d12bdfec3 (bug 1479960)
Backed out changeset 8a322064cf6d (bug 1479960)
Backed out changeset 47d387b6cd4a (bug 1479960)
Backed out changeset 8332565a6943 (bug 1479960)
Backed out changeset 9d7f1835f96f (bug 1479960)
Backed out changeset 0aa8af4965c5 (bug 1479960)
Backed out changeset 036809330a51 (bug 1479960)
Backed out changeset 39e18373e3d3 (bug 1479960)
Backed out changeset 6c2b995a9d30 (bug 1479960)
Backed out changeset 3c2b31744645 (bug 1534780)
Backed out changeset 26bb00a94d5d (bug 1534780)
2019-06-28 22:42:00 +03:00
shindli
c0ca77697c Merge inbound to mozilla-central. a=merge 2019-06-21 12:34:14 +03:00
Tarek Ziadé
a494b08766 Bug 1529022 - Add a GeckoChildProcessHosts iterator r=jld
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()

Differential Revision: https://phabricator.services.mozilla.com/D33920

--HG--
extra : moz-landing-system : lando
2019-06-21 01:33:47 +00:00
Jed Davis
d9d1bec632 Bug 1479960 - Add unit tests for shared memory freezing. r=froydnj
Also refactor SharedMemoryBasic::SystemProtect to allow testing cases
that are expected to fail.

Depends on D26748

Differential Revision: https://phabricator.services.mozilla.com/D26749

--HG--
rename : ipc/moz.build => ipc/gtest/moz.build
extra : moz-landing-system : lando
2019-06-20 22:40:46 +00:00
Jed Davis
1388eadfff Bug 1536697 - Fix error handling in base::SharedMemory::Map. r=froydnj
If mmap failed, we'd leave the memory_ member variable set to MAP_FAILED,
but everything else in this file checks for nullptr (and only nullptr) to
test if the pointer is valid.

Also, this removes the debug assertion that the mmap succeeded, to allow
writing unit tests where we expect it to fail (e.g., for insufficient
permissions).

Depends on D26747

Differential Revision: https://phabricator.services.mozilla.com/D26748

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:44 +00:00
Jed Davis
5c3a0a30d3 Bug 1426526 - Delete file_util from ex-Chromium IPC source. r=froydnj
Depends on D26746

Differential Revision: https://phabricator.services.mozilla.com/D26747

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:40 +00:00
Jed Davis
b1c82b278b Bug 1479960 - Add freezing of IPC shared memory. r=froydnj,kmag
This allows writing to shared memory and then making it read-only before
sharing it to other processes, such that a malicious sandboxed process
cannot regain write access.  This is currently available only in the
low-level base::SharedMemory interface.

The freeze operation exposes the common subset of read-only shared
memory that we can implement on all supported OSes: with some APIs
(POSIX shm_open) we can't revoke writeability from existing capabilies,
while for others (Android ashmem) we *must* revoke it.  Thus, we require
that the writeable capability not have been duplicated or shared to
another process, and consume it as part of freezing.  Also, because in
some backends need special handling at creation time, freezeability must
be explicitly requested.

In particular, this doesn't allow giving an untrusted process read-only
access to memory that the original process can write.

Note that on MacOS before 10.12 this will use temporary files in order to
avoid an OS security bug that allows regaining write access; those OS
versions are no longer supported by Apple (but are supported by Firefox).

Depends on D26742

Differential Revision: https://phabricator.services.mozilla.com/D26743

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:32 +00:00
Jed Davis
0a231ee919 Bug 1479960 - Clean up shared_memory_posix error handling. r=froydnj
This uses RAII to handle error-case cleanup in the POSIX backend for
SharedMemory::Create, to simplify the complexity that will be added to
support freezing.

Depends on D26741

Differential Revision: https://phabricator.services.mozilla.com/D26742

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:28 +00:00
Jed Davis
6559e7ab1f Bug 1479960 - Fix max_size in shared_memory_posix. r=froydnj
The Unix backend for shared memory needs to keep the mapped size to pass
to munmap, while the Windows backend doesn't.  Currently it's reusing the
max_size field, and then zeroing it when it's unmapped, which breaks the
freezing use case.  This patch uses a dedicated field for that.

Depends on D26740

Differential Revision: https://phabricator.services.mozilla.com/D26741

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:21 +00:00
Jed Davis
3c945a3e99 Bug 1479960 - Get rid of base::SharedMemory::handle. r=froydnj
Despite the comment saying not to use the "handle" except as an opaque
identifier, it is being used to pass the handle to other OS APIs.  Direct
access to the handle needs to be controlled to make sure freezing is
safe, so this patch replaces that with interfaces that are more explicit
about ownership and lifetime.

Depends on D26739

Differential Revision: https://phabricator.services.mozilla.com/D26740

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:19 +00:00
Jed Davis
b916fc745c Bug 1479960 - Remove SHM_ANON support. r=froydnj
FreeBSD's SHM_ANON is useful for the usual case of shared memory, but it
doesn't support freezing.  It could be re-added later, but for now it's
simplest to remove it (and use named shm instead) while refactoring.

Depends on D26738

Differential Revision: https://phabricator.services.mozilla.com/D26739

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:17 +00:00
Jed Davis
d32b9ba525 Bug 1534780 - Add free interconversion between UniqueFileHandle and ipc::FileDescriptor and use it in a few places. r=froydnj
Now that UniqueFileHandle can be used more widely, and with
ipc::FileDescriptor being essentially a copyable UniqueFileHandle, it
makes sense to add a move constructor and a "forget"-like method to
convert between them when needed.

Depends on D26737

Differential Revision: https://phabricator.services.mozilla.com/D26738

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:15 +00:00
Jed Davis
35bc3bb540 Bug 1534780 - Move ipc::FileDescriptor's UniquePtr instance into MFBT as UniqueFileHandle. r=froydnj
MozReview-Commit-ID: 7bbGVIjTTaJ

Differential Revision: https://phabricator.services.mozilla.com/D26737

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:13 +00:00