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

23549 Коммитов

Автор SHA1 Сообщение Дата
Manuel Bucher d9951694c2 Bug 1753730 - Test that the cached image from the early hint preload is used r=necko-reviewers,ckerschb,dragana,kershaw
* Test that the preloaded image is actually used and that no preload requests
  are made if the resource shouldn't be preloaded

Differential Revision: https://phabricator.services.mozilla.com/D139740
2022-05-11 15:41:39 +00:00
Manuel Bucher b01d289292 Bug 1753730 - Add EarlyHintPreloader to load 103 Early Hint responses into the cache r=necko-reviewers,ckerschb,dragana,kershaw
Currently only same origin requests are preloaded and preloads in the
secure context. This may change in the future to match W3C decisions and
Chromes behavior.

Also only images get preloaded. This will change in the future to cover
asset types.

Currently the anchor isn't parsed correctly yet[1], so this will be
fixed in a future patch.

On non-2xx responses of the main document all ongoing preloads get
canceled. Already completed preloads don't get affected and are in the
cache.

It is currently untested whether unused preloads don't have side effects.

Another future patch should cover adding the preload to the devtools.

[1]: https://datatracker.ietf.org/doc/html/rfc8288#section-3.2

Differential Revision: https://phabricator.services.mozilla.com/D137885
2022-05-11 15:41:39 +00:00
Manuel Bucher 318581f7cb Bug 1753730 - Fix early hint not propagating with http proxy r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D141760
2022-05-11 15:41:38 +00:00
Noemi Erli 45276205df Backed out 22 changesets (bug 1696894, bug 1759569, bug 1754031, bug 1759563, bug 1759572, bug 1754004) for causing leack failures CLOSED TREE
Backed out changeset 673ecd5337e1 (bug 1754004)
Backed out changeset ecbf5f3c51de (bug 1754004)
Backed out changeset fc6c39f56d21 (bug 1754004)
Backed out changeset 5b3d58fbaf9d (bug 1696894)
Backed out changeset 2e56c89cf55d (bug 1754004)
Backed out changeset b7723490f025 (bug 1754004)
Backed out changeset 1dfbf61ff5dd (bug 1754004)
Backed out changeset e73abb071bb3 (bug 1754004)
Backed out changeset f9abe4fbf501 (bug 1754004)
Backed out changeset ee7aeb631cd9 (bug 1754004)
Backed out changeset d66aacfcf983 (bug 1754004)
Backed out changeset 5c2872ad6912 (bug 1754004)
Backed out changeset e1ae48f30d2c (bug 1754004)
Backed out changeset 849b63707d7f (bug 1754004)
Backed out changeset 36563e3b1e04 (bug 1754004)
Backed out changeset ccb4be659107 (bug 1754004)
Backed out changeset 659581d4159b (bug 1754004)
Backed out changeset 611ea76d7a9c (bug 1754004)
Backed out changeset 9b24b561698c (bug 1759572)
Backed out changeset f820e0f209ff (bug 1759563)
Backed out changeset 8d82066fa181 (bug 1759569)
Backed out changeset a2835afab1ad (bug 1754031)
2022-05-11 06:16:25 +03:00
Cristian Tuns 23517e3d2b Backed out 3 changesets (bug 1758745, bug 1758740, bug 1762462) for causing mochitest failures on test_storagePermissionsAccept.html CLOSED TREE
Backed out changeset fa222c0a9a26 (bug 1762462)
Backed out changeset 9daa04b239f9 (bug 1758745)
Backed out changeset c18aecb431c0 (bug 1758740)
2022-05-10 20:12:45 -04:00
Nika Layzell 05a9855755 Bug 1696894 - Clear active logins after browser_post_auth.js, r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D142127
2022-05-10 22:27:47 +00:00
Nika Layzell 94e20acc6a Bug 1754004 - Part 13: Relax interface check in nsHttpTransaction, r=necko-reviewers,kershaw
Previously, the check when reporting progress from a nsHttpTransaction would
always report no progress when a non-seekable input stream is used as the
request data stream. Before Part 5, we incorrectly always reported the
nsBufferedStream which we wrap request streams with as seekable, meaning that
this check would pass and the progress reporting would work.

