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

743287 Коммитов

Автор SHA1 Сообщение Дата
Julian Descottes 98d054740b Bug 1686950 - [devtools] Remove string concatenation to toggle RDM from toolbox r=nchevobbe
Depends on D103326

Spotted while writing the patch, makes the code unnecessarily hard to navigate.

Differential Revision: https://phabricator.services.mozilla.com/D103687
2021-02-02 19:08:45 +00:00
Julian Descottes 36fd4f01e4 Bug 1686950 - [devtools] RDM should stop watching resources and targets after performing cleanup r=nchevobbe
Depends on D103325

When we stop watching for resources, if there are no other watchers currently in activity, we will unregister the JSWindowActors, with following stack:
```
unregisterJSWindowActor@resource://devtools/server/actors/watcher/WatcherRegistry.jsm:344:17
maybeUnregisteringJSWindowActor@resource://devtools/server/actors/watcher/WatcherRegistry.jsm:280:7
unwatchTargets@resource://devtools/server/actors/watcher.js:199:21
handler@resource://devtools/shared/protocol/Actor.js:172:37
onPacket@resource://devtools/server/devtools-server-connection.js:379:58
send/<@resource://devtools/shared/transport/local-transport.js:68:25
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:103:22
DevToolsUtils.executeSoon*exports.executeSoon@resource://devtools/shared/DevToolsUtils.js:54:21
send@resource://devtools/shared/transport/local-transport.js:56:21
send@resource://devtools/shared/protocol/Front.js:272:30
generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:42:14
stopListening@resource://devtools/shared/resources/target-list.js:363:29
destroy@resource://devtools/shared/resources/target-list.js:612:10
```

This will lead to destroy all the currently created JSWindowActors, which will also destroy the corresponding target actors.
However RDM will still try to perform some cleanups on the current target after destroying the target-list. These calls will fail as soon as RDM uses a JSWindowActor based target.
This will only start happening in Bug 1644397, but then it will make the test browser_tab_remoteness_change_fission_switch_target.js fail on shutdown.

Differential Revision: https://phabricator.services.mozilla.com/D103326
2021-02-02 19:08:22 +00:00
Julian Descottes 20122a5d0a Bug 1686950 - [devtools] Update RDM tab target creation to rely on a local tab target descriptor r=nchevobbe
RDM uses a dedicated client, target-list etc. Which means that we can use a local tab descriptor and remove the target switching logic from RDM.
New test is added in D103688

Differential Revision: https://phabricator.services.mozilla.com/D103325
2021-02-02 19:08:20 +00:00
Jeff Muizelaar 80bb95fdeb Bug 1690371 - Drop the minimum mesa version for WebRender to 17. r=aosmond
The choice of 18 was arbitrary. Let's see if lower
versions work well.

Differential Revision: https://phabricator.services.mozilla.com/D103809
2021-02-02 19:43:22 +00:00
Kris Maglione 2d56612fcb Bug 1685106: Add some missing IsInProcess() checks to nsDocShell. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D103566
2021-02-01 22:09:01 +00:00
Nick Alexander 4543e2b04d Bug 1687009 - Add test ensuring sync update manager works in background tasks. r=mossop,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D101954
2021-02-02 19:42:44 +00:00
Nick Alexander 78212e193c Bug 1686997 - Add test ensuring locked (temporary) profile exits background task with non-zero exit code. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D101953
2021-02-02 19:36:02 +00:00
Jon Bauman aade425260 Bug 1689222 - MediaSource.prototype.onsourceclosed event handler attribute typo (trailing d). r=alwu,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D103560
2021-02-02 17:50:38 +00:00
Nika Layzell 681cd1b0fe Bug 1681529 - Part 11: Avoid using DelayedStart when serialzing the reply from SendOpenStream, r=asuth
Streams serialized with the default nsIInputStream serializer will be serialized
with delayedStart, meaning that when sent from the parent process to the content
process it will be serialized as a RemoteLazyInputStream.

In the specific case of SendOpenStream this causes issues, as the content
process code depends on the synchronous nature of nsIFileInputStream to allow it
to be wrapped in a SnappyUncompressInputStream, which requires a sync stream.

