Commit Graph

738 Commits

Author SHA1 Message Date
Butkovits Atila
15b1a753aa Backed out changeset 9d9fe1cd50ec (bug 1930292) for causing Win11 visual regressions. CLOSED TREE 2024-11-21 13:12:06 +02:00
Emilio Cobos Álvarez
d9ccc58f47 Bug 1931778 - Remove unnecessary condition in PreXULSkeletonUI. r=win-reviewers,rkraesig
We always have Dwm{Get,Set}WindowAttribute because we fail if we can't
load them.

This in practice means that we release the DC and uncloak the window a
bit later (due to the MakeScopeExits), but I think that's fine.

Differential Revision: https://phabricator.services.mozilla.com/D229267
2024-11-18 16:06:14 +00:00
Emilio Cobos Álvarez
5636c4fe4f Bug 1930292 - Stop setting non-zero chromemargin values. r=win-reviewers,handyman
These only do something on Windows, and after windows 7 they are not
useful at all.

If this has no fallout I plan to simplify the code further in a
follow-up (we can basically make this a boolean attribute again or so).

Differential Revision: https://phabricator.services.mozilla.com/D228528
2024-11-16 13:54:37 +00:00
Sandor Molnar
626d6033c9 Backed out changeset 1893713e1d17 (bug 1930292) for causing bc failures @ browser_findbar_marks.js CLOSED TREE 2024-11-16 07:03:50 +02:00
Emilio Cobos Álvarez
a4e7093fda Bug 1930292 - Stop setting non-zero chromemargin values. r=win-reviewers,handyman
These only do something on Windows, and after windows 7 they are not
useful at all.

If this has no fallout I plan to simplify the code further in a
follow-up (we can basically make this a boolean attribute again or so).

Differential Revision: https://phabricator.services.mozilla.com/D228528
2024-11-16 01:48:48 +00:00
Emilio Cobos Álvarez
1c3509dcfd Bug 1930284 - Also clean-up toolbar color variables. r=desktop-theme-reviewers,dao
Unlike the previous patch this does change behavior, but I think it's
fine.

The reason we used the non-lwt toolbar colors for customize mode is to
guarantee full opacity, see bug 1762379 and bug 1765685.

However, we need to do the same on the sidebar, and there we chose a
more theme-friendly way of doing that, which allows this simplification.

So do that instead.

Differential Revision: https://phabricator.services.mozilla.com/D228523
2024-11-11 11:10:42 +00:00
serge-sans-paille
8a0a0f7524 Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
serge-sans-paille
e54774d573 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Gijs Kruitbosch
97505cbd7c Bug 1925577 - make skeleton UI not draw the tabstrip if it's disabled by vertical tabs, r=dthayer
This doesn't take on the task of also drawing the sidebar, as gathering state for that
is a little more complex to do. Purely removing the flicker from the top of the window
(and potential user confusion about why there is a horizontal tab there) seems a
worthwhile improvement.

Differential Revision: https://phabricator.services.mozilla.com/D226822
2024-10-25 22:51:51 +00:00
Alexandru Marc
191ccbe7fe Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
53068cdf31 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
83543f20f2 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
c7a369b29a Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Vincent Hilla
91ed10a971 Bug 868874 - Remove Decimal::toString(char*, size_t). r=jwatt,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D216041
2024-10-22 13:21:56 +00:00
Yannis Juglaret
072d3d69de Bug 1839299 - Use a finer-grained strategy to protect RtlLookupFunctionEntry against deadlocks. r=win-reviewers,rkraesig
On 64-bit Windows (x86_64, aarch64), stack walking relies on
RtlLookupFunctionEntry to navigate from one frame to the next. This
function acquires up to two ntdll internal locks when it is called.

The profiler and the background hang monitor both need to walk the
stacks of suspended threads. This can lead to deadlock situations,
which so far we have avoided with stack walk suppressions. We guard some
critical paths to mark them as suppressing stack walk, and we forbid
stack walking when any thread is currently on such path.

While stack walk suppression has helped remove most deadlock situations,
some can remain because it is hard to detect and manually annotate all
the paths that could lead to a deadlock situation. Another drawback is
that stack walk suppression disables stack walking for much larger
portions of code than required. For example, we disable stack walking
for LdrLoadDll, so we cannot collect stacks while we are loading a DLL.
Yet, the lock that could lead to a deadlock situation is only held
during a very small portion of the whole time spent in LdrLoadDll.

This patch addresses these two issues by implementing a finer-grained
strategy to avoid deadlock situations. We acquire the pointers to the
internel ntdll locks through a single-stepped execution of
RtlLookupFunctionEntry. This allows us to try to acquire the locks
non-blockingly so that we can guarantee safe stack walking with no
deadlock.

