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

3651 Коммитов

Автор SHA1 Сообщение Дата
Kirk f9526638b2 Bug 1726659 - Prevent update UI on a Silent Restart r=agashlin
Additionally should prevent elevated updates from running at all on a silent restart, since this will always require UI.

Differential Revision: https://phabricator.services.mozilla.com/D123568
2021-08-31 22:49:11 +00:00
Markus Stange a267358c75 Bug 1728339 - Find the mount point BSD name correctly even under App Translocation, by calling statfs a second time. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D124126
2021-08-31 21:23:50 +00:00
Jonathan Watt 35b9ff13be Bug 516362 p4. Enable detection of run-from-.dmg and prompt to install and relaunch. r=mstange
Depends on D122686

Differential Revision: https://phabricator.services.mozilla.com/D122687
2021-08-30 21:15:05 +00:00
Jonathan Watt 50f1d52b4f Bug 516362 p3. Add API to install from .dmg and relaunch. r=mstange,spohl
Depends on D122685

Differential Revision: https://phabricator.services.mozilla.com/D122686
2021-08-30 21:15:05 +00:00
Jonathan Watt 92c3b12a8b Bug 516362 p2. Add a localized helper to notify the user if installation fails. r=mstange,zbraniecki
Depends on D122476

Differential Revision: https://phabricator.services.mozilla.com/D122685
2021-08-30 21:15:04 +00:00
Jonathan Watt ed7d14cf9a Bug 516362 p1. Add a localized helper to prompt the user for approval to install the app. r=zbraniecki,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D122476
2021-08-30 21:15:04 +00:00
Marian-Vasile Laza f89210cf82 Backed out 4 changesets (bug 516362) for causing mochitest bc failures on browser_all_files_referenced.js. CLOSED TREE
Backed out changeset 12f1b1fee451 (bug 516362)
Backed out changeset eb8885d5cd62 (bug 516362)
Backed out changeset 723ec69bb57e (bug 516362)
Backed out changeset 1e2f80bda8b4 (bug 516362)
2021-08-30 21:53:04 +03:00
Jonathan Watt 1a15ac67cf Bug 516362 p4. Enable detection of run-from-.dmg and prompt to install and relaunch. r=mstange
Depends on D122686

Differential Revision: https://phabricator.services.mozilla.com/D122687
2021-08-30 17:51:54 +00:00
Jonathan Watt b4ca7024a7 Bug 516362 p3. Add API to install from .dmg and relaunch. r=mstange,spohl
Depends on D122685

Differential Revision: https://phabricator.services.mozilla.com/D122686
2021-08-30 17:51:54 +00:00
Jonathan Watt 103c8ac225 Bug 516362 p2. Add a localized helper to notify the user if installation fails. r=mstange,zbraniecki
Depends on D122476

Differential Revision: https://phabricator.services.mozilla.com/D122685
2021-08-30 17:51:54 +00:00
Jonathan Watt f6ffe2bd7b Bug 516362 p1. Add a localized helper to prompt the user for approval to install the app. r=zbraniecki,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D122476
2021-08-30 17:51:53 +00:00
Andi-Bogdan Postelnicu 2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Kagami Sascha Rosylight eddf271c1f Bug 1726648 - Add a helper to trim brackets from nsID r=mccr8,smaug
Differential Revision: https://phabricator.services.mozilla.com/D123163
2021-08-23 10:54:11 +00:00
Iulian Moraru a16afaadfe Backed out changeset d21b3f88a2b4 (bug 1726648) for causing build bustages. CLOSED TREE 2021-08-23 04:12:02 +03:00
Kagami Sascha Rosylight 0c5086660f Bug 1726648 - Add a helper to trim brackets from nsID r=mccr8,smaug
Differential Revision: https://phabricator.services.mozilla.com/D123163
2021-08-23 00:35:40 +00:00
Nicklas Boman 79898e04ea Bug 1308094 - Remove deprecated PL_strdup calls from toolkit code r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D122148
2021-08-17 19:34:32 +00:00
Mike Hommey 9b84112275 Bug 1723911 - Make NS_GRE_BIN_DIR valid on Android. r=xpcom-reviewers,nika
Historically, Android builds would dynamically load the gecko libraries
from the APK, so NS_GRE_BIN_DIR didn't make sense. That however changed
a few years ago, and nowadays, libraries are extracted on installation,
and loaded from a normal path. We can thus make NS_GRE_BIN_DIR valid.

The current logic of deriving from NS_GRE_BIN works on most platforms,
but falls flat on Android, so we derive it from XRE_BinaryPath instead.

Differential Revision: https://phabricator.services.mozilla.com/D121696
2021-08-13 00:37:10 +00:00
Aaron Klotz ac6454a0ed Bug 1724749: Consolidate all dllservices code; r=tkikuchi
Per the discussion on governance, the new DLL services module will live in
`toolkit/xre/dllservices`.

Mozglue code will live in `toolkit/xre/dllservices/mozglue` and will be linked
in with `mozglue.dll`.

Differential Revision: https://phabricator.services.mozilla.com/D122384
2021-08-12 20:57:12 +00:00
Alexandru Michis 15f1bc73d2 Backed out changeset b81da25293ad (bug 1724749) for causing bustages due to UntrustedModulesData.h not being found.
CLOSED TREE
2021-08-12 02:49:40 +03:00
Aaron Klotz cdc3b69555 Bug 1724749: Consolidate all dllservices code; r=tkikuchi
Per the discussion on governance, the new DLL services module will live in
`toolkit/xre/dllservices`.

Mozglue code will live in `toolkit/xre/dllservices/mozglue` and will be linked
in with `mozglue.dll`.

Differential Revision: https://phabricator.services.mozilla.com/D122384
2021-08-11 23:08:52 +00:00
stransky 49f523cc07 Bug 1724679 [Linux] Check env variables for '1' to enable them, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D122076
2021-08-11 07:28:57 +00:00
Alexandre Lissy f41c9baf2b Bug 1723753 - Remove XRE_USER_SYS_EXTENSION_DEV_DIR r=handyman,robwu,haik,gcp
Differential Revision: https://phabricator.services.mozilla.com/D121647
2021-08-10 15:54:02 +00:00
Toshihito Kikuchi 265f10f0b9 Bug 1708741 - Add a new testcase for WinRemoteMessageReceiver. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D122170
2021-08-10 15:07:17 +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
Gabriele Svelto 559377e821 Bug 1723934 - Remove useless nsExceptionHandler.h inclusions and crash reporter service definitions r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D121708
2021-08-09 20:08:17 +00:00
Toshihito Kikuchi 547568f702 Bug 1711126 - The module index in the third-party modules ping may be -1. r=mhowell
This patch updates the regex pattern to match data where the module index of
a callstack is -1 or a non-negative integer.  -1 is legitimately set in
`CreateJSStackObject` when the frame address is not within any module in the
module list.

If the pattern did not match in debug build, calling `toBoolean()` hit the
assert because `matchResult` was not a boolean but null.  This patch fixes
that problem, too.

Differential Revision: https://phabricator.services.mozilla.com/D122020
2021-08-06 19:18:49 +00:00
Jonathan Watt 3bb5899c2d Bug 1700795. Detect running from .dmg on macOS and report telemetry. r=mstange,mossop
Differential Revision: https://phabricator.services.mozilla.com/D121567
2021-08-05 09:39:16 +00:00
Toshihito Kikuchi e96242f950 Bug 1718348 - Always preload bcryptPrimitives.dll in a sandboxed process. r=bobowen
Bug 1720746 was a test failure in the plugin process with ASan, but bug 1718348
tells us the same problem happens in the content process without ASan.
This patch expands the fix to all sandbox processes.

