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

6195 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 67cd43209f Bug 1658847 - Put profiler thread to sleep when allocating memory for shmems. r=mstange
posix_fallocate iterates over each page/block in a shmem to ensure the
OS allocates memory to back it. Large shmems will cause many read/write
calls to be made, and when profiling, it is very likely a SIGPROF signal
will interrupt us at sufficiently high sampling rates. Most attempts at
retrying will fail for the same reason, and this can cause the threads
to block for an indeterminate period of time.

To work around this we use the profiler's "thread sleep" mechanism to
indicate that the sampler thread should not interrupt this thread with
the sampling signal more than once.

Differential Revision: https://phabricator.services.mozilla.com/D87373
2020-08-18 21:40:11 +00:00
Andrew McCreight 681e8793ff Bug 1641614 - Use mozilla::Queue for ChannelImpl::output_queue_h_. r=froydnj
The goal of this patch is to reduce memory usage. On at least OSX, std::Queue
can use 4kb of memory even with nothing in it. This can be around 52kb of
memory per content process.

The segment size of 64 is fairly arbitrary, but these queues didn't have
more than a few hundred items in them, so it seemed like a reasonable
trade off between space for mostly-empty queues and segment overhead.

Differential Revision: https://phabricator.services.mozilla.com/D87325
2020-08-18 17:03:55 +00:00
Simon Giesecke 1fccb4c60f Bug 1634436 - Make cipher-strategy stateful and keep mode, key and IV as state. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D80014
2020-08-17 08:42:20 +00:00
Eitan Isaacson 58ae94661e Bug 1657765 - Add IPDL interface for platform-specific mac API. r=morgan,Jamie,nika
Differential Revision: https://phabricator.services.mozilla.com/D86606
2020-08-14 19:33:00 +00:00
Butkovits Atila ca6c19bf18 Backed out changeset c574dd7d46ef (bug 1616462) as requested by jld 2020-08-08 01:18:19 +03:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
Andrew McCreight 85e0be181d Bug 1657504, part 2 - Fix deprecation warning in ipdl.py. r=nika
This is unrelated to the main issue in the bug, but I noticed
a deprecation warning in the log spew.

Differential Revision: https://phabricator.services.mozilla.com/D86229
2020-08-06 17:36:45 +00:00
Andrew McCreight bd21b11225 Bug 1657504, part 1 - Don't allow a protocol to be defined in two different files. r=nika
This changes the duplicate checking/caching implemented by |parsed| to be
based on the name of the protocol etc. we're loading, not the file name.
This lets us detect when a protocol is being defined in two different
files.

This can happen if one file is included earlier in the resolve path than
a file explicitly specified on the command line. Any includes will resolve
to the former, and then we'll attempt to parse the latter. Before this
patch, this would result in weird errors, because there would be multiple
protocol types with the same name.

Differential Revision: https://phabricator.services.mozilla.com/D86113
2020-08-06 17:42:13 +00:00
Kartikaya Gupta 39167fa7cd Bug 1251612 - Support the GetFrameUniformity API in content processes. r=botond,froydnj
This moves the IPC mechanism from PCompositorBridge to PLayerTransaction/
PWebRenderBridge, so that it can be used by content processes like the other
test APIs. It still only produces actual data for the layers backend; for
WR it will just return empty datasets.

Differential Revision: https://phabricator.services.mozilla.com/D86016
2020-08-05 21:42:06 +00:00
Butkovits Atila 3bd0e5497c Backed out 10 changesets (bug 1589102) for failure at browser_saveHeapSnapshot_e10s_01.js CLOSED TREE
Backed out changeset 0d22ad297b19 (bug 1589102)
Backed out changeset 14bcaf2a452c (bug 1589102)
Backed out changeset 20905f91e2bb (bug 1589102)
Backed out changeset 29ee0fbe855f (bug 1589102)
Backed out changeset d1f6185030af (bug 1589102)
Backed out changeset 31949872cc1d (bug 1589102)
Backed out changeset ec04e1a20597 (bug 1589102)
Backed out changeset ffe8da473b91 (bug 1589102)
Backed out changeset 3b92f7306c64 (bug 1589102)
Backed out changeset b187548e258f (bug 1589102)
2020-08-05 21:47:50 +03:00
Anny Gakhokidze 6c0bc76392 Bug 1589102 - Part 4: Allow (de)serialization of nested about: uris, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D85082
2020-08-05 16:45:57 +00:00
Anny Gakhokidze e903c66d34 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
This patch enables sandboxed srcdoc loads to take place via DocumentChannel,
and adds mechanisms for enabling unsandboxed ones.

