Commit Graph

798 Commits

Author SHA1 Message Date
Fatih
524e3bb0df Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D220904
2024-09-09 21:57:17 +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
Christian Holler
d8e4526604 Bug 1875484 - Add missing null check in Hal code. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D199095
2024-01-22 18:56:18 +00:00
Olli Pettay
d69e4a8d4d Bug 1874454 - Implement GetHeterogeneousCpuInfo for Apple Silicon Mac, r=haik,mstange
Differential Revision: https://phabricator.services.mozilla.com/D198486
2024-01-15 12:23:33 +00:00
Stanca Serban
919d3130d2 Backed out changeset 0f0edda611cf (bug 1874454) for causing bp-nu bustages in CocoaHeterogeneousCpuInfo.cpp. CLOSED TREE 2024-01-15 07:43:58 +02:00
Olli Pettay
171a7a1ce3 Bug 1874454 - Implement GetHeterogeneousCpuInfo for Apple Silicon Mac, r=haik,mstange
Differential Revision: https://phabricator.services.mozilla.com/D198486
2024-01-14 20:04:21 +00:00
Sylvestre Ledru
ef35fa7374 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
clang-format version 17.0.6 (taskcluster-QueHFUviQeyM8Y7r_d7MQQ)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D195397
2023-12-04 10:09:36 +00:00
Andrew McCreight
285012cef5 Bug 1864522 - Remove unused functionality from ModifyWakeLock. r=gsvelto
- WakeLock is never registered as an observer, so remove its nsIObserver
  interface to eliminate a use of mContentParentID.

- mContentParentID is always CONTENT_PROCESS_ID_UNKNOWN, so propagate that
  through to hal::ModifyWakeLock().

- Compute the child ID on the receiver side of the ModifyWakeLock message,
  instead of passing it in the message. We always use the child ID of the
  ContentChild.

- Rename the old ModifyWakeLock into ModifyWakeLockWithChildID. Rename
  aProcessID to aChildID, because it is not a PID.

- Add a new hal::ModifyWakeLock for the parent process that uses
  CONTENT_PROCESS_ID_MAIN as the child id. This method is not actually called
  right now.

Differential Revision: https://phabricator.services.mozilla.com/D193577
2023-11-16 00:14:10 +00:00
Makoto Kato
36497ee57a Bug 1858843 - Remove pre-Lollipop code from C/C++. r=geckoview-reviewers,media-playback-reviewers,padenot,owlish,jnicol
Differential Revision: https://phabricator.services.mozilla.com/D191602
2023-11-09 17:39:59 +00:00
stransky
c576f61eb2 Bug 1859865 [Linux] Don't throw error message if DBus operation is canceled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192319
2023-11-06 10:39:10 +00:00
Cristian Tuns
94f23234fa Backed out changeset f65c77517e3e (bug 1859865) for causing build bustages in nsAppShell.cpp CLOSED TREE 2023-11-04 04:52:00 -04:00
stransky
624df138a4 Bug 1859865 [Linux] Don't throw error message if DBus operation is canceled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192319
2023-11-04 08:21:16 +00:00
Butkovits Atila
bf6ab69197 Backed out changeset 1c0f7ecac0da (bug 1859865) for causing bustages at MPRISServiceHandler.cpp. 2023-11-04 01:59:29 +02:00
stransky
ab9de8aaaa Bug 1859865 [Linux] Don't throw error message if DBus operation is canceled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192319
2023-11-03 21:13:16 +00:00
stransky
bb14a9b7df Bug 1858153 [Linux] Migrate UPowerClient from dbus-glib to GDBus r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190670
2023-10-12 11:16:25 +00:00
Jamie Nicol
938068b316 Bug 1850573 - Add HeterogeneousCpuInfo to HAL with Android implementation. r=geckoview-reviewers,owlish
This adds a function GetHeterogeneousCpuInfo() to HAL, which
classifies the processor cores in to "big", "medium", and
"little". This is currently only implemented on Android, where it
works by parsing the maximum CPU frequency from sysfs.