Differential Revision: https://phabricator.services.mozilla.com/D121814
2021-08-05 07:43:23 +00:00
Sandor Molnar 90ad105d5d Backed out changeset c1de1d5f6beb (bug 1700795) for causing build bustages in nsAppRunner. CLOSED TREE 2021-08-05 05:25:41 +03:00
Jonathan Watt adf038b4a6 Bug 1700795. Detect running from .dmg on macOS and report telemetry. r=mstange,mossop
Differential Revision: https://phabricator.services.mozilla.com/D121567
2021-08-05 01:32:31 +00:00
Adam Gashlin e151e3d85c Bug 1722086 - Part 1: Set default browser from WDBA with UserChoice. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D121558
2021-08-03 22:49:20 +00:00
Molly Howell a0c6decba2 Bug 1709969 Part 3 - Migrate from an existing profile when creating the dedicated profile for a Windows app package. r=mossop,agashlin
Differential Revision: https://phabricator.services.mozilla.com/D117244
2021-07-30 19:09:47 +00:00
Molly Howell d0c2b60a53 Bug 1709969 Part 2 - Use the package family name to compute path hashes when in a package. r=agashlin
Differential Revision: https://phabricator.services.mozilla.com/D120530
2021-07-30 19:09:47 +00:00
Sandor Molnar 1aa5913c7d Backed out 3 changesets (bug 1709969) for causing xpc failures in test_select_profile_package. CLOSED TREE
Backed out changeset 17ed7ca86998 (bug 1709969)
Backed out changeset a6b917838765 (bug 1709969)
Backed out changeset 6a80559a4055 (bug 1709969)
2021-07-30 21:26:09 +03:00
Molly Howell ba09a654e2 Bug 1709969 Part 3 - Migrate from an existing profile when creating the dedicated profile for a Windows app package. r=mossop,agashlin
Differential Revision: https://phabricator.services.mozilla.com/D117244
2021-07-30 17:34:26 +00:00
Molly Howell 5be5a1a024 Bug 1709969 Part 2 - Use the package family name to compute path hashes when in a package. r=agashlin
Differential Revision: https://phabricator.services.mozilla.com/D120530
2021-07-30 17:34:26 +00:00
Toshihito Kikuchi 3abb5523e2 Bug 1720746 - Preload bcryptPrimitives.dll in the main thread of GMP. r=bobowen
The call to `RtlGenRandom` delay-loads bcryptPrimitives.dll.  The GMP process,
however, cannot load bcryptPrimitives.dll after process launch because its process
token is restricted.  This is not a problem normally because bcryptPrimitives.dll
is loaded in early stage when the main thread still has a non-restricted impersonation
token.

With ASan, however, the first call to `RandomUint64` happens in a non-main thread,
and it fails because the thread is not impersonated.  We have PreloadLibs to mitigate
this kind of problem, but in this case adding bcryptPrimitives.dll to the list does
not help because the call to `RandomUint64` happens before we load PreloadLibs.

The proposed fix is to explicitly call `RandomUint64` in the main thread before
any call to `RandomUint64` in the process.

Differential Revision: https://phabricator.services.mozilla.com/D121203
2021-07-29 15:40:47 +00:00
Mike Hommey 023ce9967d Bug 1582382 - Move rust malloc and oom hook to mozglue. r=firefox-build-system-reviewers,andi
This is similar to what was done in bug 1594998 for the panic hook.

Differential Revision: https://phabricator.services.mozilla.com/D121032
2021-07-28 20:33:08 +00:00
Robert Mader 68d9686d94 Bug 1720497 - Do not require MOZ_ENABLE_WAYLAND if Xwayland is not available, r=stransky
If `WAYLAND_DISPLAY` is set but `DISPLAY` is not, we have every reason
to assume that we are in a Wayland-only session. Enable the Wayland
backend unconditionally in this case.

Note: We do not bother to further sanity check the content of the env
variables as these can be considered client setup bugs.

Differential Revision: https://phabricator.services.mozilla.com/D120216
2021-07-19 20:26:00 +00:00
Mike Hommey ed0947b799 Bug 1719237 - Revert bug 1718131. r=stransky
It turns out calling gdk_display_close gets us a rematch of bug 1626536,
so remove the call that was added in bug 1718131, and adjust valgrind
suppressions accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D120037
2021-07-16 08:21:49 +00:00
Molly Howell c8456941cf Bug 1709978 - Disable app update when running as a packaged app. r=agashlin,preferences-reviewers
This patch disables the update service as if it were disabled by policy
whenever a package identify is present. User interfaces are treated as if
the updater had not been included in the build, because that prevents any of
our usual update UI from being shown, and in particular ensures that we do not
generate messages about an administrator handling updates, as would normally
happen when disabling updates via policy.

The telemetry environment's update.enabled flag is deliberately left alone in
this patch, because the mere fact of using an app package does not really say
anything about whether the user intends to allow automatic updating or not.

Depends on D114427

Differential Revision: https://phabricator.services.mozilla.com/D114886
2021-07-15 20:58:21 +00:00
Csoregi Natalia e3638062b6 Backed out changeset cec939837018 (bug 1709978) for causing failures on app update. CLOSED TREE 2021-07-14 22:21:53 +03:00
Molly Howell c797d0b164 Bug 1709978 - Disable app update when running as a packaged app. r=agashlin,preferences-reviewers
This patch disables the update service as if it were disabled by policy
whenever a package identify is present. User interfaces are treated as if
the updater had not been included in the build, because that prevents any of
our usual update UI from being shown, and in particular ensures that we do not
generate messages about an administrator handling updates, as would normally
happen when disabling updates via policy.

The telemetry environment's update.enabled flag is deliberately left alone in
this patch, because the mere fact of using an app package does not really say
anything about whether the user intends to allow automatic updating or not.

Differential Revision: https://phabricator.services.mozilla.com/D114886
2021-07-14 18:23:41 +00:00
Robert Mader dd99cc8d30 Bug 1720187 - Better device and vendor ID detection in glxtest, r=aosmond
In D98108 we added infrastructure to detect infos for DRM devices in
multi GPU setups. We didn't use it for detecting device and vendor IDs
thought, which remained flaky.

Extend the code a little bit, allowing us to reliably get the right
IDs - at least for mesa drivers. This should make our detection
as reliable as it was when using GLX.

This should stop us from showing the following warning in most cases:
`[GFX1-]: More than 1 GPU from same vendor detected via PCI, cannot deduce device`

Differential Revision: https://phabricator.services.mozilla.com/D119666
2021-07-13 13:58:07 +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
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
Mike Hommey fa986685c1 Bug 1718131 - Close GdkDisplay in XREMain destructor. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D118753
2021-06-25 13:28:28 +00:00
Alexandru Michis 7498132439 Backed out 2 changesets (bug 1695118, bug 1718131) for causing leaks.
CLOSED TREE

Backed out changeset 69aa398773b4 (bug 1695118)
Backed out changeset 19805fbf94a3 (bug 1718131)
2021-06-25 13:43:04 +03:00
Mike Hommey b6d5387325 Bug 1718131 - Close GdkDisplay in XREMain destructor. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D118753
2021-06-25 09:29:33 +00:00
Kris Maglione cd43e30d8b Bug 1714112: Add new Fission decision value for phased rollout enablement. r=nika,fluent-reviewers,flod
This should be less confusing to users, and makes it easier to triage
about:support data.