This change relaxes the check to instead check for nsITellableStream which is
actually guaranteed by the nsBufferedStream wrapper, and provides the Tell
method being used.

Differential Revision: https://phabricator.services.mozilla.com/D144450
2022-05-10 22:27:47 +00:00
Nika Layzell 7e0bd4473f Bug 1754004 - Part 12: Update browser_post_auth.js assertions, r=necko-reviewers,kershaw
Previously this test was failing due to issues with upload streams not
being seekable. With the other changes in this bug, we now always
ensure that upload streams are consistently cloneable and seekable,
meaning that this issue should no longer occur, and we don't need to
re-start the request for it to succeed.

I also removed various pieces of dead code, as well as some logic
disabling bfcacheInParent, as that seems to no longer be required.

Differential Revision: https://phabricator.services.mozilla.com/D141777
2022-05-10 22:27:46 +00:00
Nika Layzell 024c6e0c0a Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-10 22:27:46 +00:00
Nika Layzell 8d59d55b57 Bug 1754004 - Part 9: Remove PartiallySeekableInputStream, r=asuth,necko-reviewers,kershaw
This interface is misleading, as it doesn't allow seeking the entire type
despite providing a `nsISeekableStream` interface, and is no longer necessary
due to the changes in an earlier part.

Differential Revision: https://phabricator.services.mozilla.com/D141046
2022-05-10 22:27:45 +00:00
Nika Layzell a520c86f48 Bug 1754004 - Part 8: Remove SeekableStreamWrapper, r=asuth,necko-reviewers,kershaw
This type is no longer necessary, and has various issues due to behaving
incorrectly when used with async streams or streams which are not nsIPipe.

Differential Revision: https://phabricator.services.mozilla.com/D141045
2022-05-10 22:27:44 +00:00
Nika Layzell 873f2d6175 Bug 1754004 - Part 7: Consistently normalize upload streams passed to HTTP channels, r=asuth,necko-reviewers,dragana
Unfortunately, upload streams used by necko have various odd behaviours
and requirements which happened to be usually preserved by the previous
IPC serialization logic, but were not consistently preserved. This
includes requiring the stream to be synchronous (as some consumers such
as WebExtensions and DevTools appear to read it assuming Available() is
the stream length), seekable (as it needs to be rewound in various
places), and cloneable (as the stream information is often handed out to
other components).

In addition, the WebExtension WebRequest code makes assumptions about
the specific topology of the input stream for optimization purposes,
meaning that nsMultiplexInputStreams need to be preserved.

The way this was previously handled was by copying the entire payload
into a nsStorageStream as an async operation. This happened very
infrequently in out test suite, however, and had some issues. It could
lead to data loss if the stream was a nsMIMEInputStream (as the metadata
would be lost), and would destroy the topology required by WebRequest.

This patch changes the code to instead manually walk and replace streams
in the input stream's data structure, to efficiently copy only the
required data, preserve the invariants, and make the type seekable
before AsyncOpen continues. This helps keep the complexity of the
invariants HTTPChannel depends on out of generic input stream handling
code.

In addition, due to how early this happens, it replaces the need for
PartiallySeekableInputStream which will be removed a later part.

Differential Revision: https://phabricator.services.mozilla.com/D141044
2022-05-10 22:27:44 +00:00
Nika Layzell 828491c5f2 Bug 1754004 - Part 5: Only implement nsISeekableStream on nsBufferedStreams if it's implemented by the underlying stream, r=asuth,necko-reviewers,dragana
Previously, nsBufferedStreams would always implement nsISeekableStream, whether
or not the underlying stream did, and would only fail when trying to seek. This
makes it much more difficult to compensate and correctly transform streams when
they need to be seekable.

Differential Revision: https://phabricator.services.mozilla.com/D141042
2022-05-10 22:27:43 +00:00
Nika Layzell a54be9b854 Bug 1754004 - Part 4: Stop requiring nsMIMEInputStream to be seekable, r=asuth,necko-reviewers,dragana
This type was originally made to be required to be seekable because a
non-seekable stream would lose the nsMIMEInputStream metadata information when
it was wrapped by the HTTP channel using PartiallySeekableInputStream, leading
to potential bugs.

