Commit Graph

249 Commits

Author SHA1 Message Date
Ray Kraesig
fe17c87862 Bug 1880192 - [3.5/5] ThreadUtils.h: remove little-used storage cases r=xpcom-reviewers,necko-reviewers,jesup,nika
`const T&&` parameters don't have associated storage semantics defined
for them. Previously they would end up as `StoreCopyPassByRRef`, which
might even have been intentional. Forbid them, and change the one use
case invoking it to a non-reference (becoming StoreCopyPassByConstLRef).

Additionally, there are four optional storage classes that are never
automatically selected. Two of these are never used, and a third is only
used mistakenly (...ByLRef where only ...ByConstLRef is needed). Adjust
the third's use-sites, and remove all three.

The last, `StoreCopyPassByPtr`, has more of an argument to be kept: it's
simpler to use (and, arguably, to understand) than its lambda-function
equivalent when wrapping an XPCOM method that takes an [in]-pointer
argument -- but it has only one use site in the entire codebase. Replace
and remove it, as well.

No functional changes. All deleted cases remain possible via lambda
functions fed to NS_NewRunnableFunction.

Differential Revision: https://phabricator.services.mozilla.com/D202173
2024-03-05 17:22:22 +00:00
Iulian Moraru
0783fb05a1 Backed out 6 changesets (bug 1880192) for causing build bustages on MozPromise.h. CLOSED TREE
Backed out changeset b73f06a9fdb1 (bug 1880192)
Backed out changeset ee04f994bad8 (bug 1880192)
Backed out changeset 8c7a686c8691 (bug 1880192)
Backed out changeset 15e93c260557 (bug 1880192)
Backed out changeset b5f62ac62087 (bug 1880192)
Backed out changeset ff2d8eae2a68 (bug 1880192)
2024-02-27 20:41:39 +02:00
Ray Kraesig
39a92971f5 Bug 1880192 - [3.5/5] ThreadUtils.h: remove little-used storage cases r=xpcom-reviewers,necko-reviewers,jesup,nika
`const T&&` parameters don't have associated storage semantics defined
for them. Previously they would end up as `StoreCopyPassByRRef`, which
might even have been intentional. Forbid them, and change the one use
case invoking it to a non-reference (becoming StoreCopyPassByConstLRef).

Additionally, there are four optional storage classes that are never
automatically selected. Two of these are never used, and a third is only
used mistakenly (...ByLRef where only ...ByConstLRef is needed). Adjust
the third's use-sites, and remove all three.

The last, `StoreCopyPassByPtr`, has more of an argument to be kept: it's
simpler to use (and, arguably, to understand) than its lambda-function
equivalent when wrapping an XPCOM method that takes an [in]-pointer
argument -- but it has only one use site in the entire codebase. Replace
and remove it, as well.

No functional changes. All deleted cases remain possible via lambda
functions fed to NS_NewRunnableFunction.

Differential Revision: https://phabricator.services.mozilla.com/D202173
2024-02-27 17:20:11 +00:00
David Parks
ff79d267fd Bug 1833020: Disable TestWifiMonitor for intermittent failures r=gstoll,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D200066
2024-01-30 21:31:41 +00:00
komuhangi
b35b9c196f Bug 1860231 - Removed duplicate include nsServiceManagerUtils.h. r=necko-reviewers,valentin DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D191765
2023-10-25 08:03:25 +00:00
stransky
013049350a Bug 1854449 [Linux] Migrate DbusWifiScanner to DBus/GIO r=emilio,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D190307
2023-10-11 08:58:22 +00:00
Cristian Tuns
5365de024b Backed out changeset 1f39b0b5d125 (bug 1854449) for causing build bustages in DbusWifiScanner.cpp CLOSED TREE 2023-10-10 07:41:11 -04:00
stransky
6db1120c6b Bug 1854449 [Linux] Migrate DbusWifiScanner to DBus/GIO r=emilio,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D190307
2023-10-10 11:05:38 +00:00
stransky
38f9f16b30 Bug 1852503 [Linux] Fall back to dbus_gmain_set_up_connection() handler r=emilio,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D187875
2023-09-11 10:22:54 +00:00
stransky
51575a6cd1 Bug 1532281 [Linux] Remove dbus-glib code from DbusWifiScanner r=emilio,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D187434
2023-09-05 11:42:42 +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
Chris Peterson
583418db75 Bug 1847154 - netwerk: stop including unused "nsCocoaFeatures.h" in files with no macOS version checks. r=necko-reviewers,jesup
Firefox versions >= 116 only support macOS >= 10.15 (Catalina).