When all CPUs have the same frequency they are all classified as
"big", and when there are only 2 different frequencies they are
classified as "big" and "little". All CPUs with a frequency in-between
the lowest and highest are classified as "medium".

This information can be used to count the number of each cores in each
category, eg for determining appropriate thread pool sizes. Or to
determine the indices of cores in a certain category, eg for setting
CPU affinity for certain threads.

Differential Revision: https://phabricator.services.mozilla.com/D188478
2023-09-26 12:55:37 +00:00
Masatoshi Kimura
53a80005eb Bug 1852806 - Remove macros for older Windows SDK from hal/. r=gsvelto
Depends on D188023

Differential Revision: https://phabricator.services.mozilla.com/D188024
2023-09-15 03:19:27 +00:00
Cosmin Sabou
f8c16a8f94 Backed out 15 changesets (bug 1852806) for causing mda failures on test_video_low_power_telemetry.html. CLOSED TREE
Backed out changeset faea1f4cb9a9 (bug 1852806)
Backed out changeset 4db93c374f9b (bug 1852806)
Backed out changeset 7e40e0e04921 (bug 1852806)
Backed out changeset b0a66c4269ce (bug 1852806)
Backed out changeset 4ff3545936f9 (bug 1852806)
Backed out changeset 02c0a8eb3fd6 (bug 1852806)
Backed out changeset ae2c7b33acfb (bug 1852806)
Backed out changeset 2b89ba254a1a (bug 1852806)
Backed out changeset dfa4f73fc548 (bug 1852806)
Backed out changeset daffcc4c1877 (bug 1852806)
Backed out changeset 33855bcdf15e (bug 1852806)
Backed out changeset 694f29707f3e (bug 1852806)
Backed out changeset 1891eda22a59 (bug 1852806)
Backed out changeset 1b854941389c (bug 1852806)
Backed out changeset 2f7cfe04be59 (bug 1852806)
2023-09-15 09:48:27 +03:00
Masatoshi Kimura
91d8cd993a Bug 1852806 - Remove macros for older Windows SDK from hal/. r=gsvelto
Depends on D188023

Differential Revision: https://phabricator.services.mozilla.com/D188024
2023-09-15 03:19:27 +00:00
Mike Hommey
6bd62cf05f Bug 1851529 - Fixup comments in hal/cocoa/smslib.mm r=andi
Differential Revision: https://phabricator.services.mozilla.com/D187638
2023-09-07 04:50:46 +00:00
Logan Rosen
f024d94b2b Bug 1786490 - reformat the tree using black 23.3.0 r=sylvestre,webdriver-reviewers,taskgraph-reviewers,whimboo,jmaher,ahal,perftest-reviewers,geckoview-reviewers,afinder,m_kato
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D186092
2023-09-06 16:14:30 +00:00
Mike Hommey
9331b9fb07 Bug 1851529 - Set clang-format ColumnLimit consistently. r=sylvestre,necko-reviewers,kershaw
For some reason, its value in the Google style we use is 80... except
for Objective-C, where it's 100, which led to things like:
https://hg.mozilla.org/mozilla-central/rev/31bf68247e6e
https://hg.mozilla.org/mozilla-central/rev/64ceb33533a4.

There's probably a discussion to have about whether 80 is the right
limit, but since it's what's used for everything except ObjC, let's roll
with it.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D187409
2023-09-05 11:23:01 +00:00
Stanca Serban
17fb8bac17 Backed out changeset 50b448b2d902 (bug 1532281) for causing Linux build bustages. CLOSED TREE 2023-09-05 11:38:18 +03:00
stransky
60dc5e2272 Bug 1532281 [Linux] Don't build with dbus-glib r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D187208
2023-09-05 08:14:21 +00:00
stransky
73119cef95 Bug 1848589 [Linux] Don't query battery status on Linux as battery API is not used r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187200
2023-09-04 07:30:18 +00:00
Jamie Nicol
dd01b34191 Bug 1848766 - Add PerformanceHintManager implementation to HAL. r=smaug,emilio,geckoview-reviewers,owlish
PerformanceHintManager is an Android API that allows the caller to
create a PerformanceHintSession, representing a workload shared by a
group of threads that should be completed within a target duration
each cycle. The actual duration spent working is reported each cycle,
and the system can then adjust scheduling of the threads accordingly
in order to hit the target going forward.