Differential Revision: https://phabricator.services.mozilla.com/D118416
2021-06-22 17:28:34 +00:00
Youhai Li e10e215fb2 Bug 1672577 - Removed expired probe NUMBER_OF_PROFILES, r=jaws,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D116735
2021-06-21 14:53:09 +00:00
Toshihito Kikuchi 076a7b1ee6 Bug 1713415 - Don't discard the unprocessed loading events. r=aklotz
We had the constant `kMaxEvents` which limits the maximum number of loading
events in `UntrustedModulesData`.  Because we had a check for the number of
events in `UntrustedModulesData::AddNewLoads` where we already swapped
`UntrustedModulesProcessor::mUnprocessedModuleLoads` with a local variable,
when the array exceeds `kMaxEvents`, we discarded the remaining loading events.

The proposed fix is to check for `kMaxEvents` before swapping the unprocessed
events, so that the remaining events will be processed the next time.

This was caught by the `UntrustedModulesFixture` GTest.  This test had
another test bug that it always expected modules were loaded in the main
thread except the predefined known modules.  This is not correct because
the same process may have loaded a bunch of modules in the earlier GTests
such as graphics drivers in different threads.  This patch includes a fix
for that bug as well.

Differential Revision: https://phabricator.services.mozilla.com/D117433
2021-06-18 06:01:29 +00:00
Alexandru Michis 81c55fe871 Backed out changeset a90edecdce6f (bug 1713415) for module checking crashes (bug 1717059). a=backout 2021-06-18 01:11:57 +03:00
Toshihito Kikuchi a1fe650713 Bug 1713415 - Don't discard the unprocessed loading events. r=aklotz
We had the constant `kMaxEvents` which limits the maximum number of loading
events in `UntrustedModulesData`.  Because we had a check for the number of
events in `UntrustedModulesData::AddNewLoads` where we already swapped
`UntrustedModulesProcessor::mUnprocessedModuleLoads` with a local variable,
when the array exceeds `kMaxEvents`, we discarded the remaining loading events.

The proposed fix is to check for `kMaxEvents` before swapping the unprocessed
events, so that the remaining events will be processed the next time.

This was caught by the `UntrustedModulesFixture` GTest.  This test had
another test bug that it always expected modules were loaded in the main
thread except the predefined known modules.  This is not correct because
the same process may have loaded a bunch of modules in the earlier GTests
such as graphics drivers in different threads.  This patch includes a fix
for that bug as well.

Differential Revision: https://phabricator.services.mozilla.com/D117433
2021-06-16 21:16:05 +00:00
Gabriele Svelto a7c337103a Bug 1697895 - Register the WER runtime exception module in child processes r=KrisWright
This patch sets up a few different things that will be used by the WER runtime
exception module when it needs to notify the main process of a child process
crash.

For every child process we allocate a structure in the main process called
WindowsErrorReportingData that contains three things:
- The address of the function used to notify the main process that there's a
  pending minidump for a given child process
- The PID of said child process
- The name of the minidump that has been generated

The first field is filled up by the main process and will be read by the WER
process when running the runtime exception module, the second and third fields
on the other hand start empty and will be written into by the runtime exception
module after it has generated a minidump.

I know this sounds scary. It is. But bear with me please.

When we register the runtime exception module we can pass it a single
pointer-sized parameter but we need to pass it at least another pointer that
includes data coming from the child process itself (this one is called
InProcessWindowsErrorReportingData). This data currently includes only the
process type but will also include certain annotations in the future
(e.g. bug 1711418). So here's what we do: we store a pointer to the parent
data structure in the child process command-line (cringe) and we read it
from the runtime exception module by reading the crashed process command-line
arguments and parsing them (double-cringe).

Armed with this information the WER runtime exception module can populate
the info for the generated minidump and then push it into the main process
by calling CreateRemoteThread() (which creates a new thread in the main
process, triple-cringe at this point).

Differential Revision: https://phabricator.services.mozilla.com/D115379
2021-06-11 09:59:49 +00:00
Iulian Moraru d5be2d4af2 Backed out 5 changesets (bug 1682518, bug 1703761, bug 1711418, bug 1697895) for causing build bustages on nsEmbedFunctions.cpp. CLOSED TREE
Backed out changeset d747dd950198 (bug 1711418)
Backed out changeset 58092e594233 (bug 1711418)
Backed out changeset d9b5dd9f7307 (bug 1703761)
Backed out changeset 345c36d8e46b (bug 1682518)
Backed out changeset a9be55acfd91 (bug 1697895)
2021-06-11 07:08:38 +03:00
Gabriele Svelto 1a86d1dee4 Bug 1697895 - Register the WER runtime exception module in child processes r=KrisWright
This patch sets up a few different things that will be used by the WER runtime
exception module when it needs to notify the main process of a child process
crash.

For every child process we allocate a structure in the main process called
WindowsErrorReportingData that contains three things:
- The address of the function used to notify the main process that there's a
  pending minidump for a given child process
- The PID of said child process
- The name of the minidump that has been generated

The first field is filled up by the main process and will be read by the WER
process when running the runtime exception module, the second and third fields
on the other hand start empty and will be written into by the runtime exception
module after it has generated a minidump.

I know this sounds scary. It is. But bear with me please.

When we register the runtime exception module we can pass it a single
pointer-sized parameter but we need to pass it at least another pointer that
includes data coming from the child process itself (this one is called
InProcessWindowsErrorReportingData). This data currently includes only the
process type but will also include certain annotations in the future
(e.g. bug 1711418). So here's what we do: we store a pointer to the parent
data structure in the child process command-line (cringe) and we read it
from the runtime exception module by reading the crashed process command-line
arguments and parsing them (double-cringe).

Armed with this information the WER runtime exception module can populate
the info for the generated minidump and then push it into the main process
by calling CreateRemoteThread() (which creates a new thread in the main
process, triple-cringe at this point).

Differential Revision: https://phabricator.services.mozilla.com/D115379
2021-06-10 22:01:32 +00:00
Brindusan Cristian df90ffe9bc Backed out 5 changesets (bug 1697895, bug 1682518, bug 1703761, bug 1711418) for causing Windows 2012 x64 asan buid bustages.
CLOSED TREE

Backed out changeset 4cc2cb3653f2 (bug 1711418)
Backed out changeset 02cf2dc4c3c8 (bug 1711418)
Backed out changeset ca35e73d9445 (bug 1703761)
Backed out changeset 43c12d3f5c4f (bug 1682518)
Backed out changeset d75aef90ac53 (bug 1697895)
2021-06-10 16:30:44 +03:00
Gabriele Svelto 1ebc33d4a4 Bug 1697895 - Register the WER runtime exception module in child processes r=KrisWright
This patch sets up a few different things that will be used by the WER runtime
exception module when it needs to notify the main process of a child process
crash.

For every child process we allocate a structure in the main process called
WindowsErrorReportingData that contains three things:
- The address of the function used to notify the main process that there's a
  pending minidump for a given child process
- The PID of said child process
- The name of the minidump that has been generated

The first field is filled up by the main process and will be read by the WER
process when running the runtime exception module, the second and third fields
on the other hand start empty and will be written into by the runtime exception
module after it has generated a minidump.

I know this sounds scary. It is. But bear with me please.

When we register the runtime exception module we can pass it a single
pointer-sized parameter but we need to pass it at least another pointer that
includes data coming from the child process itself (this one is called
InProcessWindowsErrorReportingData). This data currently includes only the
process type but will also include certain annotations in the future
(e.g. bug 1711418). So here's what we do: we store a pointer to the parent
data structure in the child process command-line (cringe) and we read it
from the runtime exception module by reading the crashed process command-line
arguments and parsing them (double-cringe).

Armed with this information the WER runtime exception module can populate
the info for the generated minidump and then push it into the main process
by calling CreateRemoteThread() (which creates a new thread in the main
process, triple-cringe at this point).