Changes in a later part will change HTTP channel wrapping to ensure that this
metadata is preserved in all relevant cases, so this requirement can be
relaxed. This is important, as the check was previously being bypassed for
RemoteLazyInputStream in the content process, as nsBufferedInputStream would
incorrectly report that it implemented nsISeekableStream even if the underlying
stream wasn't seekable.

Differential Revision: https://phabricator.services.mozilla.com/D141041
2022-05-10 22:27:43 +00:00
Nika Layzell 76cdaba44a Bug 1754004 - Part 3: Move RemoteLazyInputStream to its own toplevel protocol, r=asuth,necko-reviewers,dragana
This is a complete rewrite of RemoteLazyInputStream to run off of its own
toplevel protocol, rather than being managed by other protocols like
PBackground or PContent. This should improve performance thanks to no longer
needing to operate on a main or worker thread, and due to no longer needing the
migration step for the stream actor.

This also acts as a step towards no longer requiring a manager actor to
serialize input streams, as the type is now actor-agnostic, and should support
being sent over IPC between any pair of processes.

Differential Revision: https://phabricator.services.mozilla.com/D141040
2022-05-10 22:27:42 +00:00
Nika Layzell 728ba534f6 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-10 22:27:42 +00:00
Nika Layzell f9f3cc6138 Bug 1754004 - Part 1: Switch IPCStream to use DataPipe instead of P{ChildToParent,ParentToChild}Stream, r=asuth,necko-reviewers,kershaw
This gives us various positive benefits, such as using a shared memory ring
buffer for faster communication, not having data streaming being bound to the
thread which transferred the nsIInputStream (which is often the main thread),
and the ability for some backpressure to be applied to data streaming.

After this change, the "delayed start" parameter for IPCStream serialization is
less relevant, as backpressure will serve a similar purpose. It will still be
used to determine whether or not to use RemoteLazyInputStream when serializing
from the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D141038
2022-05-10 22:27:41 +00:00
Nika Layzell 7aead901b8 Bug 1759563 - Add SerializedComplexity to limit the complexity of serialized IPCStream instances, r=asuth,necko-reviewers,dragana
This will improve the efficiency of serializing large data pipes, which in bad
cases can end up serializing very small amounts of data in individual pipes
over IPC, and acts as a compliment to the existing logic for limiting
serialized message sizes. It is also necessary for the changes in bug 1754004,
which require the ability to include FileDescriptor inline in the message,
which could blow out our FileDescriptor count limits if pipe creation was
unlimited.

In some tests, this change reduces the number of pipes required to serialize a
nsIInputStream from over 5000 to 1.

Differential Revision: https://phabricator.services.mozilla.com/D141036
2022-05-10 22:27:41 +00:00
Nika Layzell 52ee800295 Bug 1754031 - AsyncWait implementations should support updating flags on an existing listener, r=asuth,necko-reviewers,dragana
This operation is often performed by nsAStreamCopier when switching
between the source and sink streams, in order to enable or disable the
WAIT_CLOSURE_ONLY flag. Failing to reset the wait flags can lead to a
NS_AsyncCopy hanging until the source or sink are closed when is
alternating between waiting on input and output streams. This patch
relaxes the incorrect checks on various input streams.

Differential Revision: https://phabricator.services.mozilla.com/D141034
2022-05-10 22:27:40 +00:00
Thomas Wisniewski 37c3de998a Bug 1758745 - Refactor EffectiveStoragePrincipal to EffectiveCookiePrincipal and create new function EffectiveStoragePrincipal that is never unpartitioned; r=twisniewski
Depends on D143626

Differential Revision: https://phabricator.services.mozilla.com/D143627
2022-05-10 21:49:42 +00:00
Butkovits Atila 387096a2fc Backed out 3 changesets (bug 1758745, bug 1758740, bug 1762462) for causing failures at browser_storage_dfpi.js. CLOSED TREE
Backed out changeset a3024e8b2a58 (bug 1762462)
Backed out changeset 8bc1291b9bdb (bug 1758745)
Backed out changeset c7b693b2fd05 (bug 1758740)
2022-05-10 16:17:59 +03:00
Thomas Wisniewski 6cae86aea9 Bug 1758745 - Refactor EffectiveStoragePrincipal to EffectiveCookiePrincipal and create new function EffectiveStoragePrincipal that is never unpartitioned; r=twisniewski
Depends on D143626