This patch adds the API to HAL along with an Android
implementation (and a nop fallback implementation for other
platforms).

Differential Revision: https://phabricator.services.mozilla.com/D186238
2023-08-18 12:01:24 +00:00
Cristina Horotan
e2fc203923 Backed out 3 changesets (bug 1848766) for causing build bustage at AndroidPerformanceHintManager.cpp CLOSED TREE
Backed out changeset a645cf8f45e9 (bug 1848766)
Backed out changeset 065b16762c94 (bug 1848766)
Backed out changeset 4e1c2cc65d1c (bug 1848766)
2023-08-18 14:53:08 +03:00
Jamie Nicol
f5ac319074 Bug 1848766 - Add PerformanceHintManager implementation to HAL. r=smaug,emilio,geckoview-reviewers,owlish
PerformanceHintManager is an Android API that allows the caller to
create a PerformanceHintSession, representing a workload shared by a
group of threads that should be completed within a target duration
each cycle. The actual duration spent working is reported each cycle,
and the system can then adjust scheduling of the threads accordingly
in order to hit the target going forward.

This patch adds the API to HAL along with an Android
implementation (and a nop fallback implementation for other
platforms).

Differential Revision: https://phabricator.services.mozilla.com/D186238
2023-08-18 11:19:12 +00:00
Masatoshi Kimura
a5e6f6c1ab Bug 1844908 - Remove pre-Win10-specific codepath from hal/. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D184293
2023-07-26 08:52:51 +00:00
Natalia Csoregi
72a7b95555 Backed out 19 changesets (bug 1844908) for causing win bustage on AvailableMemoryTracker.cpp. CLOSED TREE
Backed out changeset 44c66f2233cf (bug 1844908)
Backed out changeset a8010ff534bf (bug 1844908)
Backed out changeset 225dc3aeb220 (bug 1844908)
Backed out changeset a1414db64e33 (bug 1844908)
Backed out changeset 7f1e0a527839 (bug 1844908)
Backed out changeset 6dc7646d1ffa (bug 1844908)
Backed out changeset 8d715131510f (bug 1844908)
Backed out changeset 4b6fe8a4e7db (bug 1844908)
Backed out changeset 2b419fabf1e8 (bug 1844908)
Backed out changeset af84e701d616 (bug 1844908)
Backed out changeset 2fa203969ec5 (bug 1844908)
Backed out changeset 2b3d2df94db3 (bug 1844908)
Backed out changeset 7eca452f5fd7 (bug 1844908)
Backed out changeset 3d961cf25afe (bug 1844908)
Backed out changeset 3c59143f8dd7 (bug 1844908)
Backed out changeset ab50c6c5425a (bug 1844908)
Backed out changeset b2c5636df673 (bug 1844908)
Backed out changeset e9a0f1c6760c (bug 1844908)
Backed out changeset 945ccbedde0b (bug 1844908)
2023-07-25 19:55:35 +03:00
Masatoshi Kimura
e352d05fb5 Bug 1844908 - Remove pre-Win10-specific codepath from hal/. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D184293
2023-07-25 14:41:01 +00:00
serge-sans-paille
e7244ea028 Bug 1828383 - Make hal/ buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D175596
2023-04-18 13:43:20 +00:00
Nika Layzell
f47e7d485e Bug 1607634 - Part 4b: Changes for not-nullable actor types being wrapped in NotNull, r=ipc-reviewers,necko-reviewers,mccr8
These are the code changes required by the IPDL changes in part 4a.