Differential Revision: https://phabricator.services.mozilla.com/D115379
2021-06-10 11:58:37 +00:00
Robert Mader c5da1a14d6 Bug 1715245 - Leave X11 connection open, r=aosmond
Closing the X11 connection is buggy on nv prop. drivers. Leave
it open, the process will exit anyways.

Differential Revision: https://phabricator.services.mozilla.com/D117325
2021-06-09 14:52:15 +00:00
Nika Layzell 1aaeb179e2 Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117103
2021-06-09 04:56:48 +00:00
Glenn Watson 520da01b0c Bug 1714897 - Fix glxtest EGL code path on amdgpu r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D116957
2021-06-06 23:44:40 +00:00
Robert Mader 5dc84ace8f Bug 1714069 - Block Mesa software drivers for HW-WR, r=aosmond
We currently allow software drivers such as `llvmpipe` to run HW-WR -
in nightly and  apparently even in release.
Explicitly make these drivers always use SW-WR instead.

While on it, improve our detection for software drivers in glxtest.
This may become handy for new software drivers such as zink+lavapipe.

Differential Revision: https://phabricator.services.mozilla.com/D116771
2021-06-04 15:05:01 +00:00
Toshihito Kikuchi a2c93279d1 Bug 1713100 - Move AvailableMemoryTracker::Init() back to NS_InitXPCOM. r=gsvelto
Bug 1711610 moved `AvailableMemoryTracker::Init()` from `NS_InitXPCOM` to `XRE_mainRun`,
but it caused memory degradation because `AvailableMemoryTracker` was no longer initialized
in the child processes.

I made that part for `nsAvailableMemoryWatcher` to cache the pref value in the earlier design,
but it's not needed at all in the current design because `nsAvailableMemoryWatcher` loads
a mirror value every time.

This patch reverts `AvailableMemoryTracker::Init()` back to `NS_InitXPCOM`.

Differential Revision: https://phabricator.services.mozilla.com/D116742
2021-06-04 14:16:02 +00:00
Dorel Luca 4c4ab2ea93 Backed out changeset 95cf6de34f88 (bug 1672577) for Browser-chrome in toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js. CLOSED TREE 2021-06-03 22:05:54 +03:00
Youhai Li 519de0df2c Bug 1672577 - Removed expired probe NUMBER_OF_PROFILES, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D116735
2021-06-03 16:36:30 +00:00
Toshihito Kikuchi 0b6b4d9629 Bug 1711610 - Should not trigger the memory pressure event if the available commit space is not low. r=gsvelto
After bug 1586236, we use the memory resource notification object to detect a low
memory situation on Windows, which is signaled when the available physical memory
is low.  If the available physical memory is low, however, it's possible that there
is still commit space enough for the application to run.  In such a situation, we
don't want to make aggressive efforts to reduce memory usage.

This patch makes sure we send the memory pressure event (both New and Ongoing) only
when the available commit space is lower than the threshold value defined by the pref
"browser.low_commit_space_threshold_mb".  Its default value is set to 200MB
based on our telemetry data indicating ~60% of OOM crashes with <100MB, ~75% with <300MB.

To use the pref in `nsAvailableMemoryWatcher`, this patch moves the call to
`AvailableMemoryTracker::Init()` to `XRE_mainRun()`.  It was in `NS_InitXPCOM`
because the old initialization code hooked APIs and needed to be done while
the process has only one thread (bug 741540).  The current `AvailableMemoryTracker`
does not use hooks, so it doesn't have to be initialized that early.

Differential Revision: https://phabricator.services.mozilla.com/D115605
2021-05-24 21:29:46 +00:00
Toshihito Kikuchi a12c4653e2 Bug 1710152 - Remove the BIOS_Manufacturer and MemoryErrorCorrection annotations. r=gsvelto
The brower process used WMI to add BIOS Manufacturer and MemoryErrorCorrection
annotations to a crash report.  The downside is that calling `IWbemLocator::ConnectServer`
loads all of the registered AMSI modules into the process.  As we don't actively use either
of the annotations now, this patch removes WMI code to improve the stability.

Differential Revision: https://phabricator.services.mozilla.com/D115334
2021-05-18 15:01:15 +00:00
Magnus Melin 546ac2cb09 Bug 1703179 - [Thunderbird only] don't do early master password prompt when in backgroundtasks mode. r=kaie,xpcom-reviewers,mccr8 DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D114968
2021-05-14 09:43:13 +00:00
Kirk Steuber b1e3eb0ab5 Bug 1705726 - Create an interface to determine if the maintenance service registry entry exists r=nalexander
Creates nsIUpdateProcessor.serviceRegKeyExists(), which checks for existence the registry key written by the installer that indicates that the current installation can use the Maintenance Service.

The nsIUpdateProcessor interface was chosen because that is the one Update-related xpcom component that is implemented in C++. By implementing this in C++, we can use the existing implementation of CalculateRegistryPathFromFilePath() to do most of the work for us.

Unfortunately, we can't really test this feature without being able to write to HKEY_LOCAL_MACHINE, which we have no good way of doing during testing.

Differential Revision: https://phabricator.services.mozilla.com/D114803
2021-05-11 19:32:51 +00:00
Cosmin Sabou 8dfb644a92 Backed out 2 changesets (bug 1705726) for causing build bustages. CLOSED TREE
Backed out changeset 1454949d2d8b (bug 1705726)
Backed out changeset 4a2629df75a4 (bug 1705726)
2021-05-11 21:30:39 +03:00
Kirk Steuber b7b545db73 Bug 1705726 - Create an interface to determine if the maintenance service registry entry exists r=nalexander
Creates nsIUpdateProcessor.serviceRegKeyExists(), which checks for existence the registry key written by the installer that indicates that the current installation can use the Maintenance Service.

The nsIUpdateProcessor interface was chosen because that is the one Update-related xpcom component that is implemented in C++. By implementing this in C++, we can use the existing implementation of CalculateRegistryPathFromFilePath() to do most of the work for us.

Unfortunately, we can't really test this feature without being able to write to HKEY_LOCAL_MACHINE, which we have no good way of doing during testing.

Differential Revision: https://phabricator.services.mozilla.com/D114803
2021-05-11 18:12:08 +00:00
Toshihito Kikuchi 3abb99c8e2 Bug 1706041 - Reset gDllServices when DllServices is destroyed. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D113524
2021-05-07 19:11:48 +00:00
Jonathan Kew e579136e87 Bug 1707655 - Move the activation of supplemental fonts on macOS to a separate thread and try to get it started earlier. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D113552
2021-04-30 13:50:47 +00:00
stransky 7b1b15ed94 Bug 1708407 [Wayland] Fix leaked renderDeviceName at glxtest.cpp, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D113776
2021-04-30 07:08:50 +00:00
Toshihito Kikuchi 96461a9f97 Bug 1706501 - Make CommandLineParserWin::HandleCommandLine take nsTSubstring. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D113060
2021-04-27 18:20:51 +00:00
Doug Thayer 7318dd5ba0 Bug 1553399 - Unlock nsRemoteService before launching child r=mossop
This fixes the issue for me. I can't think of any problems with doing this
here? However I am not an expert in the remote service. As part of this I also
cover the case where the user encounters the profile lock dialogue and selects
to kill the existing instance of Firefox. This can result in a slow startup in
a similar way as far as I've been able to observe.