Depends on D185502

Differential Revision: https://phabricator.services.mozilla.com/D185503
2023-08-07 16:15:36 +00:00
David Parks
a1bb9d5a19 Bug 1842860: Increase stack size in WifiMonitor on MacOS r=haik,necko-reviewers,kershaw
We have been seeing the stack issue from bug 1776210, but on MacOS 10.12 Sierra.  We are increasing stack size for all versions.

Differential Revision: https://phabricator.services.mozilla.com/D183611
2023-07-20 22:11:27 +00:00
David Parks
4f1f0cf03e Bug 1843119: Remove SpinEventLoopUntil from nsWifiMonitor r=necko-reviewers,kershaw
We were using SpinEventLoopUntil to order the scans and the scan results but this seems to be overkill -- we should expect the main loop to process our tasks ery quickly.  In addition, it's probably not desirable to wait before scheduling the next scan because a delay in main thread processing doesn't imply lack of movement so our update is still needed.  Finally, we try to avoid SpinEventLoopUntil as much as possible.

Differential Revision: https://phabricator.services.mozilla.com/D183420
2023-07-13 19:22:17 +00:00
David Parks
f2cc4261be Bug 1840680: Add UNKNOWN to types of network for polling wifi scans r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D182249
2023-06-28 18:27:35 +00:00
David Parks
96bc62185d Bug 1833020: Fix TestWifiMonitor async mock objects r=necko-reviewers,valentin
gMock objects cannot be reused after they receive calls to the mocked functions.  This patch changes the test to establish all of the mock expectations upfront for each network-change notification before running it.  It uses gMock Sequence objects and a checkpoint to maintain (partial) temporal order.

Differential Revision: https://phabricator.services.mozilla.com/D180622
2023-06-26 19:54:41 +00:00
Nicklas Boman
b91ba7b84e Bug 1833732 - Freebsd build error after wifi scanning refactor r=necko-reviewers,jesup DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D178375
2023-05-22 22:11:08 +00:00
David Parks
603d89ce81 Bug 1810421: Only scan wifi when the network changes or when on mobile r=necko-reviewers,kershaw a=reland CLOSED TREE
Simplifies the concurrent operations of wifi scanning and reduces the
frequency in common cases.  Wifi scanning when on mobile is reduced from
every 5 seconds to every minute.  Wifi scans will also happen whenever
a new listener is registered.

Differential Revision: https://phabricator.services.mozilla.com/D176200
2023-05-13 00:36:01 +00:00
David Parks
61ef08e50a Bug 1810421: Refactor wifi scanning to consolidate generic code r=necko-reviewers,kershaw,valentin a=reland CLOSED TREE
Reorganizes the wifi-scanning code and makes more of it platform-generic
to ease the transition from polling the wifi to usually scanning only on
network changes.  This is essentially just moving files/code around and
promoting nsWifiMonitor::DoScan to be platform-independent.

Differential Revision: https://phabricator.services.mozilla.com/D176199
2023-05-13 00:36:00 +00:00
Noemi Erli
130ecb18fc Backed out 2 changesets (bug 1810421) for causing failures in test_stickyprefs.js CLOSED TREE
Backed out changeset 028af3d71e19 (bug 1810421)
Backed out changeset 35c408b9531d (bug 1810421)
2023-05-13 15:51:53 +03:00
David Parks
ce4a1d3478 Bug 1810421: Only scan wifi when the network changes or when on mobile r=necko-reviewers,kershaw
Simplifies the concurrent operations of wifi scanning and reduces the
frequency in common cases.  Wifi scanning when on mobile is reduced from
every 5 seconds to every minute.  Wifi scans will also happen whenever
a new listener is registered.