If we fail to collect pointers to the locks, we fall back to using stack
walk suppressions like before. This way we get the best of both worlds:
if we are confident that the situation is under control, we will use the
new strategy and get better profiler accuracy and no deadlock; in case
of doubt, we can still use the profiler thanks to stack walk
suppressions.

Differential Revision: https://phabricator.services.mozilla.com/D223498
2024-10-17 13:47:04 +00:00
Adi
70758f017d Backed out changeset e6475b7e0602 (bug 1839299) for causing instrumented build bustages. 2024-10-17 14:55:27 +03:00
Yannis Juglaret
ebdc900582 Bug 1839299 - Use a finer-grained strategy to protect RtlLookupFunctionEntry against deadlocks. r=win-reviewers,rkraesig
On 64-bit Windows (x86_64, aarch64), stack walking relies on
RtlLookupFunctionEntry to navigate from one frame to the next. This
function acquires up to two ntdll internal locks when it is called.

The profiler and the background hang monitor both need to walk the
stacks of suspended threads. This can lead to deadlock situations,
which so far we have avoided with stack walk suppressions. We guard some
critical paths to mark them as suppressing stack walk, and we forbid
stack walking when any thread is currently on such path.

While stack walk suppression has helped remove most deadlock situations,
some can remain because it is hard to detect and manually annotate all
the paths that could lead to a deadlock situation. Another drawback is
that stack walk suppression disables stack walking for much larger
portions of code than required. For example, we disable stack walking
for LdrLoadDll, so we cannot collect stacks while we are loading a DLL.
Yet, the lock that could lead to a deadlock situation is only held
during a very small portion of the whole time spent in LdrLoadDll.

This patch addresses these two issues by implementing a finer-grained
strategy to avoid deadlock situations. We acquire the pointers to the
internel ntdll locks through a single-stepped execution of
RtlLookupFunctionEntry. This allows us to try to acquire the locks
non-blockingly so that we can guarantee safe stack walking with no
deadlock.

If we fail to collect pointers to the locks, we fall back to using stack
walk suppressions like before. This way we get the best of both worlds:
if we are confident that the situation is under control, we will use the
new strategy and get better profiler accuracy and no deadlock; in case
of doubt, we can still use the profiler thanks to stack walk
suppressions.

Differential Revision: https://phabricator.services.mozilla.com/D223498
2024-10-17 09:43:15 +00:00
Emilio Cobos Álvarez
ed43bbbbb0 Bug 1922250 - Align skeleton ui with nsWindow more closely. r=win-reviewers,rkraesig
This maps better to the code we have in nsWindow, and fixes a couple
bugs which caused maximized skeleton UI-consuming windows to be
mispositioned with the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D225100
2024-10-14 10:55:25 +00:00
Noemi Erli
ffa33e3898 Backed out 3 changesets (bug 1922250) for causing failures in browser_1446343-windowsize.js CLOSED TREE
Backed out changeset f4e18a092cba (bug 1922250)
Backed out changeset 9af0852c057c (bug 1922250)
Backed out changeset c7ebee651e07 (bug 1922250)
2024-10-12 07:48:39 +03:00
Emilio Cobos Álvarez
ffb08d883e Bug 1922250 - Align skeleton ui with nsWindow more closely. r=win-reviewers,rkraesig
This maps better to the code we have in nsWindow, and fixes a couple
bugs which caused maximized skeleton UI-consuming windows to be
mispositioned with the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D225100
2024-10-11 08:37:23 +00:00
Tamas Szentpeteri
8be45dd280 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
069a97307f Bug 1920718 - Annotate all global variable with runtime initialization as MOZ_RUNINIT r=application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-08 16:49:51 +00:00
Paul Adenot
da6e72dc6c Bug 1921288 - Add a way to get the associated duration type from TimeStamp and AwakeTimeStamp. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D223792
2024-10-03 08:54:11 +00:00
Paul Adenot
78ab790d8f Bug 1921288 - Add some arithmetic and conversion functions to AwakeTimeStamp. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D223791
2024-10-03 08:54:11 +00:00
Paul Adenot
3c42e9a3bc Bug 1921288 - Teach AwakeTimeStamp to do precise timestamps on Windows, rename methods. r=gsvelto
This uses a function that has been introduced in Windows 10.