Differential Revision: https://phabricator.services.mozilla.com/D143627
2022-05-10 12:05:51 +00:00
Tooru Fujisawa 32bc0bc61e Bug 1768022 - Use globalThis instead of Cu.getGlobalForObject(this). r=Standard8,webdriver-reviewers,necko-reviewers,whimboo,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D145842
2022-05-10 07:52:01 +00:00
Neil Deakin d8b26cb066 Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-06 10:00:55 +00:00
Neil Deakin fd86ee2ff6 Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-06 10:00:55 +00:00
Neil Deakin 3dd82cbf48 Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-06 10:00:52 +00:00
Neil Deakin 45e161641c Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-06 10:00:52 +00:00
Kershaw Chang 2422b023ff Bug 1766251 - Count TRR_SKIP_REASON_NATIVE_SUCCESS/FAILED once in strict mode, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D144568
2022-05-06 08:26:58 +00:00
Iulian Moraru 24cf77db18 Backed out 2 changesets (bug 1681498, bug 1681495) for causing marionette failures on test_service_worker_at_shutdown.py. CLOSED TREE
Backed out changeset c553d7f2e586 (bug 1681495)
Backed out changeset 190c8814b474 (bug 1681498)
2022-05-06 10:06:21 +03:00
Hannah Peuckmann 160718678d Bug 1681498 - Migrate users from network.cookie.lifetimePolicy to sanitize on shutdown prefs. r=pbz,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D139102
2022-05-06 05:47:03 +00:00
Noemi Erli 39469989c9 Backed out 22 changesets (bug 1759572, bug 1759563, bug 1754004, bug 1754031, bug 1759569, bug 1696894) for causing multiple failures CLOSED TREE
Backed out changeset d69647a725a1 (bug 1754004)
Backed out changeset 09fc506865d7 (bug 1754004)
Backed out changeset 648e3dd4b62f (bug 1754004)
Backed out changeset 3465158ee230 (bug 1696894)
Backed out changeset b08475bbfbd9 (bug 1754004)
Backed out changeset dfabce587a56 (bug 1754004)
Backed out changeset cebe8d5dda34 (bug 1754004)
Backed out changeset 55b4b0c9a504 (bug 1754004)
Backed out changeset e8649de9dd22 (bug 1754004)
Backed out changeset 0f480fc861c0 (bug 1754004)
Backed out changeset e515b7edd1c8 (bug 1754004)
Backed out changeset fe90db9158ac (bug 1754004)
Backed out changeset c6388d682d48 (bug 1754004)
Backed out changeset 2374420d9fed (bug 1754004)
Backed out changeset 44dfd76472aa (bug 1754004)
Backed out changeset 000fb99de0cf (bug 1754004)
Backed out changeset 0ca1856b5fc9 (bug 1754004)
Backed out changeset 10c3683b998b (bug 1754004)
Backed out changeset 4abc98ed6b99 (bug 1759572)
Backed out changeset cdd271a5af42 (bug 1759563)
Backed out changeset fadb6cc0d81c (bug 1759569)
Backed out changeset 44be9709a93e (bug 1754031)
2022-05-06 04:28:47 +03:00
Nika Layzell 67fe451d23 Bug 1696894 - Clear active logins after browser_post_auth.js, r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D142127
2022-05-05 23:34:26 +00:00
Nika Layzell 4768830c3c Bug 1754004 - Part 13: Relax interface check in nsHttpTransaction, r=necko-reviewers,kershaw
Previously, the check when reporting progress from a nsHttpTransaction would
always report no progress when a non-seekable input stream is used as the
request data stream. Before Part 5, we incorrectly always reported the
nsBufferedStream which we wrap request streams with as seekable, meaning that
this check would pass and the progress reporting would work.

This change relaxes the check to instead check for nsITellableStream which is
actually guaranteed by the nsBufferedStream wrapper, and provides the Tell
method being used.

Differential Revision: https://phabricator.services.mozilla.com/D144450
2022-05-05 23:34:25 +00:00
Nika Layzell 6b138a7de6 Bug 1754004 - Part 12: Update browser_post_auth.js assertions, r=necko-reviewers,kershaw
Previously this test was failing due to issues with upload streams not
being seekable. With the other changes in this bug, we now always
ensure that upload streams are consistently cloneable and seekable,
meaning that this issue should no longer occur, and we don't need to
re-start the request for it to succeed.