Differential Revision: https://phabricator.services.mozilla.com/D176200
2023-05-13 00:36:01 +00:00
David Parks
7043482ed4 Bug 1810421: Refactor wifi scanning to consolidate generic code r=necko-reviewers,kershaw,valentin
Reorganizes the wifi-scanning code and makes more of it platform-generic
to ease the transition from polling the wifi to usually scanning only on
network changes.  This is essentially just moving files/code around and
promoting nsWifiMonitor::DoScan to be platform-independent.

Differential Revision: https://phabricator.services.mozilla.com/D176199
2023-05-13 00:36:00 +00:00
Cristian Tuns
af5d0c02f1 Backed out 2 changesets (bug 1810421) for causing build bustages in TestWifiMonitor.cpp CLOSED TREE
Backed out changeset 1cf92ef74fb4 (bug 1810421)
Backed out changeset afd62e82fe83 (bug 1810421)
2023-05-10 17:31:15 -04:00
David Parks
02027ae51d Bug 1810421: Only scan wifi when the network changes or when on mobile r=necko-reviewers,kershaw
Simplifies the concurrent operations of wifi scanning and reduces the
frequency in common cases.  Wifi scanning when on mobile is reduced from
every 5 seconds to every minute.  Wifi scans will also happen whenever
a new listener is registered.

Differential Revision: https://phabricator.services.mozilla.com/D176200
2023-05-10 19:46:29 +00:00
David Parks
4b6d4e388a Bug 1810421: Refactor wifi scanning to consolidate generic code r=necko-reviewers,kershaw,valentin
Reorganizes the wifi-scanning code and makes more of it platform-generic
to ease the transition from polling the wifi to usually scanning only on
network changes.  This is essentially just moving files/code around and
promoting nsWifiMonitor::DoScan to be platform-independent.

Differential Revision: https://phabricator.services.mozilla.com/D176199
2023-05-10 19:46:29 +00:00
Nika Layzell
d57c9498f6 Bug 1825360 - Remove the NS_DISPATCH_SYNC flag, r=necko-reviewers,geckoview-reviewers,media-playback-reviewers,karlt,jesup,m_kato,emilio
This flag is not supported by most event targets and can have unexpected
side effects (namely spinning a nested event loop). All consumers have
been replaced with a new function which is more explicit about this side
effect.

Differential Revision: https://phabricator.services.mozilla.com/D173985
2023-03-30 16:53:51 +00:00
serge-sans-paille
74f462c959 Bug 1733356 - Fix non-unified build errors in netwerk/ r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D170852
2023-02-28 10:20:16 +00:00
Cosmin Sabou
b3b360096e Backed out 3 changesets (bug 1733356) for causing several hybrid bustages.
Backed out changeset 5398605eb0af (bug 1733356)
Backed out changeset dead7940f720 (bug 1733356)
Backed out changeset 97bab99ef206 (bug 1733356)
2023-02-24 19:08:18 +02:00
serge-sans-paille
aade476c1e Bug 1733356 - Fix non-unified build errors in netwerk/ r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D170852
2023-02-24 10:41:25 +00:00
Norisz Fay
b573807379 Backed out changeset 5876fd60bbe5 (bug 1733356) for causing bustages on Predictor.cpp CLOSED TREE 2023-02-24 12:09:07 +02:00
serge-sans-paille
2ec96999fa Bug 1733356 - Fix non-unified build errors in netwerk/ r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D170852
2023-02-24 08:40:49 +00:00
Nika Layzell
9d6bb19c23 Bug 1809753 - Part 4: Remove unnecessary GetMainThreadEventTarget, r=mccr8
This method always returned GetMainThreadSerialEventTarget(). This patch
switches all callers over to use that method instead.

We can't easily switch all calls to be calls to NS_GetMainThread(), as there is
no version of that method returning a bare nsIThread* instance.

I didn't introduce one, as we may want to add a lock around mMainThread in the
future, which would require removing nsThreadManager::GetMainThreadWeak. As
this method only returns nsISerialEventTarget, it method could remain
implemented, however, by returning a statically allocated fake event target
which forwards dispatches (and QIs to nsIThread) to the real main thread.