Relying on this property is not generally correct and only works because we know
only nsFileInputStream will be sent by the parent process. Other types of sync
streams may be received as async if they are sufficiently large, such as
nsStringInputStream.

Differential Revision: https://phabricator.services.mozilla.com/D103227
2021-02-02 19:19:28 +00:00
Nika Layzell f918e191b0 Bug 1681529 - Part 10: Set StartedReading after calling SetData, r=baku,necko-reviewers,valentin
SetData will check that `mStartedReading` has not been set yet to ensure the
stream is in a non-partially-read state. This can lead to assertion failures
when sending a stream not seeked to the beginning over IPC.

Differential Revision: https://phabricator.services.mozilla.com/D103226
2021-01-29 19:04:03 +00:00
Nika Layzell f41577663f Bug 1681529 - Part 9: Add a basic test for the seekable stream wrapper, r=baku
This basic GTest exercises some of the basic functionality of the
SeekableStreamWrapper when applied to a nsPipe.

Differential Revision: https://phabricator.services.mozilla.com/D101808
2021-01-28 00:30:04 +00:00
Nika Layzell 4d7290a26c Bug 1681529 - Part 8: Handle clones of closed nsPipeInputStreams, r=baku
Previously if `Clone()` was called on a closed nsPipeInputStream, it could cause
crashes due to the already-closed nsPipeInputStream being added to mInputList,
violating internal nsPipe invariants. Skipping adding the stream to that list
should avoid this edge-case, as the pipe is already closed.

Differential Revision: https://phabricator.services.mozilla.com/D101807
2021-01-27 21:55:21 +00:00
Nika Layzell 55c9ceedc7 Bug 1681529 - Part 7: Wrap the inner streams in a nsMIMEInputStream to make them seekable, r=baku,necko-reviewers,dragana
nsMIMEInputStream has a requirement that the inner nsIInputStream object
implement nsISeekableStream, which is usually enforced by the SetData method.
This check was bypassed by the Deserialize method, which unfortunately meant
that non-seekable IPC payloads could end up within a nsMIMEInputStream when sent
from another process (e.g. due to large nsStringStreams being serialized as
nsPipes over IPC).

This patch uses the SeekableStreamWrapper introduced in the previous patch to
wrap the inner stream when deserializing nsMIMEInputStream, avoiding the
previously mentioned issue.

Differential Revision: https://phabricator.services.mozilla.com/D101806
2021-01-27 21:55:19 +00:00
Nika Layzell 96b1095085 Bug 1681529 - Part 6: Introduce a SeekableStreamWrapper to make pipes seekable, r=baku
This patch introduces a new SeekableStreamWrapper class which handles adapting
nsIInputStreams which support being cheaply cloned using nsICloneableInputStream
into seekable input streams by operating on a clone of the original stream, and
re-cloning that stream when seeking backwards.

This wrapper is generally intended to be used with nsPipeInputStream as that
type supports both a fairly cheap clone operation, and keeping a large internal
buffer which is fairly cheap to seek using this method, but should also work
with other types such as RemoteLazyInputStream or nsStringStream.

An alternate strategy was considered where nsPipe was given internal support for
a mSeekable flag to be set on creation. This flag would then have a similar
effect, except with additional optimizations due to being visible within the
implementation of the nsPipe, rather than relying on an unadvanced
nsPipeInputStream to keep the buffer alive.

I ended up choosing this approach instead for a few reasons:

 * The seekable adapter can be applied to an already-created nsPipeInputStream,
   such as one received from IPC. With the nsPipe approach, making an IPC stream
   seekable either requires telling IPCStreamDestination to use a seekable pipe
   ahead of time, or performing a NS_AsyncCopy from the IPC-provided pipe into a
   different seekable pipe, which is likely wasted effort and would prevent
   optimizations such as RemoteLazyInputStream and DelayedStart streams.
 * The adapter can support other features of the underlying stream, such as
   nsIInputStreamLength, without resorting to adding additional adapter layers
   on top of the returned nsPipe.
 * The performance is unlikely to be substantially different in the most common
   case, which is using Seek(NS_SEEK_SET, 0) to return to the beginning of the
   stream.
 * Less additional complexity is added to the already-complicated internals of
   nsPipe, and instead it is kept in a separate wrapper stream, which is easier
   to review.