Differential Revision: https://phabricator.services.mozilla.com/D113054
2021-04-27 00:15:05 +00:00
Andi-Bogdan Postelnicu 2508edc4c5 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi
Updated with clang-format version 11.0.1 (taskcluster-GI8pmG3eQ_OSXfjFfr2yFw)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113294
2021-04-26 15:52:25 +00:00
Toshihito Kikuchi ebb9e9f364 Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz
Bug 1620118 added a new field `isDependent` in the third-party-module ping
which is calculated in `UntrustedModulesProcessor`.  However, bug 1684532
revealed it was not accurate because some third-party applications revert
the import table to the original state immediately after their module was
loaded.

Now that we have a logic to determine `isDependent` in `NtMapViewOfSection`
to automatically block a module injected through the import table, we can
pass that value to the ping and remove the original logic in `UntrustedModulesProcessor`.

Differential Revision: https://phabricator.services.mozilla.com/D112227
2021-04-16 19:35:55 +00:00
Mike Hommey 6a41d8d7ad Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-16 04:06:02 +00:00
Butkovits Atila 8255e3083f Backed out changeset 5c6b15fcea71 (bug 1515229) for causing GTest failures. CLOSED TREE 2021-04-15 13:37:29 +03:00
Mike Hommey 2eacd46d46 Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-14 22:31:36 +00:00
smolnar 22c6eb14ba Backed out changeset f7b0cdc3aeb0 (bug 1515229) for causing xpc failures in test_feature_stackwalking. CLOSED TREE 2021-04-14 12:25:37 +03:00
Mike Hommey 133396cb94 Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-14 04:47:09 +00:00
David Parks 6b176f5987 Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto
Eliminates the NPAPI plugin process type from the GeckoChildProcess enum as part of NPAPI removal.  In order to avoid altering enum values when updating the process list, the GECKO_PROCESS_TYPE macro has been updated to include the desired enum value.  We want to resist altering the values as they need to be consistent e.g. in telemetry reports.

We also remove plugins from adjacent spots that need to maintain consistency with GeckoChildProcess -- most notably the nsICrashService.

Differential Revision: https://phabricator.services.mozilla.com/D108689
2021-04-06 19:28:20 +00:00
David Parks d06598d3f3 Bug 1682030 - Remove Windows NPAPI plugin proccess sandbox r=bobowen
Removes Windows NPAPI process sandboxing code, including the code to establish a viable temp directory that was accessible by the sandboxed process.

Differential Revision: https://phabricator.services.mozilla.com/D108688
2021-04-06 19:28:19 +00:00
David Parks cd6fd9bfe5 Bug 1682030 - Remove more dead NPAPI code from dom/plugins and related spots. r=jmathies,mconley,emilio
This is the second of two patches in this series that removes a large amount of now dead code from dom/plugins as part of removing all NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107150
2021-04-06 19:28:15 +00:00
David Parks d05df71761 Bug 1682030 - Remove PPluginWidget. r=jmathies,ipc-reviewers,nika
Removes the NPAPI plugin widget actor and its proxy, as part of removing all of NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107141
2021-04-06 19:28:11 +00:00
Csoregi Natalia d68661e2cc Backed out 24 changesets (bug 1682030) for bustage on ProcessHangMonitor.cpp and nsCOMPtr.h. CLOSED TREE
Backed out changeset 5b1644096477 (bug 1682030)
Backed out changeset 35ae60eea3c7 (bug 1682030)
Backed out changeset 3eca76a6d639 (bug 1682030)
Backed out changeset 259c45447ad9 (bug 1682030)
Backed out changeset de9222dc8c31 (bug 1682030)
Backed out changeset 2986c7e14349 (bug 1682030)
Backed out changeset 6af3410bdb93 (bug 1682030)
Backed out changeset 42b0621c2927 (bug 1682030)
Backed out changeset 366e3e371858 (bug 1682030)
Backed out changeset 9adb2865adea (bug 1682030)
Backed out changeset 6af6af3bc03a (bug 1682030)
Backed out changeset da94a91b35ae (bug 1682030)
Backed out changeset 9143da258d0e (bug 1682030)
Backed out changeset 5e20d06952ba (bug 1682030)
Backed out changeset 6253d7e1ce7d (bug 1682030)
Backed out changeset 0e06ddeea3e2 (bug 1682030)
Backed out changeset 9c58d57c9e44 (bug 1682030)
Backed out changeset e90edd89430e (bug 1682030)
Backed out changeset 5861b8166b10 (bug 1682030)
Backed out changeset b4b88cdc7993 (bug 1682030)
Backed out changeset b80054e9805c (bug 1682030)
Backed out changeset 580d857674c0 (bug 1682030)
Backed out changeset a9cdf93c2662 (bug 1682030)
Backed out changeset 9c9c8b4998e2 (bug 1682030)
2021-04-06 03:54:12 +03:00
David Parks 3f9c44a9ed Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto
Eliminates the NPAPI plugin process type from the GeckoChildProcess enum as part of NPAPI removal.  In order to avoid altering enum values when updating the process list, the GECKO_PROCESS_TYPE macro has been updated to include the desired enum value.  We want to resist altering the values as they need to be consistent e.g. in telemetry reports.

We also remove plugins from adjacent spots that need to maintain consistency with GeckoChildProcess -- most notably the nsICrashService.

Differential Revision: https://phabricator.services.mozilla.com/D108689
2021-04-05 23:48:43 +00:00
David Parks 4e9ed60079 Bug 1682030 - Remove Windows NPAPI plugin proccess sandbox r=bobowen
Removes Windows NPAPI process sandboxing code, including the code to establish a viable temp directory that was accessible by the sandboxed process.

Differential Revision: https://phabricator.services.mozilla.com/D108688
2021-04-05 23:48:43 +00:00
David Parks 30be5dc789 Bug 1682030 - Remove more dead NPAPI code from dom/plugins and related spots. r=jmathies,mconley,emilio
This is the second of two patches in this series that removes a large amount of now dead code from dom/plugins as part of removing all NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107150
2021-04-05 23:48:39 +00:00
David Parks 45f5dd79ff Bug 1682030 - Remove PPluginWidget. r=jmathies,ipc-reviewers,nika
Removes the NPAPI plugin widget actor and its proxy, as part of removing all of NPAPI plugin support.

Differential Revision: https://phabricator.services.mozilla.com/D107141
2021-04-05 23:48:34 +00:00
Adam Gashlin d294246c6c Bug 1697955 - Resolve the install path used for sync manager locks. r=application-update-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D110722
2021-04-05 22:32:39 +00:00
Kirk Steuber b920b21c76 Bug 1674277 - Make AUS.stopDownload asynchronous r=nalexander,preferences-reviewers
The Downloader's cleanup function really ought to be asynchronous. The observer for "quit-application" is already asynchronous, so there's no problem there. But really, we ought to be cleaning up each downloader that we use, not just the last one. Which means that the cleanup ought to happen in AUS.stopDownload. So this patch will convert AUS.stopDownload to be asynchronous so that we can properly clean up the downloader from there.

Differential Revision: https://phabricator.services.mozilla.com/D110646
2021-04-05 19:52:12 +00:00
Nick Alexander 166dfa51ee Bug 1700850 - Part 2: Remove temporary background profile directories very late. r=dthayer
When `--backgroundtask TASK` invocations exit, they try to remove
their temporary profile directory.  This mostly works, except there
are some very late writes to the profile directory including
`Telemetry.ShutdownTime.txt` and the `security_state` directory.  This
commit accommodates by moving the profile directory removal even
later.  It might be possible to instead avoid these very late writes,
but that is hard in general, and is more likely to depend on the exact
code invoked by the background task itself.