Differential Revision: https://phabricator.services.mozilla.com/D166608
2023-01-16 23:14:12 +00:00
Sandor Molnar
41b78439d0 Backed out 6 changesets (bug 1809752, bug 1809753) for causing perma failures in browser/components/firefoxview/tests/browser/browser_feature_callout_position.js
Backed out changeset ea05784d74c4 (bug 1809753)
Backed out changeset 7c9b20eebcc8 (bug 1809753)
Backed out changeset d0267ac2256d (bug 1809753)
Backed out changeset aa9f2971bd6f (bug 1809753)
Backed out changeset f0d9fcfaa6f8 (bug 1809752)
Backed out changeset 6d58c799cffe (bug 1809752)
2023-01-17 03:19:24 +02:00
Nika Layzell
f7772bb6ae Bug 1809753 - Part 4: Remove unnecessary GetMainThreadEventTarget, r=mccr8
This method always returned GetMainThreadSerialEventTarget(). This patch
switches all callers over to use that method instead.

We can't easily switch all calls to be calls to NS_GetMainThread(), as there is
no version of that method returning a bare nsIThread* instance.

I didn't introduce one, as we may want to add a lock around mMainThread in the
future, which would require removing nsThreadManager::GetMainThreadWeak. As
this method only returns nsISerialEventTarget, it method could remain
implemented, however, by returning a statically allocated fake event target
which forwards dispatches (and QIs to nsIThread) to the real main thread.

Differential Revision: https://phabricator.services.mozilla.com/D166608
2023-01-16 23:14:12 +00:00
Nika Layzell
9e65358787 Bug 1799222 - Part 1: Prevent accidental dispatches to threadpool and timer threads, r=xpcom-reviewers,necko-reviewers,geckoview-reviewers,media-playback-reviewers,jesup,m_kato,padenot,kmag
Differential Revision: https://phabricator.services.mozilla.com/D161349
2022-12-16 17:09:16 +00:00
Cristian Tuns
77f27d96b0 Backed out changeset 42315c023471 (bug 1799222) for causing multiple failures CLOSED TREE 2022-12-06 16:35:58 -05:00
Nika Layzell
40a3a64aee Bug 1799222 - Prevent accidental dispatches to threadpool and timer threads, r=xpcom-reviewers,necko-reviewers,geckoview-reviewers,media-playback-reviewers,jesup,m_kato,padenot,kmag
Differential Revision: https://phabricator.services.mozilla.com/D161349
2022-12-06 20:44:15 +00:00
Mike Hommey
d01fe13a7e Bug 1795230 - Fix -Wobjc-method-access warnings in osx_corewlan.mm. r=haik,necko-reviewers,valentin
This replaces deprecated classes, except in the one case where we're
purposely using the deprecated class until it's actively removed.

Differential Revision: https://phabricator.services.mozilla.com/D159368
2022-10-17 21:58:42 +00:00
Andrew McCreight
2da84b8ac4 Bug 1792574, part 3 - Don't include nsMemory where it isn't needed. r=xpcom-reviewers,necko-reviewers,valentin,nika
There are only 3 places where nsMemory.h is still needed (image/RasterImage.cpp,
gfx/thebes/gfxFT2FontList.cpp, and nsMemory.cpp). Remove the rest.

Differential Revision: https://phabricator.services.mozilla.com/D158213
2022-09-28 15:17:46 +00:00
Fabrice Desré
c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel
3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel
fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel
89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré
0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Haik Aftandilian
f43f562153 Bug 1776210 - [macOS 13] Stack underflow crashes on Wifi Monitor thread on macOS 13 (Ventura) beta r=mac-reviewers,necko-reviewers,mstange,dragana
Use a larger stack size on macOS 13 for the Wifi monitor thread to accommodate Core WLAN code allocating 217K+ on the stack.

Differential Revision: https://phabricator.services.mozilla.com/D152555
2022-07-25 14:09:09 +00:00
Randell Jesup
5a58ff7cd5 Bug 1207753 - netwerk nsWifiMonitor thread-safety annotations r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D141627
2022-03-23 14:55:16 +00:00
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00