Using nsStorageStream, as is used by EnsureUploadStreamIsCloneable, was also
considered, but was rejected as it has similar problems to the seekable nsPipe
approach and also doesn't implement nsIAsyncStream, meaning that one must wait
for the NS_AsyncCopy to be completed before reading the stream.

It may actually be possible to replace the existing uses of nsStorageStream with
a wrapped nsPipe in the future, but that is left as follow-up material, and may
have memory overhead implications due to nsPipe not resizing the final segment,
unlike nsStorageStream.

Differential Revision: https://phabricator.services.mozilla.com/D101805
2021-01-27 21:55:17 +00:00
Nika Layzell 19d158a736 Bug 1681529 - Part 5: Serialize `nsIInputStream` over IPC with aDelayedStart by default, r=baku
The current set of cases where a nsIInputStream is directly serialized over IPC
is fairly limited, and includes cases where the IPDL struct may be directly
stored within a content process, having the nsIInputStream left unused.

By switching this serialization to DelayedStart, we can avoid performing
unnecessary streaming copies of IPC data when sending postdata streams related
to session history and document navigation, while also avoiding issues like this
coming up again due to delayed start being the default.

Differential Revision: https://phabricator.services.mozilla.com/D101804
2021-01-27 21:55:14 +00:00
Nika Layzell e5ea02d171 Bug 1681529 - Part 4: Serialize aDelayedStart streams from parent to child as RemoteLazyInputStreams, r=baku
When aDelayedStart is specified, if the created IPCStream contains an internal
IPC stream actor, an actor is used under the hood to send raw data between
processes when needed. This is usually done to reduce overhead in cases where
the target process may not use the nsIInputStream immediately, if at all.

By switching to using RemoteLazyInputStream when sending DelayedStart actors
from parent to content, the amount of data sent in the initial payload is
reduced even further, and the stream is optimized to allow sending it back to
the parent process without streaming the data through the content process again.

Normal delayed start streams are still used when sending payloads from other
processes, as RemoteLazyInputStream is only supported for nsIInputStreams
originating in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D101803
2021-01-27 21:55:12 +00:00
Nika Layzell f9aa6b928e Bug 1681529 - Part 3: Apply InputStreamLengthWrapper after DelayedStartInputStream, r=baku
Previously, we would apply the InputStreamLengthWrapper before
DelayedStartInputStream, which meant that a stream serialized with aDelayedStart
would not correctly implement nsIInputStreamLength. By inverting the order of
these wrappers, the nsIInputStreamLength implementation is visible, without
impacting the functionality of the DelayedStartInputStream wrapper.

Differential Revision: https://phabricator.services.mozilla.com/D101802
2021-01-27 21:55:09 +00:00
Nika Layzell 777a09765f Bug 1681529 - Part 2: Use an overload set instead of template for RemoteLazyInputStreamParent::Create, r=baku
In a later part of this patch series, this will be necessary to handle cases
when BackgroundParentImpl* (or other PBackgroundParent subclasses) are passed to
RemoteLazyInputStreamParent::Create, as previously this would've caused an
undefined linker symbol error. By using an explicit overload set, we can move
the subclass conversion to the caller, and avoid this issue.

Differential Revision: https://phabricator.services.mozilla.com/D101801
2021-01-27 21:55:07 +00:00
Nika Layzell b3fac57b0f Bug 1681529 - Part 1: Add a test for reloading a page with a large postdata payload, r=peterv
Without the other patches in this series, this test fails with both with and
without Fission enabled, for two different reasons.

With Fission disabled, the second reload request appears as empty, due to us
being unable to rewind the postData nsIInputStream. With Fission enabled, the
second reload request causes crashes due to the nsMIMEInputStream's invariant of
requiring a seekable stream is invalidated, causing the nsICloneableInputStream
implementation to misbehave.