Differential Revision: https://phabricator.services.mozilla.com/D110472
2021-04-05 04:16:37 +00:00
Nick Alexander ea97f27b52 Bug 1700850 - Part 1: Make temporary background profiles per-installation and unique. r=bytesized,mossop
Differential Revision: https://phabricator.services.mozilla.com/D110310
2021-04-05 04:16:37 +00:00
Nick Alexander b27ba19e6d Bug 1700850 - Pre: Create backgroundtask temporary profile before profile service. r=mossop
It's very unlikely that this would make a difference, since creating
the service does not immediately look for a profile.  But it's also
not clear to me why I originally placed it after the service was
created, and it's not impossible that the service creation would look
for `XRE_PROFILE_PATH` (which is how we communicate the desired
profile to the profile service), so let's create the profile before
the service.

Differential Revision: https://phabricator.services.mozilla.com/D110309
2021-04-05 04:16:36 +00:00
Robert Mader 82173ed8de Bug 1702463 - Also check for double buffered visual in glxtest, r=aosmond
`glXChooseVisual` requires us to choose whether we want single or
double buffered visuals. We don't care here, so check for both
cases.

Differential Revision: https://phabricator.services.mozilla.com/D110540
2021-04-01 22:00:59 +00:00
Adam Gashlin 4fa18c26fa Bug 1700870 - Explicitly convert path to UTF-8. r=application-update-reviewers,bytesized
nsPrintfCString %S converts from UTF-16 to the ANSI code page, but we rely on the output string being UTF-8.

Differential Revision: https://phabricator.services.mozilla.com/D110355
2021-03-31 16:29:04 +00:00
Adam Gashlin de0d973173 Bug 1696276 - Don't display UAC prompt or progress UI from a background task. r=application-update-reviewers,nalexander
If a prompt would be required to elevate, set an error update status, which
will be reset by the update service.

Also fix restarting from a background task: keep the --backgroundtask arg
until it can be saved in gRestartArgv.

Differential Revision: https://phabricator.services.mozilla.com/D108899
2021-03-24 23:24:34 +00:00
Agi Sferro 34624a6abf Bug 1567341 - Allow geckoview.test to run xpcshell. r=esawin
This commit adds a new command line option |-xpcshell| that, when passed, will
run an xpcshell instead of launching a full Gecko instance.

This command line option is restricted to org.mozilla.geckoview.test for now,
as it's really hard to use and not really a usecase outside mozilla. We can
revisit this if there's interest.

Differential Revision: https://phabricator.services.mozilla.com/D106211
2021-03-24 21:49:38 +00:00
Alexandru Michis 497409d76e Backed out 24 changesets (bug 1567341) for causing xpcshell failures in test_telemetry.js
CLOSED TREE

Backed out changeset deb795c7d0ed (bug 1567341)
Backed out changeset 62d24a3e5e33 (bug 1567341)
Backed out changeset 1185cabd94e0 (bug 1567341)
Backed out changeset 73a4ae419261 (bug 1567341)
Backed out changeset b6eb111329f3 (bug 1567341)
Backed out changeset 0dc0bfedc042 (bug 1567341)
Backed out changeset 9dca635e41d7 (bug 1567341)
Backed out changeset c34928580933 (bug 1567341)
Backed out changeset f9ba384bb407 (bug 1567341)
Backed out changeset ec25c2df380e (bug 1567341)
Backed out changeset 9e8ea542b51e (bug 1567341)
Backed out changeset 3dc62863a028 (bug 1567341)
Backed out changeset 6c104f865540 (bug 1567341)
Backed out changeset c422ca4207ea (bug 1567341)
Backed out changeset e3df748ed62f (bug 1567341)
Backed out changeset 9d1f27796a97 (bug 1567341)
Backed out changeset 1d93ba23f809 (bug 1567341)
Backed out changeset 55652f6af6ed (bug 1567341)
Backed out changeset 9fb892955a88 (bug 1567341)
Backed out changeset 1cdd95c43416 (bug 1567341)
Backed out changeset 5a839d5e3e33 (bug 1567341)
Backed out changeset ea84b5749a27 (bug 1567341)
Backed out changeset dcb1ae146475 (bug 1567341)
Backed out changeset d72accc274ac (bug 1567341)
2021-03-24 23:37:43 +02:00
Adam Gashlin 6b6c4da4b5 Bug 1696772 - Don't use FILE_FLAG_DELETE_ON_CLOSE for multi-instance locks. r=nalexander,application-update-reviewers.
FILE_FLAG_DELETE_ON_CLOSE had the wrong semantics, rendering the lock
file unusable after it had been closed once.

Delete the lock file in the uninstaller as a simple alternative (given that
the lock file is not in a temporary location on Windows).

For a test I returned to the older form of
test_backgroundtask_update_sync_manager which initially exposed the issue:
It expects the background task to be able to detect the xpcshell instance
after running resetLock, which failed before this fix.
I also extended the original updateSyncManager test to run the second
copy twice, which also catches the issue.

Differential Revision: https://phabricator.services.mozilla.com/D109565
2021-03-24 20:36:06 +00:00
Agi Sferro 5256b36255 Bug 1567341 - Allow geckoview.test to run xpcshell. r=esawin
This commit adds a new command line option |-xpcshell| that, when passed, will
run an xpcshell instead of launching a full Gecko instance.

This command line option is restricted to org.mozilla.geckoview.test for now,
as it's really hard to use and not really a usecase outside mozilla. We can
revisit this if there's interest.

Differential Revision: https://phabricator.services.mozilla.com/D106211
2021-03-24 20:20:01 +00:00
Emilio Cobos Álvarez 22061e8965 Bug 1697053 - Let non-native-theme ride the trains in Firefox 89. r=cpeterson,mstange
Differential Revision: https://phabricator.services.mozilla.com/D109555
2021-03-24 19:11:05 +00:00
Simon Giesecke cc730d05dd Bug 1184468 - Use nsTHashtable::Keys where possible. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108588
2021-03-24 17:56:50 +00:00
Simon Giesecke 613e20d136 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Markus Stange 53bed1aa5d Bug 1699792 - Split off the inner parts of nsStandaloneNativeMenu into a new class called NativeMenuMac. r=harry
NativeMenuMac implements a new mozilla::widget::NativeMenu interface.
This interface is intended to be used by cross-platform C++ code.

nsStandaloneNativeMenu is now only used to implement the IDL interface (which
is used from JavaScript code), and C++ code can use NativeMenu with its more
ergonomic C++ interface.

Differential Revision: https://phabricator.services.mozilla.com/D109173
2021-03-23 13:40:32 +00:00
Markus Stange 5caa594efa Bug 1699792 - Remove nativeData IDL property and use the NativeNSMenu() C++ method instead. r=harry
Depends on D109022

Differential Revision: https://phabricator.services.mozilla.com/D109113
2021-03-23 13:40:24 +00:00
Florian Quèze abe02307ff Bug 1699683 - Uninitialize the IOInterposer at content process shutdown, r=gerald,aklotz.
Differential Revision: https://phabricator.services.mozilla.com/D109162
2021-03-23 09:39:10 +00:00
Florian Quèze 8ad1e5d0aa Bug 1699742 - Remove MOZ_GECKO_PROFILER ifdefs that are no longer needed, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D109078
2021-03-22 16:29:52 +00:00
Magnus Melin dd8a698fe9 Bug 1694008 - add null check for getting nsIPK11TokenDB service (to prevent crash). r=kaie,sg DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D109055
2021-03-19 13:21:58 +00:00
Simon Giesecke b9621d6376 Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
Kris Maglione 0d92b293c4 Bug 1697055: Enable non-native-theming for all users enrolled in the Fission experiment. r=nika,emilio
Differential Revision: https://phabricator.services.mozilla.com/D108253
2021-03-15 20:33:31 +00:00
Dave Townsend a42baa368d Bug 1443703: Increase the timeout on test_launch_without_hang.js. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D108488
2021-03-15 18:06:06 +00:00
Agi Sferro 0ae24ebfa4 Bug 1697503 - Remove GeckoAppShell.KillAnyZombies. r=mossop,droeh
Before this patch, when the profile is locked on Android, we would call "ps",
parse the human-readable output and kill any other Gecko process that we could
find.

