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

3176 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell 4d227d94ae Bug 1725335 - Streamline ownership and locking in MessageTask, r=ipc-reviewers,mccr8
This simplifies the logic around MessageTask's lifecycle to make
ownership as clear as possible and reduce the number of redundant
checks.

This new change no longer clears the mChannel member when the
MessageTask is disconnected, instead relying on isInList() to check
whether the MessageTask is still in the channel's mPending list. This is
already being automatically managed as the mPending list is modified,
and should avoid potential usage mistakes.

Differential Revision: https://phabricator.services.mozilla.com/D123140
2021-09-01 15:26:54 +00:00
Nika Layzell 28c8f793f9 Bug 1715755 - Part 3: Don't defer messages if the interrupt stack is empty, r=handyman
Previously this would misbehave as it couldn't get the interrupt stack.

Depends on D123149

Differential Revision: https://phabricator.services.mozilla.com/D123150
2021-08-25 18:30:25 +00:00
Nika Layzell 4cc950d178 Bug 1715755 - Part 2: Recover from unhandled special messages without crashing, r=handyman
This change instead recovers from unhandled special messages by reporting a
normal IPC error, which should be handled using the normal IPC error
mechanisms.

Depends on D123148

Differential Revision: https://phabricator.services.mozilla.com/D123149
2021-08-25 18:30:24 +00:00
Nika Layzell 6d8a72603f Bug 1727422 - Support arbitrary integer keys in nsTHashMap, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D123547
2021-08-25 16:31:08 +00:00
Mike Hommey c033e2536d Bug 1726474 - Preload rlbox library on Windows. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D123039
2021-08-25 07:39:00 +00:00
Cosmin Sabou 1958e4b9fe Backed out 4 changesets (bug 1726474) for causing windows build bustages. CLOSED TREE
Backed out changeset c7fcc6914b7c (bug 1726474)
Backed out changeset 1dcd8069568e (bug 1726474)
Backed out changeset 938043bb1ca2 (bug 1726474)
Backed out changeset e12c90f66a6c (bug 1726474)
2021-08-24 06:12:08 +03:00
Mike Hommey 44bb728fba Bug 1726474 - Preload rlbox library on Windows. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D123039
2021-08-24 02:52:18 +00:00
Csoregi Natalia 84d67f5d03 Backed out 4 changesets (bug 1726474) for causing crashes. CLOSED TREE
Backed out changeset 5add6784a784 (bug 1726474)
Backed out changeset e2047ab95703 (bug 1726474)
Backed out changeset d53f62933fd0 (bug 1726474)
Backed out changeset 796a54dcb5f0 (bug 1726474)
2021-08-24 04:49:04 +03:00
Mike Hommey 2829072aeb Bug 1726474 - Preload rlbox library on all platforms. r=nika
Notably, on Windows, the sequences of loading/unloading in child processes trigger https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/toolkit/xre/dllservices/UntrustedModulesData.cpp#324

Differential Revision: https://phabricator.services.mozilla.com/D123039
2021-08-24 01:01:38 +00:00
Andi-Bogdan Postelnicu 9945b94835 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.1 (taskcluster-dNZqCRqWRTqa6cZxPKxh7Q)

Differential Revision: https://phabricator.services.mozilla.com/D122814
2021-08-23 09:30:23 +00:00
Mike Hommey 14a11072e2 Bug 1726476 - Adjust GetSandboxedRLBoxPath for the changes in rlbox_wasm2c_sandbox. r=nika
rlbox_wasm2c_sandbox was adjusted to avoid using LoadLibraryA (rejected by
build/clang-plugin/LoadLibraryUsageChecker.cpp), so we adjust
GetSandboxedRLBoxPath (which is used to feed it) to return an UTF-16
string on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D123025
2021-08-20 23:33:05 +00:00
Mike Hommey 6d5f4e8060 Bug 1725521 - Simplify getting the rlbox library path. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D122552
2021-08-17 00:16:03 +00:00
Paul Bone 1eea9a0557 Bug 1710552 - pt 2. Inform the idle scheduler when we initiate a GC r=smaug
This lets the idle scheduler know that we've initiated a GC that we didn't
ask its permission for.  Eg the JS engine hit a threshold.  It now uses this
info when scheduling GCs for other processes.

Differential Revision: https://phabricator.services.mozilla.com/D120831
2021-08-13 04:06:26 +00:00
Paul Bone 0d0bbcac0f Bug 1710552 - pt 1. Prepare for GCs being denied r=smaug
This patch also:
 * adds an assertion to KillGCRunner() to ensure it's never killed if
   needed, now that there are more calls to KillGCRunner(), some calls have
   been moved eg in nsJSEnvironment so as not to kill the runner a little
   later and keep the assertions happy.

 * IdleSchedulerChild will decline a request for a GC if there's already a
   request in flight.

 * CCGCScheduler will check if a GC is already in progress when handling the
   parents' response to a GC request.