Differential Revision: https://phabricator.services.mozilla.com/D101800
2021-01-28 19:40:22 +00:00
Tooru Fujisawa 51eef41214 Bug 1688534 - Part 4: Add fast path for object literal without index or duplicate properties. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D103553
2021-02-02 18:52:32 +00:00
Tooru Fujisawa 0ebc944ebd Bug 1688534 - Part 3: Add HasIndexOrDuplicatePropName flags. r=tcampbell
This flag is used in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D103552
2021-02-02 18:50:30 +00:00
Tooru Fujisawa 46a529c0c5 Bug 1688534 - Part 2: Inline NewPlainObjectWithProperties to avoid building properties vector. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D103551
2021-02-02 18:50:22 +00:00
Tooru Fujisawa 2d99a31206 Bug 1688534 - Part 1: Store the number of properties/elements in ObjLiteralStencil. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D103550
2021-02-02 18:50:12 +00:00
Emilio Cobos Álvarez 6178b9bfde Bug 1690099 - Address some flakiness in the test.
Using the same url as the following link is a slippery slope because
the test doesn't really wait for the load to finish, so some of the
targets for iframes and such seem to never run and the test times out
very intermittently.

I've confirmed this is an issue unrelated to the changes in the patch.

MANUAL PUSH: Unreviewed one-liner test fix.
2021-02-02 20:13:46 +01:00
Emma Malysz e7e6abb53d Bug 1689366, simplify bookmark panel r=fluent-reviewers,mconley,flod
Differential Revision: https://phabricator.services.mozilla.com/D103402
2021-02-02 18:56:19 +00:00
Nan Jiang 795582394e Bug 1689496 - Add showSponsoredTopSites to user_prefs r=thecount
Differential Revision: https://phabricator.services.mozilla.com/D103403
2021-01-29 18:47:01 +00:00
Mihai Alexandru Michis 7e2dd6d49e Backed out 4 changesets (bug 1688534) for causing hazard bustages in ObjLiteral.cpp
CLOSED TREE

Backed out changeset 2ce5fee4f1b3 (bug 1688534)
Backed out changeset 50f5c8ec9472 (bug 1688534)
Backed out changeset ae4890a14011 (bug 1688534)
Backed out changeset 9c82c4f218ee (bug 1688534)
2021-02-02 20:21:51 +02:00
Simon Giesecke 4cacf143a2 Bug 1689415 - Avoid UB when validating enum values in EnumSerializer. r=mccr8
Previously, there was undefined behaviour when validating enum values in
EnumSerializer, which were actually invalid (which was hit during fuzzing, e.g.),
because the invalid integral value was cast to the enum type for comparison.
This patch changes the comparison to cast the valid values to their integral
values instead and compare those.

Differential Revision: https://phabricator.services.mozilla.com/D103449
2021-02-02 18:04:05 +00:00
Iain Ireland 89b13a093b Bug 1690092: Document MIR optimizations r=tcampbell DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D103707
2021-02-02 17:57:53 +00:00
Simon Giesecke 1ba38f7421 Bug 1689967 - Simplify CleanupTemporaryStorage and the functions it calls. r=dom-workers-and-storage-reviewers,janv
Instead of collection both origins exceeding their group limit and the global
limit before clearing any origin, do that separately. This removes the need
to adjust the global usage while determining which origins to evict simulating
the effects of evicting the origins exceeding their group limit.

This requires moving the lock into the GetOrigin* functions (thus removing
"Locked" from their names). Also, the arguments to GetOriginInfosExceedingGlobalLimit
are removed.

As an effect, the predicate passed into MaybeInsertOriginInfos is the same in
both uses, and just checks the IsPersisted property, so the predicate argument
is removed and the function is renamed to MaybeInsertNonPersistedOriginInfos.

Differential Revision: https://phabricator.services.mozilla.com/D103629
2021-02-02 17:47:11 +00:00
Simon Giesecke b4a539c9d7 Bug 1685677 - Reduce scope of variables only used within an if statement. r=jstutte
Differential Revision: https://phabricator.services.mozilla.com/D101181
2021-02-02 17:47:03 +00:00
Simon Giesecke af53bb423a Bug 1685677 - Don't unnecessarily materialize a flattened array of OriginInfo*. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D101151
2021-02-02 17:46:55 +00:00
Simon Giesecke 7cba0698f2 Bug 1685677 - Harmonize LockedGetOriginInfosExceedingGroupLimit and LockedGetOriginInfosExceedingGlobalLimit. r=dom-workers-and-storage-reviewers,janv
Instead of inserting all elements into OriginInfo array, and then removing
or skipping irrelevant entries, only insert the relevant ones in the first
place, using a new utility function template MaybeAppendOriginInfos.