But this is completely unnecessary, as we know exactly that the PID of the
process holding the lock is.

In this patch we just kill the process holding the lock since this is
equivalent to the previous behavior.

Differential Revision: https://phabricator.services.mozilla.com/D106186
2021-03-15 17:04:41 +00:00
Oleg Strikov 2196428b79 Bug 1696498 - Fix startup notifications on Linux by removing excessive GDK call which triggers a bug in GTK <= 3.24.7. r=stransky
Backend procedure gdk_{x11,wayland}_display_make_default() gets called twice by XREMain::XRE_mainStartup(). First time it gets called indirectly after a call to gdk_display_open() because GDK automatically chooses first opened display as default display and calls gdk_{x11,wayland}_display_make_default() accordingly. Second time it gets called directly as a backend for an excessive call to gdk_display_manager_set_default_display(). Two consecutive calls to gdk_{x11,wayland}_display_make_default() trigger a bug in GTK <= 3.24.7 which causes content of DESKTOP_STARTUP_ID environment variable to get lost (GTK Bug 790963). In the absence of this information, startup notification can't be properly sent back to the environment when GTK later displays the main window.

Differential Revision: https://phabricator.services.mozilla.com/D108314
2021-03-15 11:29:26 +00:00
Andrew Osmond 1c682d57a9 Bug 1697195 - Force enable Software WebRender if Fission and experiment are enabled. r=jrmuizel
Fission without WebRender is an unsupported configuration and enrolls
users based on their compositor. However because of our own rollout of
WebRender, a user might start in early beta with WebRender and lose it
in late beta, while they remain enrolled in the Fission experiment.
Also, a user could lose WebRender because of crashes or device reset,
and we may fall back to Basic.

This patch forces Software WebRender as available (but does not override
Hardware WebRender) if Fission is enabled for users enrolled in the
Fission experiment. It also prevents fallback to Basic layers when
disabling acceleration due to crashes and runtime errors, so the user
will be stuck with Software WebRender at a minimum. It also enables
Software WebRender for Windows popups with transparency.

Differential Revision: https://phabricator.services.mozilla.com/D107661
2021-03-12 15:52:40 +00:00
Jan Alexander Steffens (heftig) 4920407bb3 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-11 14:32:53 +00:00
Simon Giesecke fac74ba9be Bug 1696350 - Remove redundant nullptr checks of return value of infallible new in toolkit/xre. r=mossop,application-update-reviewers,bytesized
Depends on D107181

Differential Revision: https://phabricator.services.mozilla.com/D107182
2021-03-10 21:08:55 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Narcis Beleuzu 198358fc15 Backed out changeset a4f4f640eaa7 (bug 1696845) for bustages on pangofc-fontmap.h 2021-03-10 04:49:51 +02:00
Jan Alexander Steffens (heftig) 1261a74d17 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-09 22:55:47 +00:00
Nick Alexander ca22dc040c Bug 1695797 - In background task mode, only process updates if we're the sole instance running. r=mhowell,application-update-reviewers,dthayer,bytesized
This commit does three main things:

1) It allows to configure the global singleton `nsUpdateSyncManager`
with an `nsIFile` rather than having it use the ambient XPCOM
directory service.  This allows to initialize the
`nsUpdateSyncManager` very early: before processing updates and long
before XPCOM is initialized.  This in turn allows us to determine if
other instances early enough to skip processing updates when
appropriate.

When this initialization path is followed, i.e., in Firefox but not
`xpcshell`, the `xpcom-startup` notification will be received but no
action taken, since the singleton will already exist.

There is a classic time-of-check, time-of-use race window in this
implementation: an instance may be launched immediately after we check
for other instances.  In practice this will result in behaviour that
is alreay possible: two independent instances both processing updates.
It is expected that the updater itself will exclude one of the
instances using its existing mutex.

2) It updates an existing background task test to use an explicit
`nsIFile` rather than the existing directory service method.  This
exercises the newer API.  There are other tests that might benefit,
but there's no harm in remaining with the previous approach, since
both are required.

3) It adds a new background task test to verify that update processing
is skipped if we're not the sole instance running.

Differential Revision: https://phabricator.services.mozilla.com/D106994
2021-03-06 05:40:39 +00:00
Nick Alexander cd0479a7ee 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-03-06 05:39:32 +00:00
Brindusan Cristian 02901b3451 Backed out changeset 8a6f82dc06a9 (bug 1695797) for xpcshell failures in test_backgroundtask_update_sync_manager.js. CLOSED TREE 2021-03-05 00:40:39 +02:00
Nick Alexander 531f788e24 Bug 1695797 - In background task mode, only process updates if we're the sole instance running. r=mhowell,application-update-reviewers,dthayer,bytesized
This commit does three main things:

1) It allows to configure the global singleton `nsUpdateSyncManager`
    with an `nsIFile` rather than having it use the ambient XPCOM
    directory service.  This allows to initialize the
    `nsUpdateSyncManager` very early: before processing updates and long
    before XPCOM is initialized.  This in turn allows us to determine if
    other instances early enough to skip processing updates when
    appropriate.

    When this initialization path is followed, i.e., in Firefox but not
    `xpcshell`, the `xpcom-startup` notification will be received but no
    action taken, since the singleton will already exist.

    There is a classic time-of-check, time-of-use race window in this
    implementation: an instance may be launched immediately after we check
    for other instances.  In practice this will result in behaviour that
    is alreay possible: two independent instances both processing updates.
    It is expected that the updater itself will exclude one of the
    instances using its existing mutex.

    To avoid the race, we could take the exclusive multi-instance lock
    ourselves, but that is strictly more complicated.

2) It updates an existing background task test to use an explicit
    `nsIFile` rather than the existing directory service method.  This
    exercises the newer API.  There are other tests that might benefit,
    but there's no harm in remaining with the previous approach, since
    both are required.

3) It adds a new background task test to verify that update processing
    is skipped if we're not the sole instance running.

Differential Revision: https://phabricator.services.mozilla.com/D106994
2021-03-04 17:30:16 +00:00
Nick Alexander 9ae4c9ba03 Bug 1120863 - Do not process updates when launching devtools. r=mhowell,ochameau
This implements the simple approach advocated for in
https://bugzilla.mozilla.org/show_bug.cgi?id=1120863#c26.

It's not easy to lift the duplicated chrome document URL to a shared
location, so we instead annotate both locations.

I've provided an environment variable that will allow a process that did
not itself process updates to witness that fact and used it to add a test.

Differential Revision: https://phabricator.services.mozilla.com/D106993
2021-03-04 03:39:43 +00:00
Florian Quèze b41e171c11 Bug 1694462 - Remove the nsIThreadManager.newThread API (newNamedThread should be used instead), r=bas,KrisWright.
Differential Revision: https://phabricator.services.mozilla.com/D106267
2021-03-02 22:34:51 +00:00
Robert Mader f1206ef5d7 Bug 1695453 - Rename IsWaylandDisabled to IsWaylandEnabled, r=stransky
Inversed logic has been proven to be more difficult to read,
so use the simple positive variant.

Also add a simple sanity check for `WAYLAND_DISPLAY` so if people
set `MOZ_ENABLE_WAYLAND` in a X11 session don't get undesired behavior.