Both unsandboxed srcdoc, and in subsequent patches, about:blank, loads require
that the triggering principal and the principal to inherit point to the same
instance if the load takes place in the same process as where we are inheriting
those principals from. We save those principals on a target browsing context before
we load the URI, and later, when we are deserializing LoadInfoArgs into
LoadInfo in the content process, we retrieve the saved principals if the
current load identifier of the target BC matches the load identifier saved
along with the principals.

We also need to make sure that during a process switch for about:srcdoc load,
we don't use the original URI for about:srcdoc to determine the remote type and
instead we use channel's result principal.

Differential Revision: https://phabricator.services.mozilla.com/D85079
2020-08-05 16:44:01 +00:00
Chris Martin c946e6eaf9 Bug 1656349 - Refactor the IPC lifetimes for the PGamepadEventChannel object r=daoshengmu
Change the GamepadEventChannel so it is fully-initialized by the IPC
constuctor and needs no separate "init" message, and so its completely
destroyed by the ActorDestroy() message so it needs no "cleanup" message.

This simplifies the object lifetime, as well as unifies the IPC error vs
clean shutdown paths.

Differential Revision: https://phabricator.services.mozilla.com/D85481
2020-08-04 21:27:53 +00:00
Jed Davis 7b4c21f949 Bug 1616462 - Make event_base_fd atomic to avoid a TSan error. r=froydnj
See comment #13 on the bug for an explanation of what this fixes, what it
doesn't fix, and why this hasn't been fixed upstream yet.

See also https://github.com/libevent/libevent/issues/779 (upstream bug report)
and https://github.com/libevent/libevent/pull/741 (stalled pull request
with comments explaining the larger problem in more detail).

Differential Revision: https://phabricator.services.mozilla.com/D85781
2020-08-04 15:06:32 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Kershaw Chang 13c4c8d567 Bug 1648996 - Keep the source stream open after serializing, r=baku
The main reason of this patch is that the source stream will be closed when `InputStreamHelper::SerializeInputStreamAsPipe` is called, but when `InputStreamHelper::SerializeInputStreamAsPipe` is not called, the stream is stayed opened. I think we should make the behavior of serialization stream consistent, which is keeping the source stream opened.

Differential Revision: https://phabricator.services.mozilla.com/D81978
2020-08-03 10:39:48 +00:00
Simon Giesecke 032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Sylvestre Ledru 843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Butkovits Atila 64a8612aa9 Backed out changeset 562a834a3692 (bug 1656349) for build bustages at BackgroundParentImpl. CLOSED TREE 2020-08-01 01:02:44 +03:00
Chris Martin 583e1cc437 Bug 1656349 - Refactor the IPC lifetimes for the PGamepadEventChannel object r=daoshengmu
Change the GamepadEventChannel so it is fully-initialized by the IPC
constuctor and needs no separate "init" message, and so its completely
destroyed by the ActorDestroy() message so it needs no "cleanup" message.

This simplifies the object lifetime, as well as unifies the IPC error vs
clean shutdown paths.

Differential Revision: https://phabricator.services.mozilla.com/D85481
2020-07-31 19:40:55 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
James Teh de10571c3c Bug 1654969: Always disable COM pings for mscom::FastMarshaler (and thus mscom::Interceptor). r=aklotz
Previously, we only did this when IsCallerExternalProcess() returned false.
There are three reasons for changing this:

1. There seem to be cases where IsCallerExternalProcess() returns true even when marshaling for a COM query in the MTA.
2. After bug 1627084, we pre-build a11y handler payloads on the main thread for bulk fetch calls. That will marshal interceptors. However, IsCallerExternalProcess() can't work in that case because it's not running on the thread on which the COM call is being handled.
3. If MSHLFLAGS_NOPING is used, Release calls from remote clients are never sent to the server. So, as soon as we use NOPING for our parent process, we're already going to leak references, even if we don't use NOPING for external callers. Put another way, as soon as we use NOPING for one caller, we may as well use it for all callers because COM pinging will never release the object anyway.