Sort them by in least-recently used order according to the access timestamp.

Iterate over them to identify the threshold.

Finally, truncate the array to the threshold position.

Differential Revision: https://phabricator.services.mozilla.com/D101146
2021-02-02 17:46:47 +00:00
Simon Giesecke 9c23bfdb2e Bug 1685677 - Extract functions from CheckTemporaryStorageLimits and rename it to CleanupTemporaryStorage. r=dom-workers-and-storage-reviewers,janv
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins

Differential Revision: https://phabricator.services.mozilla.com/D101145
2021-02-02 17:46:40 +00:00
Jeff Muizelaar 293221bb1d Bug 1690319 - Remove integer comparison workaround in fetch_clip_area. r=mstange
This removes the workaround from https://github.com/servo/webrender/pull/2864

The root cause of that has been identified as bug 1690027.

Differential Revision: https://phabricator.services.mozilla.com/D103797
2021-02-02 17:17:50 +00:00
Chris H-C 605cbc1d49 Bug 1675277 - Documentation Updates for how to add new Labeled Metrics to FOG r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103342
2021-02-02 17:10:48 +00:00
Chris H-C 708606cd1a Bug 1675277 - Update the FOG pytest expected files r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103341
2021-02-02 16:53:49 +00:00
Chris H-C 926bf6dca9 Bug 1675277 - Support FOG Labeled Metrics in C++ and JS r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103233
2021-02-02 16:46:40 +00:00
Chris H-C 7296c82cbf Bug 1675277 - Remove is_implemented_type. All types implemented r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103232
2021-02-02 16:34:39 +00:00
Chris H-C d6bea82e06 Bug 1675277 - Expose Labeled Metric APIs on FOG MLA FFI r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103231
2021-02-02 16:43:44 +00:00
Chris H-C 386d8fda84 Bug 1675277 - Add a few test labeled metrics to FOG r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103230
2021-02-02 16:32:19 +00:00
Chris H-C a4e4c94eaf Bug 1675277 - Adjust FOG Labeled metric to get FOG submetrics r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D103229
2021-02-02 16:32:11 +00:00
Tooru Fujisawa 7e91dd003c Bug 1689781 - Fix smoosh to use CompilationState while building up stencil vectors. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D103540
2021-02-02 16:59:03 +00:00
Tooru Fujisawa 25562a928b Bug 1689696 - Part 5: Use toSmallChar in getLength2IndexStatic to make it always constexpr. r=nbp
This is necessary to use the result of `StaticStrings::getLength2IndexStatic`
in switch-case.

Differential Revision: https://phabricator.services.mozilla.com/D103546
2021-02-02 17:28:00 +00:00
Tooru Fujisawa 722965d849 Bug 1689696 - Part 4: Add comment about frontend-VM map for well-known/static atom table. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D103545
2021-02-02 17:26:41 +00:00
Tooru Fujisawa 8727575b12 Bug 1689696 - Part 3: Add StaticStrings::{firstCharOfLength2,secondCharOfLength2}. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D103544
2021-02-02 17:22:51 +00:00
Tooru Fujisawa f66ece388a Bug 1689696 - Part 2: Share NUM_LENGTH2_ENTRIES constant. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D103543
2021-02-02 17:19:19 +00:00
Tooru Fujisawa 78e64edf96 Bug 1689696 - Part 1: Rename SmallCharArray to SmallCharTable. r=nbp
Given it's a table for optimization purpose, the name should be explicit.

Differential Revision: https://phabricator.services.mozilla.com/D103542
2021-02-02 17:14:07 +00:00
Tooru Fujisawa cb096fbf7c Bug 1688534 - Part 4: Add fast path for object literal without index or duplicate properties. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D103553
2021-02-02 17:37:51 +00:00
Tooru Fujisawa 16905203c9 Bug 1688534 - Part 3: Add HasIndexOrDuplicatePropName flags. r=tcampbell
This flag is used in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D103552
2021-02-02 16:21:13 +00:00