While on it, change a check for `XDG_SESSION_TYPE` to also use
`WAYLAND_DISPLAY`, improving behavior when launching FF from a TTY
or a TTY-launched session (e.g. via `weston-launch`).

`WAYLAND_DISPLAY` and `DISPLAY` are not expected to be set if
no Wayland or X11 server is available, so using them makes us behave
more predictable.

Differential Revision: https://phabricator.services.mozilla.com/D106726
2021-03-02 14:25:20 +00:00
Geoff Lankow 04d475db99 Bug 1559448 - Move Thunderbird primary password prompt earlier in start-up. r=kaie,xpcom-reviewers,mccr8 DONTBUILD
Triggering the password prompt after the Add-Ons Manager start-up is causing the latter to fail.

I'm not sure if something needs to be unlocked by the password, or if the existence of the prompt is causing some bad interaction, but prompting slightly earlier appears to fix it.

Differential Revision: https://phabricator.services.mozilla.com/D106382
2021-03-02 13:30:09 +00:00
Olli Pettay 9a5e1b83eb Bug 1689601, hide fission.bfcacheInParent pref access behind a function which checks that also SHIP is enabled, r=peterv,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106562
2021-03-02 12:13:21 +00:00
Mihai Alexandru Michis 87f481bf9a Backed out 16 changesets (bug 1689601) for causing cpp bustages in nsFrameLoader.
CLOSED TREE

Backed out changeset 6e5523a7210d (bug 1689601)
Backed out changeset 745eaa468c74 (bug 1689601)
Backed out changeset a594bd02b8b6 (bug 1689601)
Backed out changeset 0c5fe977ced6 (bug 1689601)
Backed out changeset 2fca23521891 (bug 1689601)
Backed out changeset 334aeb627855 (bug 1689601)
Backed out changeset 2b2081a15d67 (bug 1689601)
Backed out changeset 307bde43cc96 (bug 1689601)
Backed out changeset 04aadec67ce2 (bug 1689601)
Backed out changeset 701eccb34772 (bug 1689601)
Backed out changeset 278db692aa8b (bug 1689601)
Backed out changeset c261c243a64d (bug 1689601)
Backed out changeset 7e8022e5696a (bug 1689601)
Backed out changeset 6138bfc6c08d (bug 1689601)
Backed out changeset 63295b3a62d0 (bug 1689601)
Backed out changeset 6d02e59ddc51 (bug 1689601)
2021-03-02 13:15:10 +02:00
Olli Pettay f09a7f25d5 Bug 1689601, hide fission.bfcacheInParent pref access behind a function which checks that also SHIP is enabled, r=peterv,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106562
2021-03-02 09:44:14 +00:00
Horst cea781ffd0 Bug 1694973 - Fix compile error when using --disable-printing" r=Gijs,karlt
Differential Revision: https://phabricator.services.mozilla.com/D106493
2021-03-01 23:55:17 +00:00
Simon Giesecke 8ecfb38a41 Bug 1691913 - Remove uses of nsDataHashtable::GetValue. r=xpcom-reviewers,necko-reviewers,dragana,nika
GetValue is going to be removed in a subsequent patch. It is no longer needed,
because it can be replaced by functions already provided by nsBaseHashtable,
in particular Lookup and Contains.

Also, its name was confusing, since it specifically returns a pointer that
allows and is intended for modifying the entry within the hashtable, rather
than returning by-value. According to the naming rules to be set on
nsBaseHashtable, it would also needed to be renamed to "Lookup*. Removing
its uses saves this effort.

Differential Revision: https://phabricator.services.mozilla.com/D105476
2021-03-01 09:59:30 +00:00
Jens Stutte 1e19379853 Bug 1689953: Harmonize shutdown phase definitions across nsTerminator and AppShutdown r=dthayer,chutten
This patch wants to solve several quirks around the shutdown terminator.

 - Use the same shutdown phase definitions in AppShutdown and nsTerminator. This touches quite a few files.
 - Ensure that the terminator phase shift is handled before any shutdown observer notifications are sent and reduce its heartbeat duration.
 - Add missing phases to the shutdown telemetry.

Please note that this changes the unit of "tick" to 100ms rather than 1s.
As a side effect, we also remove the obsolete "shutdown-persist" context.

While the existing test coverage continues to prove the most important functions, we acknowledge the wish for better test coverage with [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1693966 | bug 1693966 ]].

Differential Revision: https://phabricator.services.mozilla.com/D103626
2021-02-27 14:38:14 +00:00
Butkovits Atila bb3fe218a4 Backed out changeset be43a81b35f9 (bug 1689953) for causing failure at test_terminator_record.js. CLOSED TREE 2021-02-27 05:03:11 +02:00
Jens Stutte f6d52040b9 Bug 1689953: Harmonize shutdown phase definitions across nsTerminator and AppShutdown r=dthayer,chutten
This patch wants to solve several quirks around the shutdown terminator.

 - Use the same shutdown phase definitions in AppShutdown and nsTerminator. This touches quite a few files.
 - Ensure that the terminator phase shift is handled before any shutdown observer notifications are sent and reduce its heartbeat duration.
 - Add missing phases to the shutdown telemetry.

Please note that this changes the unit of "tick" to 100ms rather than 1s.
As a side effect, we also remove the obsolete "shutdown-persist" context.

While the existing test coverage continues to prove the most important functions, we acknowledge the wish for better test coverage with [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1693966 | bug 1693966 ]].

Differential Revision: https://phabricator.services.mozilla.com/D103626
2021-02-26 21:33:29 +00:00
Simon Giesecke 9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke 4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Adam Gashlin 37c29fd026 Bug 1685213 - Part 1: Save and access the startup shortcut. r=bytesized
A. The shell provides the startup shortcut in STARTUPINFOW when it
starts a process. If the launcher process runs, we must pass this along
to the real process being created.

B. lpTitle can be overwritten, in particular when the AUMID is set for
WinTaskbar, so save it in XREMain::XRE_mainStartup() in order to access
it later.

C. Add an accessor for the saved shortcut.

Differential Revision: https://phabricator.services.mozilla.com/D106343
2021-02-25 23:15:46 +00:00
Aaron Klotz 004362bf3e Bug 1690384: Propagate error information up through XPCOMGlueLoad and GetBootstrap; r=glandium
We know that some GV installations (particularly but not exlcusively Focus) are
failing to load `libxul.so` during early Gecko bootstrapping. Unfortunately
a boolean pass/fail result is not giving us sufficient information to be able to
properly troubleshoot this problem.

This patch adds `mozilla::Result`-based return values to `XPCOMGlueLoad` and
`GetBootstrap` in an effort to produce more actionable information about these
failures.

We include either a `nsresult` or, if the failure is rooted in a dynamic linker
failure, appropriate platform-specific error information:

* On Unix-based platforms, a `UniqueFreePtr<char>` containing the string from `dlerror(3)`;
* On Windows, the Win32 `DWORD` error code from `GetLastError()`.

For non-Android platforms, I updated them to handle the new return type, but
otherwise did not make any further changes.

For Android, we include the error information in the message string that we pass
into the Java `Exception` that is subsequently thrown.

Differential Revision: https://phabricator.services.mozilla.com/D104263
2021-02-23 23:25:22 +00:00
Simon Giesecke d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Alexis Beingessner 07f2f659c6 Bug 1686616 - make StringBundle use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105531
2021-02-18 13:26:32 +00:00
Paul Bone db676a95a2 Bug 1692851 - Use exec to launch firefox when switching profiles r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105410
2021-02-17 23:38:56 +00:00