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

6593 Коммитов

Автор SHA1 Сообщение Дата
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
Nika Layzell 344d8d6622 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-21 21:53:11 +00:00
Nika Layzell 1d4aba6770 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-21 21:53:11 +00:00
Nika Layzell 68c606d1e5 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-21 21:53:10 +00:00
Nika Layzell 6de2add6d7 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-21 21:53:10 +00:00
Nika Layzell 4a956a2673 Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
2021-06-21 21:53:10 +00:00
Nika Layzell 1811e3331a 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-21 21:53:09 +00:00
Nika Layzell 56bc256e42 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-21 21:53:09 +00:00
Nika Layzell 4945c6bfd3 Bug 1706374 - Part 7: Add owning helpers for working with transport descriptors, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112772
2021-06-21 21:53:08 +00:00
Nika Layzell 681d4a66f5 Bug 1706374 - Part 6: Add Mozilla extensions to the Name type, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112771
2021-06-21 21:53:08 +00:00
Nika Layzell d02a8a14cc 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-21 21:53:08 +00:00
Nika Layzell 050548d334 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-21 21:53:07 +00:00
Nika Layzell 12db5b7e19 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-21 21:53:07 +00:00
Nika Layzell 8381830670 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-21 21:53:06 +00:00
Nika Layzell 2a2037d8e9 Bug 1706374 - Part 2: Format mojo/core/ports with clang-format, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112766
2021-06-21 21:53:06 +00:00
Nika Layzell 8008933c20 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-21 21:53:06 +00:00
Andi-Bogdan Postelnicu f07c975367 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,emilio
Updated with clang-format version 12.0.0 (taskcluster-FZRqPXamQIOU_i4hF0cAcg)

Differential Revision: https://phabricator.services.mozilla.com/D117905
2021-06-17 11:00:22 +00:00
Florian Quèze dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00
Iulian Moraru b02492de66 Backed out changeset 617a466d0cce (bug 1715257) for causing build bustages. CLOSED TREE 2021-06-17 10:58:16 +03:00
Florian Quèze 7b4906a6bd Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 06:12:10 +00:00
Aaron Klotz 93f41e2170 Bug 1707954: Part 3 - Add eager MTA creation to mscom::EnsureMTA; r=Jamie
* We make `EnsureMTA`'s default constructor `private`, and `ProcessRuntime` a friend.
  `ProcessRuntime` calls this to eagerly create the MTA.
* The default constructor uses the new-ish `CoIncrementMTAUsage` to create the
  MTA without requiring a dedicated thread (when available). Otherwise we
  fall back to the traditional method. In the latter case, we synchronously
  wait for the initialization to complete so that we are guaranteed to have
  an MTA when we return.
* Some minor refactoring to make it easier to do the sync wait in the
  default constructor. I also renamed a couple of things just to make them
  more clear.

Differential Revision: https://phabricator.services.mozilla.com/D113562
2021-06-14 21:53:18 +00:00
Aaron Klotz 0785438543 Bug 1707954: Part 1 - Change mscom::ProcessRuntime to ensure MTA creation during startup; r=Jamie
This patch does the following:

* General cleanup:
  * More explicit restrictions of how/when the various constructors are available.
  * `InitializeSecurity` is made `static`, since it doesn't really manipulate instance variables.
  * We move some logic for resolving `CoInitializeEx` flags into `GetDesiredApartmentType`.
* Addition of `PostInit`:
  * This doesn't do anything at the moment, but since I'm already making a bunch
    of changes, I wanted to add this too. `PostInit` is a static method that
    is invoked once the `ProcessRuntime` is finished initializing, and, when
    present, the sandbox is fully enabled.
* We call `EnsureMTA`'s default constructor to eagerly bring up the MTA. This
  causes all background threads to implicitly become members of the MTA, which
  means that we can eliminate `CoInitializeEx` calls throughout our codebase,
  since they're slow and most developers do not have a clear understanding of
  what those functions actually do.
  * This also simplifies the COM initialization in sandboxed content processes
    with Win32K lockdown, since if our main thread is in the implicit MTA, we
    can immediately initialize ourselves without needing to punt that work
    over to the persistent MTA thread.

Differential Revision: https://phabricator.services.mozilla.com/D113560
2021-06-14 21:53:17 +00:00
Alexandre Lissy 59f1595f14 Bug 1651133 - Double-check the build ID to avoid spurious about:restartrequired r=jld
Differential Revision: https://phabricator.services.mozilla.com/D115593
2021-06-14 10:33:19 +00:00