Differential Revision: https://phabricator.services.mozilla.com/D168887
2023-03-20 15:40:36 +00:00
Iulian Moraru
801dae8f2c Backed out 14 changesets (bug 1607634, bug 1814683, bug 1815177, bug 1814686) for causing build bustages on MaybeStorageBase. CLOSED TREE
Backed out changeset ae1c0551cea5 (bug 1815177)
Backed out changeset a11cafaa1884 (bug 1814686)
Backed out changeset 621507521762 (bug 1814686)
Backed out changeset ad692c73e381 (bug 1814686)
Backed out changeset 3be031e503dc (bug 1607634)
Backed out changeset aebbaa145d2d (bug 1607634)
Backed out changeset 9aa1f346fe14 (bug 1607634)
Backed out changeset e3eb77ad55ca (bug 1607634)
Backed out changeset e60591e5d5cf (bug 1607634)
Backed out changeset 6e43042d204a (bug 1814683)
Backed out changeset 1706e88652d6 (bug 1814683)
Backed out changeset 6878a1590e91 (bug 1814683)
Backed out changeset b1c980c834d8 (bug 1814683)
Backed out changeset 94480b82d102 (bug 1814683)
2023-03-15 01:58:36 +02:00
Nika Layzell
462fc4e4ee Bug 1607634 - Part 4b: Changes for not-nullable actor types being wrapped in NotNull, r=ipc-reviewers,necko-reviewers,mccr8
These are the code changes required by the IPDL changes in part 4a.

Differential Revision: https://phabricator.services.mozilla.com/D168887
2023-03-14 19:31:40 +00:00
Makoto Kato
a81830ccdb Bug 1812938 - Part 1. GetWidgetScreen returns Screen instead of nsIScreen. r=emilio,geckoview-reviewers,owlish
`nsIWidget` isn't scriptable, so it is unnecessary to return `nsIScreen` for
`GetWidgetScreen`.

Differential Revision: https://phabricator.services.mozilla.com/D168029
2023-02-06 04:51:26 +00:00
Andrew McCreight
6adeefb060 Bug 1808598, part 2 - Get rid of some unused nested declarations. r=ipc-reviewers,necko-reviewers,nika
None of the messages use these nested values.