Differential Revision: https://phabricator.services.mozilla.com/D120830
2021-08-13 04:06:25 +00:00
Paul Zuehlcke 3a8091d1c2 Bug 1673889 - Remove topLevelStorageAreaPrincipal. r=timhuang,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D122364
2021-08-11 18:51:20 +00:00
Gabriele Svelto 65f2ae5b03 Bug 1723934 - Remove old and useless crash annotations r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D121709
2021-08-09 20:08:17 +00:00
Niklas Goegge 6763769587 Bug 1723954: Return NS_OK if PrincipalInfoToPrincipal fails. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D121867
2021-08-05 13:58:41 +00:00
Doug Thayer d8acee36a4 Bug 1722515 - Fix WindowsMessageLoop no-a11y breakage r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D121660
2021-08-04 12:56:14 +00:00
Marian-Vasile Laza e954091acf Backed out 2 changesets (bug 1720965) for causing bustages on nsContentUtils.cpp. CLOSED TREE
Backed out changeset 2ed56ddce45a (bug 1720965)
Backed out changeset 3531708ab54e (bug 1720965)
2021-08-04 03:14:29 +03:00
Jeff Gilbert fba93f87af Bug 1720965 - Give up on move semantics for Shmem for now. r=nika
Don't pretend that it's not a copy, as this causes readers to get the
wrong impression of how it behaves.

Differential Revision: https://phabricator.services.mozilla.com/D120124
2021-08-03 20:06:55 +00:00
Randell Jesup ecb0c56479 Bug 1687843: PreallocatedProcessManager will return a launching process if one exists r=nika
Differential Revision: https://phabricator.services.mozilla.com/D118226
2021-07-24 03:25:59 +00:00
Nika Layzell c705251ce8 Bug 1719577 - Part 8: Remove some unused methods from MessageChannel, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D119356
2021-07-23 19:14:59 +00:00
Nika Layzell 99a0665a8b Bug 1719577 - Part 7: Remove outdated comment, r=handyman
This comment refers to the old ProcessLink implementation, and was missed when
that implementation was removed.

Differential Revision: https://phabricator.services.mozilla.com/D119355
2021-07-23 19:14:58 +00:00
Nika Layzell 639ed70cb4 Bug 1719577 - Part 6: More consistently use the monitor during MessageChannel shutdown, r=handyman
This should make the logic around clearing a MessageChannel more obviously
correct by holding the mutex when accessing fields which are traditionally
guarded by the mutex. These lock calls shouldn't introduce performance issues
as the lock should be uncontended.

Differential Revision: https://phabricator.services.mozilla.com/D119354
2021-07-23 19:14:58 +00:00
Nika Layzell 93f8303221 Bug 1719577 - Part 5: Remove the now-unused `ChannelOpening` state, r=handyman
This state was only used by the ProcessLink MessageLink implementation, and no
longer exists with the new PortLink implementation, so can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D119353
2021-07-23 19:14:58 +00:00
Nika Layzell 30d790aee6 Bug 1719577 - Part 4: Hold the monitor for more of `MessageChannel::Open`, r=handyman
This simplifies some of the reasoning about when to hold locks by holding it
when setting all monitor-guarded fields.

Differential Revision: https://phabricator.services.mozilla.com/D119352
2021-07-23 19:14:57 +00:00
Nika Layzell 64fd825e97 Bug 1719577 - Part 3: Remove dead WaitForIncomingMessage function, r=handyman
This method is never called.

Differential Revision: https://phabricator.services.mozilla.com/D119351
2021-07-23 19:14:57 +00:00
Nika Layzell 0e37500335 Bug 1719577 - Part 2: Create mMonitor eagerly in MessageChannel's constructor, r=handyman
Now that PortLink is the only MessageLink implementation, it is no longer
necessary to support sharing a single `RefCountedMonitor` between multiple
MessageChannels, meaning that we can construct the monitor directly in the
`MessageChannel` constructor. The monitor still needs to be refcounted due to
being used by the PortLink as part of the listener implementation.

Differential Revision: https://phabricator.services.mozilla.com/D119350
2021-07-23 19:14:56 +00:00
Nika Layzell 488fc0d1be Bug 1719577 - Part 1: Use inline initializers for MessageChannel fields, r=handyman
This makes things generally more clear, and avoids a long list of initializers
in the MessageChannel constructor. In addition, some fields which are never
modified are marked as `const`.

Differential Revision: https://phabricator.services.mozilla.com/D119349
2021-07-23 19:14:56 +00:00
Kashav Madan 5781dca888 Bug 1720688 - Support extended attribute syntax in protocol declarations, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D119975
2021-07-22 02:24:43 +00:00
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 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
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
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