I also removed various pieces of dead code, as well as some logic
disabling bfcacheInParent, as that seems to no longer be required.

Differential Revision: https://phabricator.services.mozilla.com/D141777
2022-05-05 23:34:25 +00:00
Nika Layzell 445ea16482 Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-05 23:34:24 +00:00
Nika Layzell 173715fc1e Bug 1754004 - Part 9: Remove PartiallySeekableInputStream, r=asuth,necko-reviewers,kershaw
This interface is misleading, as it doesn't allow seeking the entire type
despite providing a `nsISeekableStream` interface, and is no longer necessary
due to the changes in an earlier part.

Differential Revision: https://phabricator.services.mozilla.com/D141046
2022-05-05 23:34:23 +00:00
Nika Layzell 000305abbf Bug 1754004 - Part 8: Remove SeekableStreamWrapper, r=asuth,necko-reviewers,kershaw
This type is no longer necessary, and has various issues due to behaving
incorrectly when used with async streams or streams which are not nsIPipe.

Differential Revision: https://phabricator.services.mozilla.com/D141045
2022-05-05 23:34:23 +00:00
Nika Layzell e18a717abc Bug 1754004 - Part 7: Consistently normalize upload streams passed to HTTP channels, r=asuth,necko-reviewers,dragana
Unfortunately, upload streams used by necko have various odd behaviours
and requirements which happened to be usually preserved by the previous
IPC serialization logic, but were not consistently preserved. This
includes requiring the stream to be synchronous (as some consumers such
as WebExtensions and DevTools appear to read it assuming Available() is
the stream length), seekable (as it needs to be rewound in various
places), and cloneable (as the stream information is often handed out to
other components).

In addition, the WebExtension WebRequest code makes assumptions about
the specific topology of the input stream for optimization purposes,
meaning that nsMultiplexInputStreams need to be preserved.

The way this was previously handled was by copying the entire payload
into a nsStorageStream as an async operation. This happened very
infrequently in out test suite, however, and had some issues. It could
lead to data loss if the stream was a nsMIMEInputStream (as the metadata
would be lost), and would destroy the topology required by WebRequest.

This patch changes the code to instead manually walk and replace streams
in the input stream's data structure, to efficiently copy only the
required data, preserve the invariants, and make the type seekable
before AsyncOpen continues. This helps keep the complexity of the
invariants HTTPChannel depends on out of generic input stream handling
code.

In addition, due to how early this happens, it replaces the need for
PartiallySeekableInputStream which will be removed a later part.

Differential Revision: https://phabricator.services.mozilla.com/D141044
2022-05-05 23:34:23 +00:00
Nika Layzell b78d1b2278 Bug 1754004 - Part 5: Only implement nsISeekableStream on nsBufferedStreams if it's implemented by the underlying stream, r=asuth,necko-reviewers,dragana
Previously, nsBufferedStreams would always implement nsISeekableStream, whether
or not the underlying stream did, and would only fail when trying to seek. This
makes it much more difficult to compensate and correctly transform streams when
they need to be seekable.

Differential Revision: https://phabricator.services.mozilla.com/D141042
2022-05-05 23:34:22 +00:00
Nika Layzell 08fd8ee0fc Bug 1754004 - Part 4: Stop requiring nsMIMEInputStream to be seekable, r=asuth,necko-reviewers,dragana
This type was originally made to be required to be seekable because a
non-seekable stream would lose the nsMIMEInputStream metadata information when
it was wrapped by the HTTP channel using PartiallySeekableInputStream, leading
to potential bugs.

Changes in a later part will change HTTP channel wrapping to ensure that this
metadata is preserved in all relevant cases, so this requirement can be
relaxed. This is important, as the check was previously being bypassed for
RemoteLazyInputStream in the content process, as nsBufferedInputStream would
incorrectly report that it implemented nsISeekableStream even if the underlying
stream wasn't seekable.