Differential Revision: https://phabricator.services.mozilla.com/D167837
2023-01-30 15:41:15 +00:00
Emilio Cobos Álvarez
af31750cc0 Bug 1775062 - Fix various using statements to use properly qualified names. r=nika,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D167710
2023-01-25 10:52:10 +00:00
Makoto Kato
f3ee106f12 Bug 1750670 - Better support orientation.lock('natural'). r=geckoview-reviewers,calu
natural is defined as (from https://w3c.github.io/screen-orientation/#dfn-natural)

> A computer monitor are commonly naturally landscape-primary, while a mobile
> phones are commonly naturally portrait-primary.

But GeckoView sets `SCREEN_ORIENTATION_UNSPECIFIED` that is unlock orientation.

Like Blink, we should set landscape-primary or portrait-primary (depends on
current monitor).

Differential Revision: https://phabricator.services.mozilla.com/D164436
2022-12-14 03:42:45 +00:00
Makoto Kato
2e9e0c4641 Bug 1744687 - Part 3. Fix build error for newer Windows SDK. r=gsvelto
Now hal uses AR_STATE for screen orientation, so we should move it from
WinUtils.cpp to WinUtils.h for newer Windows 11 SDK.

Also, newer Windows SDK has to set WINVER to WIN8 to use auto rotation API.

Differential Revision: https://phabricator.services.mozilla.com/D163099
2022-11-25 15:13:43 +00:00
Makoto Kato
3dbf8deeb8 Bug 1744687 - Part 1. Lock orientation backend for Windows Tablet. r=gsvelto
Since Windows tablet mode has a orientation lock API, this patch
implements orientation lock backend for Windows tablet mode.

`GetAutoRotationState` API recognizes whether orientation API is supported on
the device. So this fix uses this API to check orientation API capability.

Differential Revision: https://phabricator.services.mozilla.com/D162451
2022-11-24 15:10:15 +00:00
Florian Queze
96cc120704 Bug 1800412 - Add a preference to control whether the EcoQoS is used for background content processes, r=gsvelto.
Differential Revision: https://phabricator.services.mozilla.com/D161975
2022-11-14 12:10:55 +00:00
Florian Queze
b443270e34 Bug 1796525 - Set the QoS of background content processes to 'eco', r=gsvelto.
Differential Revision: https://phabricator.services.mozilla.com/D159835
2022-10-20 13:32:52 +00:00
Gabriele Svelto
8b0f8edb2c Bug 1791531 - Do not assume that the battery listener has been registered correctly on macOS r=haik
Differential Revision: https://phabricator.services.mozilla.com/D157719
2022-09-22 09:29:42 +00:00
Gabriele Svelto
a203b827db Bug 1771712 - Make it more likely for child processes to be killed under OOM conditions compared to the parent process on Linux r=jld
This patch implements hal::SetProcessPriority() on Linux and leverages
it to make it more likely that the parent process and foreground tab
survive an OOM situation, letting Linux' OOM killer reap preallocated
processes and background tabs first when reclaiming memory.

This is achieved by setting the `oom_score_adj` values of said processes
such that they will be killed in this order:

* Preallocated processes will be the first to go, they don't contain
  user data and are not visible, so they're a good candidate to free up
  memory
* Background tabs will be killed next, we don't generate crash reports
  for thoes nor do we inform the user, we just reload the tab, so in
  most cases one being killed will only be a small annoyance
* Background tabs playing video come next, but only if they're not also
  playing or recording audio
* Finally foreground tabs will be killed as a last resort, background
  tabs playing audio or with an active WebRTC session are also
  considered to be in the foreground as the user will immediately notice
  if they crash

Note that this patch only implements the low-level plumbing. The process
priority manager has not been enabled on Linux yet so that needs to
happen before this actually works.

Differential Revision: https://phabricator.services.mozilla.com/D153466
2022-08-09 16:05:48 +00:00
Emilio Cobos Álvarez
42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
serge-sans-paille
88f47b8906 Bug 1775154 - Extra cleanup of dom/, extensions/, hal/, netwerk/ and storage/ includes r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D149806
2022-06-22 13:31:25 +00:00
Emilio Cobos Álvarez
b6782fe2d5 Bug 1767346 - Use browsing context activeness rather than renderLayers to determine process priority. r=mccr8,mconley,geckoview-reviewers,agi
For desktop this should basically have no impact (maybe impacts tab
warming, but if we wanted we could set the priority hint from the tab
switcher the same way we set renderLayers), but Fenix always has
renderLayers as true, effectively, so we were never de-prioritizing the
background tab processes.

Differential Revision: https://phabricator.services.mozilla.com/D145351
2022-05-20 09:14:42 +00:00
Marian-Vasile Laza
fadf2bc15a Backed out changeset 7b3a02a659ef (bug 1767346) for causing geckoview failures. CLOSED TREE 2022-05-20 05:23:28 +03:00
Emilio Cobos Álvarez
d6edcc48bb Bug 1767346 - Use browsing context activeness rather than renderLayers to determine process priority. r=mccr8,mconley,geckoview-reviewers,agi
For desktop this should basically have no impact (maybe impacts tab
warming, but if we wanted we could set the priority hint from the tab
switcher the same way we set renderLayers), but Fenix always has
renderLayers as true, effectively, so we were never de-prioritizing the
background tab processes.

Differential Revision: https://phabricator.services.mozilla.com/D145351
2022-05-20 00:48:32 +00:00