Differential Revision: https://phabricator.services.mozilla.com/D84778
2020-07-29 21:11:14 +00:00
Jed Davis 8c61fa8fde Bug 1656101 - Delete some IPC dead code (BrowserProcessSubThread types and an unused header). r=mccr8
An actual use of the `BACKGROUND_X11` thread may have briefly existed in
2009 but probably never shipped; it's been unused since then, and even
the comments mentioning it have been pruned (bug 909028, bug 624422).
The other thread types besides IO have been commented out ever since
they were first committed.

This patch also removes `x11_util.h`, which has been unused since 2017
(bug 1426284); earlier in history, it had one of those comments
mentioning the nonexistent X11 thread.

Differential Revision: https://phabricator.services.mozilla.com/D85346
2020-07-29 23:31:38 +00:00
Ricky Stewart 11e536dbb2 Bug 1655993 - Remove Punion_Comparable::test from sync-messages.ini r=mccr8
This shouldn't have been added in the first place.

Differential Revision: https://phabricator.services.mozilla.com/D85292
2020-07-29 15:02:11 +00:00
Sebastian Streich fb1d1dc1df Bug 1558394 - Pass the TriggeringSandboxFlags to nsILoadinfo r=ckerschb,smaug,necko-reviewers,valentin
Add triggering Sandbox flags to loadinfo
***
Pass triggering Flags into Loadinfo

***
Fix triggeringSandboxflags passing

Differential Revision: https://phabricator.services.mozilla.com/D69588
2020-07-29 11:43:23 +00:00
Ricky Stewart e8ac99b085 Bug 1655371 - Fix ipdl test breaking Windows ccov builds r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D85067
2020-07-27 22:21:48 +00:00
Ricky Stewart 3419d4de1d Bug 1654589 - Move `libpref` Python unit test to `mozbuild` suite r=froydnj,mccr8
It could go into its own test suite, but it 1) depends on `mozbuild` code, so the `mozbuild` suite as well as this new suite would be running on any push that touches `mozbuild` code anyway, and 2) this is code that runs during the build, so it's not out of place.

Differential Revision: https://phabricator.services.mozilla.com/D84547
2020-07-23 22:00:46 +00:00
Jon Bauman e893f80bba Bug 1654379 - Allow filtering the IPC log by multiple toplevel protocol names. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D84587
2020-07-23 17:47:39 +00:00
Simon Giesecke b0cf19fc3b Bug 1654469 - Fix test protocol names. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D84656
2020-07-23 14:07:02 +00:00
Emilio Cobos Álvarez ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Jed Davis 0e88912e37 Bug 1632687 - Part 3: Introduce an OS-dependent ChannelId type to reflect that Unix doesn't use channel IDs. r=mccr8
The Chromium-derived IPC code was, as far as I can tell, originally
designed for Windows and assumed that channels would be named pipes,
managed and connected to via `std::wstring` paths.  The port to Unix,
however, used unnamed `socketpair()` and passed them directly from
process to process, so it has no use for these channel IDs...  but it
still computes and propagates them, even though they're not used, using
deprecated wide-string APIs.

This patch introduces a typedef for an abstract channel ID, which is a
`wstring` on Windows and an empty struct on Unix, to allow removing the
string code where it's not needed without needing to completely redesign
the channel abstraction.

Differential Revision: https://phabricator.services.mozilla.com/D72260
2020-07-22 19:04:48 +00:00
Jed Davis d3f86fcc5c Bug 1632687 - Part 2: Remove the channel ID prefixes, which we've never used. r=mccr8
Chromium's fix for CVE-2011-3079 added an optional prefix parameter for
channel IDs, but we've never used it and have no plans to.  (Chromium
itself doesn't appear to have used it except with the prefixes "gpu"
and "nacl", and the code has since been removed completely in favor of
Mojo.)  So let's simplify things and remove it.

Differential Revision: https://phabricator.services.mozilla.com/D84276
2020-07-22 19:04:46 +00:00
Jed Davis 053045fdbe Bug 1632687 - Part 1.5: Protect the hard-coded IPC child fd from accidental multiple use. r=mccr8
This "create a pipe" operation has a mode where, on Unix, it doesn't
create a new transport but rather uses a hard-coded fd for the initial
IPC channel in a child process.  (It was originally written for Windows
and the assumption of using named pipes and pathnames for everything.)