Differential Revision: https://phabricator.services.mozilla.com/D141041
2022-05-05 23:34:22 +00:00
Nika Layzell 2f296a7b38 Bug 1754004 - Part 3: Move RemoteLazyInputStream to its own toplevel protocol, r=asuth,necko-reviewers,dragana
This is a complete rewrite of RemoteLazyInputStream to run off of its own
toplevel protocol, rather than being managed by other protocols like
PBackground or PContent. This should improve performance thanks to no longer
needing to operate on a main or worker thread, and due to no longer needing the
migration step for the stream actor.

This also acts as a step towards no longer requiring a manager actor to
serialize input streams, as the type is now actor-agnostic, and should support
being sent over IPC between any pair of processes.

Differential Revision: https://phabricator.services.mozilla.com/D141040
2022-05-05 23:34:21 +00:00
Nika Layzell 0308ac11a4 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-05 23:34:21 +00:00
Nika Layzell 3ef777a45c Bug 1754004 - Part 1: Switch IPCStream to use DataPipe instead of P{ChildToParent,ParentToChild}Stream, r=asuth,necko-reviewers,kershaw
This gives us various positive benefits, such as using a shared memory ring
buffer for faster communication, not having data streaming being bound to the
thread which transferred the nsIInputStream (which is often the main thread),
and the ability for some backpressure to be applied to data streaming.

After this change, the "delayed start" parameter for IPCStream serialization is
less relevant, as backpressure will serve a similar purpose. It will still be
used to determine whether or not to use RemoteLazyInputStream when serializing
from the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D141038
2022-05-05 23:34:20 +00:00
Nika Layzell df13742edb Bug 1759563 - Add SerializedComplexity to limit the complexity of serialized IPCStream instances, r=asuth,necko-reviewers,dragana
This will improve the efficiency of serializing large data pipes, which in bad
cases can end up serializing very small amounts of data in individual pipes
over IPC, and acts as a compliment to the existing logic for limiting
serialized message sizes. It is also necessary for the changes in bug 1754004,
which require the ability to include FileDescriptor inline in the message,
which could blow out our FileDescriptor count limits if pipe creation was
unlimited.

In some tests, this change reduces the number of pipes required to serialize a
nsIInputStream from over 5000 to 1.

Differential Revision: https://phabricator.services.mozilla.com/D141036
2022-05-05 23:34:19 +00:00
Nika Layzell 5bf606fa92 Bug 1754031 - AsyncWait implementations should support updating flags on an existing listener, r=asuth,necko-reviewers,dragana
This operation is often performed by nsAStreamCopier when switching
between the source and sink streams, in order to enable or disable the
WAIT_CLOSURE_ONLY flag. Failing to reset the wait flags can lead to a
NS_AsyncCopy hanging until the source or sink are closed when is
alternating between waiting on input and output streams. This patch
relaxes the incorrect checks on various input streams.

Differential Revision: https://phabricator.services.mozilla.com/D141034
2022-05-05 23:34:19 +00:00
Noemi Erli 295eab376a Backed out 14 changesets (bug 1746052) for causing build bustages in nsExternalHelperAppService.cpp CLOSED TREE
Backed out changeset bf46b0add531 (bug 1746052)
Backed out changeset 684b2aca10bb (bug 1746052)
Backed out changeset d4796eeeaf64 (bug 1746052)
Backed out changeset 5cf2378f6eb4 (bug 1746052)
Backed out changeset 2055ec1e9a57 (bug 1746052)
Backed out changeset 1398fc0669d2 (bug 1746052)
Backed out changeset 1f979899c843 (bug 1746052)
Backed out changeset 561a24801d4d (bug 1746052)
Backed out changeset 73e4689120f0 (bug 1746052)
Backed out changeset 9891f3b0229b (bug 1746052)
Backed out changeset 4c1ab30de0bd (bug 1746052)
Backed out changeset 108e14122e53 (bug 1746052)
Backed out changeset 1ee59c52578a (bug 1746052)
Backed out changeset 41fe77c5f4b2 (bug 1746052)
2022-05-05 23:13:33 +03:00
Neil Deakin c1e573cd3c Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-05 19:46:48 +00:00
Neil Deakin 679f61ea4c Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-05 19:46:48 +00:00
Neil Deakin 7fdbbc3e3c Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-05 19:46:45 +00:00
Neil Deakin d0aaa88f44 Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-05 19:46:45 +00:00