Differential Revision: https://phabricator.services.mozilla.com/D223790
2024-10-03 08:54:11 +00:00
Sandor Molnar
2557cd3d7d Backed out 6 changesets (bug 1921288) for causing build bustages. CLOSED TREE
Backed out changeset c03d69e623b9 (bug 1921288)
Backed out changeset 111bef5016a9 (bug 1921288)
Backed out changeset 17130f51de88 (bug 1921288)
Backed out changeset a4acd335a710 (bug 1921288)
Backed out changeset c5fc8bc8273a (bug 1921288)
Backed out changeset 744f7a82c471 (bug 1921288)
2024-10-02 21:11:06 +03:00
Paul Adenot
3043e0394d Bug 1921288 - Fix bustage, QueryUnbiasedInterruptTimePrecise return value is void
Differential Revision: https://phabricator.services.mozilla.com/D224359
2024-10-02 16:45:10 +00:00
Paul Adenot
e3c35ceb52 Bug 1921288 - Add a way to get the associated duration type from TimeStamp and AwakeTimeStamp. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D223792
2024-10-02 16:01:04 +00:00
Paul Adenot
badc695bfb Bug 1921288 - Add some arithmetic and conversion functions to AwakeTimeStamp. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D223791
2024-10-02 16:01:03 +00:00
Paul Adenot
72a3c75971 Bug 1921288 - Teach AwakeTimeStamp to do precise timestamps on Windows, rename methods. r=gsvelto
This uses a function that has been introduced in Windows 10.

Differential Revision: https://phabricator.services.mozilla.com/D223790
2024-10-02 16:01:03 +00:00
Florian Quèze
757717524a Bug 1915228 - Remove expired telemetry scalar startup.skeleton_ui_disabled_reason, r=win-reviewers,TravisLong,gstoll.
Depends on D220334

Differential Revision: https://phabricator.services.mozilla.com/D220335
2024-08-28 19:44:36 +00:00
Matthew Gaudet
efe3f4bd3e Bug 1904429 - Extract some core logging types into their own header file r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D217873
2024-08-23 15:52:45 +00:00
Iulian Moraru
8cff16a948 Backed out 5 changesets (bug 1904429) for causing ThreadSanitizer linux tsan failures.
Backed out changeset 787f23230ebd (bug 1904429)
Backed out changeset 81e85421af01 (bug 1904429)
Backed out changeset 9bf9011b0736 (bug 1904429)
Backed out changeset a59511524bc7 (bug 1904429)
Backed out changeset e74a80333551 (bug 1904429)
2024-08-22 23:57:12 +03:00
Matthew Gaudet
6e50ad8063 Bug 1904429 - Extract some core logging types into their own header file r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D217873
2024-08-22 17:05:59 +00:00
Nika Layzell
d0b6b794db Bug 1908725 - Part 5: Add additional validation for early-startup command line checks, r=ipc-reviewers,mccr8
This patch adjusts the various places where we initialize content
processes to call SetGeckoProcessType as early as possible, and be more
consistent. After this change we should only ever set GeckoProcessType
and GeckoChildID once per-process (with the exception of the fork server
process).

In addition to this validation, some more checks around the fork server
were added, such as to prevent forking another forkserver, or forking a
non-content process.

As part of this change, there was some refactoring/cleanup done, such as
removing plugin-container.cpp and content_process_main, as compared to
the other duplicated code between the two call-sites, the duplication
was relatively small, and inlining it helped make things more readable.

Differential Revision: https://phabricator.services.mozilla.com/D218471
2024-08-07 20:39:41 +00:00
Nika Layzell
bdb401316d Bug 1908725 - Part 2: Make the ChildID available in the same places as OtherPid, r=ipc-reviewers,media-playback-reviewers,win-reviewers,alwu,rkraesig,gfx-reviewers,mccr8,nical
This requires quite a bit of piping to get the ChildID passed everywhere where
we currently pass the pid in IPC. This is done by adding a new struct type
(EndpointProcInfo), which is passed around instead of OtherPid in these places,
and contains the full pid.

In most cases, it was a fairly painless change to move over, however in some
cases, more complex changes were required, as the pid was being stored
previously in something like an Atomic<...>, and needed to be switched to using
a mutex-protected value.

In the future, it may be possible to remove OtherPid from IPDL actors once
everything is migrated to ChildID, but we're still a long way off from that, so
for now we unfortunately need to pass both around.

Differential Revision: https://phabricator.services.mozilla.com/D217118
2024-08-07 20:39:39 +00:00
Nika Layzell
008c780b6b Bug 1908725 - Part 1: Introduce GeckoChildID, r=glandium,ipc-reviewers,mccr8
The new GeckoChildID type introduced in this patch is inspired by the existing
ContentParentID type used by ContentParent, but is currently distinct. It is
supported by all process types at the GeckoChildProcessHost level and can be
read for the current process from anywhere.

As this type is similar in many ways to the process type, and should be
available as early as possible within child processes, this was added alongside
the GeckoProcessType value within mozglue to make that easier to do.

The type was chosen to be an int32_t to make it feel similar to a PID, which we
currently use for process identity comparisons across the codebase. The
intention is for GeckoChildID to be preferred for these within-gecko checks, as
these IDs will not be re-used and can be known earlier during child process
creation.

