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

6615 Коммитов

Автор SHA1 Сообщение Дата
Jed Davis 4737104967 Bug 1440103 - Fix handle leak in IPC process launching. r=handyman
We use the process handle returned from `CreateProcess` to derive
another handle with more permissions, but the original handle is never
closed.  This bug appears to be fairly old: it existed before this code
was converted to use MozPromise.

Currently we provide the original handle to external consumers of the
launch promise; this patch resolves the promise with the privileged
handle instead and closes the original one.  (One consumer uses the
handle only to obtain the pid, and the rest don't use it at all, so this
shouldn't change anything.)

As a related cleanup, `ProcessLaunchPromise` is now exclusive (because
it's resolved with resources which are consumed) and no longer declared
in the header file (because it's used only internally).

Differential Revision: https://phabricator.services.mozilla.com/D119820
2021-07-15 22:20:34 +00:00
Florian Quèze ca7bbcc752 Bug 1720374 - Remove MOZ_GECKO_PROFILER ifdefs that are not useful, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119810
2021-07-15 22:04:23 +00:00
Florian Quèze 57d1e300f5 Bug 1720362 - Remove the last MOZ_GECKO_PROFILER ifdefs in ipc code, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119801
2021-07-15 22:04:22 +00:00
Nika Layzell 7ad5d70418 Bug 1718333 - Remove unnecessary AssertLinkThread assertions, r=handyman
After looking through the methods which have this assertion, I couldn't
find any examples of places where not having a specific "link thread"
sequence would cause any issues. I think these assertions can and should
be removed.

The main change required by this was to remove the `!NS_IsMainThread()`
assertion from the SchedulerGroup listener. Due to how callbacks work,
it would be possible for a vsync message to be detected by a
MessageChannel from the main thread if it was sent before the channel
was bound. I don't believe that this change should cause any issues.

Differential Revision: https://phabricator.services.mozilla.com/D119348
2021-07-15 21:09:55 +00:00
Nika Layzell e620d25a35 Bug 1715167 - Part 6: Use the unsandboxed result principal as precursor for sandbox principals, r=ckerschb,ngogge
This change stores a generated nsID directly on the LoadInfo, rather
than the full SandboxedLoadingPrincipal. This allows for the sandboxed
principal to be constructed from GetChannelResultPrincipal using the
unsandboxed result principal as a precursor, rather than the loading
principal.

The nsID is reset by HttpChannelBase whenever a non-internal redirect
occurs to reduce the chance of multiple null result principals during a
redirect with the same nsID, but different precursors.

Depends on D119692

Differential Revision: https://phabricator.services.mozilla.com/D119693
2021-07-15 21:09:15 +00:00
Tom Ritter 1b9b6b72db Bug 1666222: Cut over a ton of NowUnfuzzed calls -> Now 4/5 r=smaug,extension-reviewers,zombie
With Fuzzyfox removed, Now() does what NowUnfuzzed() did.

Differential Revision: https://phabricator.services.mozilla.com/D119639
2021-07-14 18:18:17 +00:00
Tom Ritter 42c0ec86b4 Bug 1666222: Rip fuzzyfox out of the timestamp classes 2/5 r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D119637
2021-07-14 18:18:16 +00:00
Tooru Fujisawa 8f6310e25c Bug 1708450 - Move call and construct functions into js/public/CallAndConstruct.h. r=nbp
Depends on D119619

Differential Revision: https://phabricator.services.mozilla.com/D119620
2021-07-13 11:52:43 +00:00
Tooru Fujisawa cc92ef732d Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Nika Layzell 80d5716044 Bug 1717728 - Hold MessageChannel's monitor when creating PortLink, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118562
2021-07-12 20:36:20 +00:00
Paul Bone 5cbb4adf3a Bug 1718415 - GetMainThreadIdleScheduler checks if scheduler is destroyed r=smaug
If GetMainThreadIdleScheduler is called after IPC is destroyed it can
attempt to start it as if it's the first use, which crashes. Instead check
if we've already destroyed the scheduler once and if so then return early.

Differential Revision: https://phabricator.services.mozilla.com/D119251
2021-07-07 23:43:01 +00:00
Doug Thayer b5f7314e3e Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-07-07 22:37:14 +00:00
Narcis Beleuzu 1ff027d763 Backed out changeset acf2d74efbbc (bug 1714212) for SM bustages on NativeNt.h 2021-07-07 23:13:42 +03:00
Doug Thayer dc9c284076 Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-07-07 18:17:36 +00:00
Niklas Goegge a527e368f3 Bug 1714645: Remove NullPrincipalURI. r=ckerschb,nika
Differential Revision: https://phabricator.services.mozilla.com/D118490
2021-07-06 08:23:12 +00:00
Makoto Kato f912325645 Bug 1719115 - Add riscv64 defines to build/build_config.h. r=firefox-build-system-reviewers,andi
mozilla-central has some imported files of build_config.h from Chromium.
Actually although they doesn't have riscv64 defines yet, I would like to
add it to build Firefox for riscv64.

Differential Revision: https://phabricator.services.mozilla.com/D119051
2021-07-06 08:05:40 +00:00
Jed Davis 2257145e1c Bug 1635451 - Minimize content processes' connections to the X server. r=jgilbert,stransky,nika
This patch launches content processes with the `MOZ_HEADLESS` env var set
if they're using GTK with an X11 display (and there's no other reason
they'd need GTK).

The goal is to avoid exhausting Xorg's default limit of 256 clients if
there are many content processes due to Fission.  If these conditions
are met, the content process doesn't need to eagerly connect to the X
server.  This does not affect the sandbox policy, and content processes
can still use X if needed for, e.g.,  WebGL.

The boolean pref `dom.ipc.avoid-gtk`, set by default, controls this
feature.  In the future it could also be extended to minimize GTK use
with Wayland displays.

Note that disabling `widget.non-native-theme.enabled`, which is also
enabled by default, will restore the use of X11 in all content processes
even if this pref is set; the alternative is that widgets wouldn't render
in that case.

This change will also save some memory for now-unnecessary instances of
GTK's global state, and improve content process startup time.

Remove also the temp pref dom.ipc.remote-mozIcon because it cannot work
anymore with the content process being headless.

Differential Revision: https://phabricator.services.mozilla.com/D112197
2021-07-06 07:42:42 +00:00
Eden Chuang 4ce2d06b79 Bug 1714299 - Correct the opaque response judgment for opaque response blocking. r=necko-reviewers,annevk,dragana
An opaque response should be not only cross-origin but also be request with no_cors request mode.

To filter out the request with mode Same_origin, navigate, and cors. This patch reuses the algorithm in InternalRequest/FetchDriver to decide whether a response is an opaque response.

https://searchfox.org/mozilla-central/rev/da5d08750e504f3710f7ea051327d9c311c39902/dom/fetch/InternalRequest.cpp#331
https://searchfox.org/mozilla-central/rev/da5d08750e504f3710f7ea051327d9c311c39902/dom/fetch/FetchDriver.cpp#1153,1157

Differential Revision: https://phabricator.services.mozilla.com/D117086
2021-07-02 23:11:55 +00:00
Dorel Luca bc6f2486e2 Backed out changeset 11d1710e481f (bug 1714212) for Browser-chrome failures in toolkit/xre/test/browser_checkdllblockliststate.js. CLOSED TREE 2021-06-26 09:45:29 +03:00
Doug Thayer c3702a9447 Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-06-26 04:10:50 +00:00
Nika Layzell 25ecbccf4f Bug 1717993 - Hold a WeakPtr to mExistingListener in NodeChannel, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118868
2021-06-25 21:30:49 +00:00
Florian Quèze cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Nika Layzell aa2b0966b8 Bug 1713148 - Part 6: Release sChannelCountMutex before calling report callback, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118431
2021-06-22 18:17:26 +00:00
Nika Layzell 5cc51fa13f Bug 1713148 - Part 5: Remove ThreadLink, r=handyman
This removes the last form of unique link between two MessageChannels so that
all MessageChannels communicate using PortLink, as it is fairly straightforward
to use PortLink to communicate between two threads in-process.

Differential Revision: https://phabricator.services.mozilla.com/D116672
2021-06-22 18:17:25 +00:00
Nika Layzell 7dba3a39f8 Bug 1713148 - Part 4: Remove ProcessLink, r=handyman
After the changes in part 3, this type is now dead code and can be fully
removed.

Differential Revision: https://phabricator.services.mozilla.com/D116671
2021-06-22 18:17:25 +00:00
Nika Layzell 620418372a Bug 1713148 - Part 3: Use ports for Endpoint-created actors, r=handyman
This adjusts how all actors created using `Endpoint` behave so that they now
use ports instead of creating a unique native channel connection between each
pair of processes.

Differential Revision: https://phabricator.services.mozilla.com/D116670
2021-06-22 18:17:25 +00:00
Nika Layzell c5447d3d6a Bug 1713148 - Part 2: Support port attachments on IPC messages, r=handyman
These port attachments are stored directly on the IPC::Message until the
message is ready to be routed to another process, at which point they will be
attached to the port in WillBeRoutedExternally. When the message is then
received on the other side, the ports will be re-extracted from the
UserMessageEvent before it is discarded and re-added to the IPC::Message so
that serializers only need to interact directly with the IPC::Message type.

Differential Revision: https://phabricator.services.mozilla.com/D116669
2021-06-22 18:17:24 +00:00
Nika Layzell cd803f0116 Bug 1713148 - Part 1: Expose UserMessageEvent to WillBeRoutedExternally, r=handyman
This is used because, unlike in Mojo, we cannot get from the IPC::Message
object to its enclosing UserMessageEvent object to attach more ports to it, and
this extra parameter makes that easy to do.

Differential Revision: https://phabricator.services.mozilla.com/D116668
2021-06-22 18:17:24 +00:00
Nika Layzell 599b58f458 Bug 1706374 - Part 13: Remove the event footer from an IPC::Message when deserializing, r=handyman,glandium
This unfortunately requires a new method to be added to BufferList to
support truncating the buffer to a particular iterator.

Differential Revision: https://phabricator.services.mozilla.com/D116666
2021-06-22 18:17:23 +00:00
Nika Layzell 7802bbb486 Bug 1706374 - Part 12b: Use NodeController for primary process channels, r=handyman
This extends on the changes in part 12a and consumes the new PortRef-based API
in all existing process types other than the fork server. The IPDL C++ unit
tests were already broken before this change, and were not updated.

Differential Revision: https://phabricator.services.mozilla.com/D112777
2021-06-22 18:17:23 +00:00
Nika Layzell 4527652311 Bug 1706374 - Part 12a: Initialize NodeController when creating IO thread, r=handyman
This also consumes the existing channel created when launching a process to
create the the conneciton required by NodeController for communicating between
processes. In part 12b, consumers of the broken APIs will be adjusted to use
the new interface.

The new routing approach is not used for the fork server process, as an IO
thread and the NodeController object cannot be initialized before the fork has
been performed, and the IPC requirements of that process are fairly minimal.

Differential Revision: https://phabricator.services.mozilla.com/D112776
2021-06-22 18:17:22 +00:00
Nika Layzell 985adb750c Bug 1706374 - Part 11: Add NodeController component bridging IPC and Ports, r=handyman
The NodeController and NodeChannel types act as the backbone connecting the
existing IPC logic and driving the ports routing code. Individual NodeChannel
objects wrap and respond to messages from IPC::Channel, and the NodeController
orchestrates all messaging for a process.

The design of these types are inspired by the types with the same names from
Mojo but have been simplified and streamlined to only support features used by
Gecko.

Support for attaching ports or handles to messages hasn't been added yet, but
can be added in follow-up patches.

Differential Revision: https://phabricator.services.mozilla.com/D112775
2021-06-22 18:17:22 +00:00
Nika Layzell 9ae1129462 Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
2021-06-22 18:17:21 +00:00
Nika Layzell 58c8c1a2c1 Bug 1706374 - Part 9: Allow reading OtherPid() from an opened IPC::Channel, r=handyman
This will be used to handle pre-opened channels more reliably in ports code.

Differential Revision: https://phabricator.services.mozilla.com/D112774
2021-06-22 18:17:21 +00:00
Nika Layzell 7771beab66 Bug 1706374 - Part 8: Add support for separate footers to IPC::Message, r=handyman
These will be used to serialize extra event metadata into IPC messages when
they're sent over the ports infrastructure. In the future better integration
may be used to reduce the overhead of this if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D112773
2021-06-22 18:17:20 +00:00
Nika Layzell d59f87aea5 Bug 1706374 - Part 7: Add owning helpers for working with transport descriptors, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112772
2021-06-22 18:17:20 +00:00
Nika Layzell da31167de5 Bug 1706374 - Part 6: Add Mozilla extensions to the Name type, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112771
2021-06-22 18:17:20 +00:00
Nika Layzell 3dbeb59016 Bug 1706374 - Part 5b: Apply suggested clang-tidy fixes to ports, r=handyman
Mechanical change applying clang-tidy fixes

Differential Revision: https://phabricator.services.mozilla.com/D112770
2021-06-22 18:17:19 +00:00
Nika Layzell c73b73620e Bug 1706374 - Part 5a: Apply suggested clang-tidy fixes to the ports code, r=handyman
Mechanical change applying clang-tidy fixes

Differential Revision: https://phabricator.services.mozilla.com/D112769
2021-06-22 18:17:19 +00:00
Nika Layzell 42952972ef Bug 1706374 - Part 4: Run ports gtests in tree, r=handyman
The ports library import came with 2 gtests. This patch gets them running under
our gtest runner to ensure we don't break the ports functionality.

Differential Revision: https://phabricator.services.mozilla.com/D112768
2021-06-22 18:17:19 +00:00
Nika Layzell 03f4afa8fb Bug 1706374 - Part 3: Get mojo/core/ports building in libxul, r=handyman
This involves replacing a number of types normally provided by chromium's
`base` with their XPCOM counterparts etc.

Differential Revision: https://phabricator.services.mozilla.com/D112767
2021-06-22 18:17:18 +00:00
Nika Layzell d1f7ecf8e1 Bug 1706374 - Part 2: Format mojo/core/ports with clang-format, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112766
2021-06-22 18:17:18 +00:00
Nika Layzell 12a9501583 Bug 1706374 - Part 1: Import the mojo/core/ports directory from Chromium, r=handyman
This initial import does not build, and will be made to build in following
parts.

Differential Revision: https://phabricator.services.mozilla.com/D112765
2021-06-22 18:17:17 +00:00
Mike Hommey 744db845c6 Bug 1700534 - Coalesce RLBox wasmboxed libraries. r=firefox-build-system-reviewers,shravanrn,bholley,andi,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D116440
2021-06-22 05:31:33 +00:00
Butkovits Atila 83f57b5c69 Backed out 22 changesets (bug 1714226, bug 1706374, bug 1713148) for causing build bustages on MessageChannel.cpp. CLOSED TREE
Backed out changeset ea469eaa54ca (bug 1713148)
Backed out changeset fd8523d5126e (bug 1713148)
Backed out changeset f2e5309c914c (bug 1713148)
Backed out changeset 2da57973ed55 (bug 1713148)
Backed out changeset 677e1ee99bb2 (bug 1713148)
Backed out changeset b4c0619e79bf (bug 1706374)
Backed out changeset c02fa459e77d (bug 1706374)
Backed out changeset 72dc6537cf0b (bug 1706374)
Backed out changeset 48088463c656 (bug 1706374)
Backed out changeset b09ae4c3a94b (bug 1706374)
Backed out changeset 04422175004b (bug 1706374)
Backed out changeset 110b2384e7d1 (bug 1706374)
Backed out changeset ab2b086abbd4 (bug 1706374)
Backed out changeset ffde07f73249 (bug 1706374)
Backed out changeset c6303af17ff4 (bug 1706374)
Backed out changeset 02249671c2f9 (bug 1706374)
Backed out changeset a6a5d05b5636 (bug 1706374)
Backed out changeset e21b6defb805 (bug 1706374)
Backed out changeset c72c5be9ddb1 (bug 1706374)
Backed out changeset 23cd961575a6 (bug 1706374)
Backed out changeset b412d6e9e145 (bug 1706374)
Backed out changeset a8ec285d6472 (bug 1714226)
2021-06-22 04:03:56 +03:00
Nika Layzell 8e8aa56ee2 Bug 1713148 - Part 5: Remove ThreadLink, r=handyman
This removes the last form of unique link between two MessageChannels so that
all MessageChannels communicate using PortLink, as it is fairly straightforward
to use PortLink to communicate between two threads in-process.

Differential Revision: https://phabricator.services.mozilla.com/D116672
2021-06-21 21:53:13 +00:00
Nika Layzell 03646b0682 Bug 1713148 - Part 4: Remove ProcessLink, r=handyman
After the changes in part 3, this type is now dead code and can be fully
removed.

Differential Revision: https://phabricator.services.mozilla.com/D116671
2021-06-21 21:53:13 +00:00
Nika Layzell 758f8f7d8f Bug 1713148 - Part 3: Use ports for Endpoint-created actors, r=handyman
This adjusts how all actors created using `Endpoint` behave so that they now
use ports instead of creating a unique native channel connection between each
pair of processes.

Differential Revision: https://phabricator.services.mozilla.com/D116670
2021-06-21 21:53:13 +00:00
Nika Layzell ddf32ef8de Bug 1713148 - Part 2: Support port attachments on IPC messages, r=handyman
These port attachments are stored directly on the IPC::Message until the
message is ready to be routed to another process, at which point they will be
attached to the port in WillBeRoutedExternally. When the message is then
received on the other side, the ports will be re-extracted from the
UserMessageEvent before it is discarded and re-added to the IPC::Message so
that serializers only need to interact directly with the IPC::Message type.

Differential Revision: https://phabricator.services.mozilla.com/D116669
2021-06-21 21:53:12 +00:00
Nika Layzell 0bfe790a38 Bug 1713148 - Part 1: Expose UserMessageEvent to WillBeRoutedExternally, r=handyman
This is used because, unlike in Mojo, we cannot get from the IPC::Message
object to its enclosing UserMessageEvent object to attach more ports to it, and
this extra parameter makes that easy to do.

Differential Revision: https://phabricator.services.mozilla.com/D116668
2021-06-21 21:53:12 +00:00