That seems like a footgun, so this patch checks for trying to "create"
that pipe twice.  However, it doesn't check for accidentally calling it
in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D72259
2020-07-22 19:04:44 +00:00
Jed Davis c24433b717 Bug 1632687 - Part 1: Remove IPC PipeMap. r=mccr8
The PipeMap class tries to simulate the Windows channel model (named
pipes that the client opens by a pathname) on Unix.  However, it's
effectively dead code -- the map is empty except in some unit tests that
we never imported.

What we do is generate a "channel ID" with string formatting, then don't
pass it to the child or ever insert anything into the map, then the child
looks up an empty string and doesn't find it, so it uses the hard-coded
fixed fd for the initial channel.

Basically, it does nothing except maybe confuse unfamiliar readers, so
let's get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D72258
2020-07-22 19:04:37 +00:00
Simon Giesecke 548e423dad Bug 1654469 - Stop generating operator==/operator != for IPDL structs/unions by default. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D84485
2020-07-22 17:24:33 +00:00
Simon Giesecke d824054ce7 Bug 1654181 - Add uncomparable keyword for structs and unions. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D84298
2020-07-22 09:11:52 +00:00
Jeff Gilbert 35f892e782 Bug 1607940 - Stand up webgl.out-of-process:true path. r=handyman,nika,froydnj
* Use clearer pref names.
* Default (and only support) IPDL dispatching.
* Make DispatchCommands async-only.
* Sync ipdl command per sync webgl entrypoint.
  * Eat the boilerplate cost, since there's not too many.
* Run SerializedSize off same path as Serialize.
* All shmem uploads go through normal DispatchCommands.
* Defer pruning of dead code for now so we can iterate quickly.
* Use Read/Write(begin,end) instead of (begin,size).
  * This would have prevented a bug where we read/wrote N*sizeof(T)*sizeof(T).

Differential Revision: https://phabricator.services.mozilla.com/D81495
2020-07-21 22:56:52 +00:00
Andrew Osmond d933968108 Bug 1582954 - Use posix_fallocate if available to avoid lazy allocation for shared memory. r=jld
WebRender makes extensive use of shared memory buffers, particularly for
images decoded in the content process. These images can be arbitrarily
large, and there being insufficient memory for an allocation must be
handled gracefully.

On Linux, we will currently crash with a SIGBUS signal during image
decoding instead of just displaying the broken image tag. This is
because the pages backing the shared memory are only allocated when we
write to them. This blocks shipping WebRender on Linux.

This patch uses posix_fallocate to force the reservation of the pages,
and allows failing gracefully if they are unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D80650
2020-07-20 17:47:52 +00:00
Andrew McCreight 6fce3d2191 Bug 1653587 - Fix "Genreate" typo. DONOTBUILD r=jld
Differential Revision: https://phabricator.services.mozilla.com/D83956
2020-07-20 16:52:29 +00:00
David Teller 94b50d3de1 Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
2020-07-20 09:42:48 +00:00
Cosmin Sabou c562fee6cd Backed out 2 changesets (bug 1652000) for causing Bug 1653749.
Backed out changeset 69dbf38f4071 (bug 1652000)
Backed out changeset 0a6cb920a247 (bug 1652000)
2020-07-19 05:54:07 +03:00
David Teller 15c3a336eb Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
2020-07-17 19:48:21 +00:00
Anny Gakhokidze deced955d5 Bug 1642468 - Part 1: Remove all outer windowId fields from LoadInfo, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D83562
2020-07-17 17:13:26 +00:00
Narcis Beleuzu a475e11422 Backed out 2 changesets (bug 1652000) for bustages on ChromeUtils.cpp . CLOSED TREE
Backed out changeset 5f02a357671c (bug 1652000)
Backed out changeset 22bb2a5032b7 (bug 1652000)
2020-07-17 20:16:32 +03:00
Agi Sferro 489dd44cdd Bug 1651838 - Remove unused --appomni on Android. r=glandium,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83195
2020-07-17 16:58:29 +00:00
David Teller 37dd44228b Bug 1652000 - A little lifetime documentation;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83337
2020-07-17 16:21:26 +00:00
Jed Davis 75573b020f Bug 1325918 - Ignore MsgDropped errors in BackgroundChildImpl. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D83558
2020-07-14 20:23:49 +00:00