Differential Revision: https://phabricator.services.mozilla.com/D217117
2024-08-07 20:39:39 +00:00
Sylvestre Ledru
45030f6970 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Ray Kraesig
ae1ea1e8fc Bug 1903452 - [1/2] Correct coordinate conversion when cloaking and clearing window r=emilio
The previous patchset failed to properly convert the RECT to be cleared
from screen- to window-coordinates. (This wasn't noticed because the two
only differ when nontrivial chrome such as the titlebar is present,
which by default it's not.)

Differential Revision: https://phabricator.services.mozilla.com/D214334
2024-06-25 18:19:42 +00:00
Ray Kraesig
799ee37eab Bug 1824053 - [4/4] cloak and clear new window before showing it r=win-reviewers,handyman
When creating the skeleton UI window, cloak and clear it to a theme-
appropriate color before first showing it, just as is done in nsWindow.

Differential Revision: https://phabricator.services.mozilla.com/D212764
2024-06-17 14:17:50 +00:00
Ray Kraesig
e0638bd860 Bug 1824053 - [3/4] DRY up skeleton-ui dynamic-resolution code r=glandium,win-reviewers,handyman
Cleanup prior to the addition of new code. No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D212763
2024-06-17 14:17:49 +00:00
Yannis Juglaret
99134cc647 Bug 1897479 - Filter instructions when collecting single-step data. r=rkraesig,win-reviewers
This patch introduces an aInstructionFilter argument to
CollectModuleSingleStepData to allow filtering which kind of
instructions should be recorded. We implement the All default filter and
the CallRet filter.

Differential Revision: https://phabricator.services.mozilla.com/D211196
2024-06-03 12:24:41 +00:00
Yannis Juglaret
adbf392846 Bug 1897479 - Abstract away single-step data collection for reusability. r=rkraesig,win-reviewers
This patch makes the single-step data collection code that we
implemented for bug 1571516 reusable, while preserving its behavior.
No functional changes, except for a slight reordering of the
error-result enum.

We define a generic CollectSingleStepData function that embeds the
magic for starting to trigger single step exceptions and for acting upon
them.

We define a more specialized CollectModuleSingleStepData function which
can be reused if the purpose of single step data collection is to
monitor what paths are taken within a specific module. It stores the
collected data in stack, so that it can be accessed from crash reports.

This code is considered unstable and thus only available in Nightly and
early Beta and only used on paths that are known to crash already.

Differential Revision: https://phabricator.services.mozilla.com/D211195
2024-06-03 12:24:41 +00:00
Patrycja Rosa
32e1cf70a0 Bug 1882329 - Make StackWalk Linux support check more specific r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D202862
2024-05-27 21:46:09 +00:00
serge-sans-paille
b9f78f0cc2 Bug 1883615 - Move libdl checks to moz.configure and make libdl dependencies explicit r=glandium
The -ldl flag was previously set globally, it's now set for the libs
that use it.

Also rationalize the difference between HAVE_DLOPEN and HAVE_DLFCN_H.

Differential Revision: https://phabricator.services.mozilla.com/D203594
2024-05-15 20:29:07 +00:00
Tamas Szentpeteri
22c92af506 Backed out 3 changesets (bug 1883720, bug 1883719, bug 1883615) for causing multiple failures. CLOSED TREE
Backed out changeset 495b9e84ba9d (bug 1883720)
Backed out changeset 5a89cbc54dd2 (bug 1883615)
Backed out changeset 9d075e352b0e (bug 1883719)
2024-05-15 13:30:17 +03:00
serge-sans-paille
863475a670 Bug 1883615 - Move libdl checks to moz.configure and make libdl dependencies explicit r=glandium
The -ldl flag was previously set globally, it's now set for the libs
that use it.

Also rationalize the difference between HAVE_DLOPEN and HAVE_DLFCN_H.

Differential Revision: https://phabricator.services.mozilla.com/D203594
2024-05-15 07:47:55 +00:00
Emilio Cobos Álvarez
50eb344091 Bug 1893532 - Improve error message of HTMLInputElement.stepUp/stepDown. r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D208671
2024-05-01 00:11:33 +00:00
Tamas Szentpeteri
a86fd1fb23 Backed out changeset 4309f75eaa90 (bug 1883615) for causing build bustages related to check_symbol_in_libs. CLOSED TREE 2024-04-17 12:57:02 +03:00
serge-sans-paille
78ac6a6ccf Bug 1883615 - Move libdl checks to moz.configure and make libdl dependencies explicit r=glandium
The -ldl flag was previously set globally, it's now set for the libs
that use it.

Also rationalize the difference between HAVE_DLOPEN and HAVE_DLFCN_H.

Differential Revision: https://phabricator.services.mozilla.com/D203594
2024-04-17 09:33:00 +00:00