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

95 Коммитов

Автор SHA1 Сообщение Дата
Valentin Gosu 292ecbe28d Bug 1794376 - Rename BlockingIOWatcher and simplify code r=edgul
We don't need mEvent to wait for IO completion. Instead, we just cancel
it immediately.

Differential Revision: https://phabricator.services.mozilla.com/D159846
2022-10-28 12:36:48 +00:00
Valentin Gosu a5d6d45941 Bug 1794376 - Use SpinEventLoopUntil to await for CacheFileIOManager shutdown r=jstutte,edgul
Differential Revision: https://phabricator.services.mozilla.com/D159845
2022-10-28 12:36:47 +00:00
Mike Hommey 12df1ed1b6 Bug 1766561 - Use %lu for Windows Error types (DWORD). r=rkraesig,xpcom-reviewers,application-update-reviewers,mhowell,bobowen,necko-reviewers,keeler,media-playback-reviewers,bytesized,barret,alwu,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144914
2022-05-03 20:49:07 +00:00
Randell Jesup c5917ed65a Bug 1207753: Basic thread-safety annotations to quiet errors until real annotations land r=nika
Differential Revision: https://phabricator.services.mozilla.com/D141062
2022-03-17 18:39:15 +00:00
Sandor Molnar e8e67d3eb4 Backed out 2 changesets (bug 1741190, bug 1644983) for causing browser-chrome failures in browser_xpcom_graph_wait. CLOSED TREE
Backed out changeset ddf74f877a92 (bug 1644983)
Backed out changeset 817dd8236d41 (bug 1741190)
2021-12-01 08:34:10 +02:00
Valentin Gosu 21d0427075 Bug 1644983 - Register CacheIOThread thread with profiler r=necko-reviewers,dragana
Depends on D132380

Differential Revision: https://phabricator.services.mozilla.com/D132381
2021-11-30 22:20:01 +00:00
Valentin Gosu 733ed7c4bd Bug 1665836 - Make CacheIOThread::ThreadFunc hold reference to thread r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D118157
2021-06-24 16:20:16 +00:00
Florian Quèze dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00
Iulian Moraru b02492de66 Backed out changeset 617a466d0cce (bug 1715257) for causing build bustages. CLOSED TREE 2021-06-17 10:58:16 +03:00
Florian Quèze 7b4906a6bd Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 06:12:10 +00:00
Valentin Gosu 1a1f42da37 Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk r=necko-reviewers,kershaw
This changeset is the result of adding modernize-use-default-member-init to
tools/clang-tidy/config.yaml then proceeding to run
`./mach static-analysis check netwerk/ --fix`
I then went through the resulting fix and manually updated all of the member
variables which were missed due to them having a non-trivial constructor.

Note that the tool was only run on Linux, so code that only runs on some
platforms may have been missed.

The member variables that are still initialized in the contructor definition
are:
  - bitfields (not all currently supported compilers allow default-member-init
  - variables that are initialized via a parameter
  - variables that use code not visible in the header file

There are a few advantages to landing this change:
- fewer lines of code - now declaration is in the same place as initialization
  this also makes it easier to see when looking at the header.
- it makes it harder to miss initializing a member when adding a new contructor
- variables that depend on an include guard look much nicer now

Additionally I removed some unnecessary reinitialization of NetAddr members
(it has a constructor that does that now), and changed nsWifiScannerDBus to
use the thread-safe strtok_r instead of strtok.

Differential Revision: https://phabricator.services.mozilla.com/D116980
2021-06-11 07:10:41 +00:00
Csoregi Natalia 938a6943c6 Backed out changeset 6e00f8bd2acc (bug 1714307) for causing hazard bustage. CLOSED TREE 2021-06-09 21:50:03 +03:00
Valentin Gosu d1513f313e Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk r=necko-reviewers,kershaw
This changeset is the result of adding modernize-use-default-member-init to
tools/clang-tidy/config.yaml then proceeding to run
`./mach static-analysis check netwerk/ --fix`
I then went through the resulting fix and manually updated all of the member
variables which were missed due to them having a non-trivial constructor.

Note that the tool was only run on Linux, so code that only runs on some
platforms may have been missed.

The member variables that are still initialized in the contructor definition
are:
  - bitfields (not all currently supported compilers allow default-member-init
  - variables that are initialized via a parameter
  - variables that use code not visible in the header file

There are a few advantages to landing this change:
- fewer lines of code - now declaration is in the same place as initialization
  this also makes it easier to see when looking at the header.
- it makes it harder to miss initializing a member when adding a new contructor
- variables that depend on an include guard look much nicer now

Additionally I removed some unnecessary reinitialization of NetAddr members
(it has a constructor that does that now), and changed nsWifiScannerDBus to
use the thread-safe strtok_r instead of strtok.

Differential Revision: https://phabricator.services.mozilla.com/D116980
2021-06-09 10:20:04 +00:00
Valentin Gosu d595491cc7 Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 12:35:16 +00:00
Butkovits Atila 692bda1ca1 Backed out changeset c4b44c4ef15b (bug 1714307) for causing build bustages on nsHTTPCompressConv.h. CLOSED TREE 2021-06-04 13:53:37 +03:00
Valentin Gosu 98146ae90b Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 10:00:55 +00:00
Gerald Squelart 2416d881e2 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

Differential Revision: https://phabricator.services.mozilla.com/D104588
2021-02-16 04:44:19 +00:00
David Major bc943f076f Bug 1688292 - Fix non-unified build errors in netwerk/cache2/ r=necko-reviewers,valentin
This is a drive-by fix while I was looking into something else.

Differential Revision: https://phabricator.services.mozilla.com/D102795
2021-01-25 12:23:13 +00:00
Masatoshi Kimura 22723674f7 Bug 1684110 - Stop using some 'A'-functions in netwerk/. r=necko-reviewers,kershaw
Depends on D100466

Differential Revision: https://phabricator.services.mozilla.com/D100467
2021-01-04 20:34:50 +00:00
Bas Schouten 25a1b0f61f Bug 1669256 - Part 1: Remove AbstractEventQueue and de-templatize ThreadEventQueue. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D92709
2020-10-09 17:56:34 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke 032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Honza Bambas 281f7b311b Bug 1634950 - Add event dispatch-and-run MOZ_LOG to our xpcom threads, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D73622
2020-05-12 12:48:49 +00:00
Gerald Squelart 6f36a3fdb8 Bug 1609907 - Remove AUTO_PROFILER_THREAD_SLEEP before mozilla::CondVar waits - r=mstange
CondVar already calls `AUTO_PROFILER_THREAD_SLEEP`, which shouldn't be called recursively.

mozilla::Monitor also uses CondVar, so it shouldn't be surrounded by `AUTO_PROFILER_THREAD_SLEEP` either.

Depends on D72850

Differential Revision: https://phabricator.services.mozilla.com/D72851
2020-05-01 22:12:22 +00:00
Simon Giesecke 191a830575 Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Alex Henrie e71e6666f8 Bug 1608002 - Link to CancelSynchronousIo at compile time. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D59269

--HG--
extra : moz-landing-system : lando
2020-01-13 18:49:36 +00:00
Honza Bambas 2b587a5803 Bug 1541105 - Cache2 I/O thread may do excessive number of AddRef/Release calls on queued nsCOMPtr's under a lock, blocking main thread under heavy load; use nsTArray APIs allowing mere move of the elements instead, r=michal,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D25815

--HG--
extra : moz-landing-system : lando
2019-04-03 11:27:28 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Michal Novotny 1ac8081516 Bug 1513676 - Twice-reported memory allocations in CacheStorageService code, r=honzab
Do not report malloc size of CacheIOThread::mThread, because it can be reported by ThreadsReporter.

--HG--
extra : rebase_source : b077f80a82c5df70f1b3f267f7718f1ad7f94ea1
2019-01-08 16:38:00 +02:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Gerald Squelart 69cacfa74d Bug 1504347 - Add IDLE markers and AUTO_PROFILER_THREAD_SLEEP around Necko waits - r=mayhemer
IDLE markers help with categorizing threads in the profiler UI.
_SLEEP makes the profiler spend less time sampling threads that haven't changed.

Differential Revision: https://phabricator.services.mozilla.com/D10815

--HG--
extra : moz-landing-system : lando
2018-11-05 12:58:51 +00:00
Kris Maglione 74481e8af4 Bug 1479035: Part 1 - Don't create event queues for stub nsThread wrappers. r=froydnj
Most of the times when we automatically create nsThread wrappers for threads
that don't already have them, we don't actually need the event targets, since
those threads don't run XPCOM event loops. Aside from wasting memory, actually
creating these event loops can lead to leaks if a thread tries to dispatch a
runnable to the queue which creates a reference cycle with the thread.

Not creating the event queues for threads that don't actually need them helps
avoid those foot guns, and also makes it easier to figure out which treads
actually run XPCOM event loops.

MozReview-Commit-ID: Arck4VQqdne

--HG--
extra : source : a03a61d6d724503c3b7c5e31fe32ced1f5d1c219
extra : intermediate-source : 5152af6ab3e399216ef6db8f060c257b2ffbd330
extra : histedit_source : ef06000344416e0919f536d5720fa979d2d29c66%2C4671676b613dc3e3ec762edf5d72a2ffbe6fca3f
2018-07-27 15:13:12 -07:00
Narcis Beleuzu 72f96acd7b Backed out 2 changesets (bug 1479035) for assertion failure: mEvents. CLOSED TREE
Backed out changeset 89a0c0874d40 (bug 1479035)
Backed out changeset 5152af6ab3e3 (bug 1479035)
2018-09-26 23:40:13 +03:00
Kris Maglione 81eb50cf31 Bug 1479035: Part 1 - Don't create event queues for stub nsThread wrappers. r=froydnj
Most of the times when we automatically create nsThread wrappers for threads
that don't already have them, we don't actually need the event targets, since
those threads don't run XPCOM event loops. Aside from wasting memory, actually
creating these event loops can lead to leaks if a thread tries to dispatch a
runnable to the queue which creates a reference cycle with the thread.

Not creating the event queues for threads that don't actually need them helps
avoid those foot guns, and also makes it easier to figure out which treads
actually run XPCOM event loops.

MozReview-Commit-ID: Arck4VQqdne

--HG--
extra : rebase_source : fcf8fa50e748c4b54c3bb1997575d9ffd4cbaae1
extra : source : a03a61d6d724503c3b7c5e31fe32ced1f5d1c219
2018-07-27 15:13:12 -07:00
Noemi Erli 36cc0e5fa7 Backed out 2 changesets (bug 1479035) for build bustages bustages netwerk/cache2/target on CLOSED TREE
Backed out changeset 5f8706213610 (bug 1479035)
Backed out changeset a03a61d6d724 (bug 1479035)
2018-09-26 08:54:03 +03:00
Kris Maglione a6edc4f204 Bug 1479035: Part 1 - Don't create event queues for stub nsThread wrappers. r=froydnj
Most of the times when we automatically create nsThread wrappers for threads
that don't already have them, we don't actually need the event targets, since
those threads don't run XPCOM event loops. Aside from wasting memory, actually
creating these event loops can lead to leaks if a thread tries to dispatch a
runnable to the queue which creates a reference cycle with the thread.

Not creating the event queues for threads that don't actually need them helps
avoid those foot guns, and also makes it easier to figure out which treads
actually run XPCOM event loops.

MozReview-Commit-ID: Arck4VQqdne

--HG--
extra : rebase_source : 02c5572b92ee48c11697d90941336e10c03d49cf
2018-07-27 15:13:12 -07:00
Andi-Bogdan Postelnicu 3f2298c2f6 Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin
MozReview-Commit-ID: 666LNaHyiuQ

--HG--
extra : rebase_source : f3a24e0342d8dcdf9020dd473bc6b1045cbc533b
2018-04-30 19:46:04 +03:00
Nika Layzell 0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Sylvestre Ledru d60d69e2cb Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj
MozReview-Commit-ID: DjDkL20wRg0

--HG--
extra : rebase_source : a343d83d1f4e97e4ba56d0f57fec93079df0b5ea
2017-10-23 20:59:55 +02:00
Tom Ritter d06bc69178 Bug 1392642 Remove unused variables in netwerk/ to silence warnings r=bagder,nwgh
MozReview-Commit-ID: LLTB5RJ4ZMz

--HG--
extra : rebase_source : 26a94bce6e9a3f22542d04e9930ff74eddd1f7ca
2017-08-24 12:03:19 -05:00
Bill McCloskey c6c1f4bbc9 Bug 1385413 - Remove thread parameter from onDispatchedEvent (r=erahm)
This parameter isn't used by any implementation of onDispatchedEvent,
and keeping the parameter makes later refactorings in this bug more difficult.

MozReview-Commit-ID: 90VY2vYtwCW
2017-07-28 13:09:06 -07:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Michal Novotny 873439772c Bug 1325336 - Generate statistics for cache performance on the given HW, r=valentin, r=honzab
CachePerfStats gathers performance data for single open, read and write operations as well as the whole cache entry opening. It maintains long term and short term average. The long term average filters out excessive values and it represents and average time for a given operation when the cache is not busy. The short term average represents the current cache speed. By comparing these two stats we know pretty quickly that the cache is getting slower and then we race the cache with network immediately without a delay. Otherwise the delay is based on the average cache entry open time.
2017-06-23 10:24:45 +02:00
Sebastian Hengst e1f8387dab Backed out changeset e44f1f746017 (bug 1325336) for crashing e.g. in browser-chrome's browser_flashblock_on_with_ask_to_activate.js with [@ mozilla::net::CacheFileUtils::CachePerfStats::MMA::GetStdDev]. r=backout 2017-06-22 18:29:06 +02:00
Michal Novotny 51fdc64d9e Bug 1325336 - Generate statistics for cache performance on the given HW, r=valentin, r=honzab
CachePerfStats gathers performance data for single open, read and write operations as well as the whole cache entry opening. It maintains long term and short term average. The long term average filters out excessive values and it represents and average time for a given operation when the cache is not busy. The short term average represents the current cache speed. By comparing these two stats we know pretty quickly that the cache is getting slower and then we race the cache with network immediately without a delay. Otherwise the delay is based on the average cache entry open time.
2017-06-22 17:22:13 +02:00
Carsten "Tomcat" Book f4d1338e49 Backed out changeset 29c843d51c4b (bug 1325336) for bustage 2017-06-22 16:16:51 +02:00
Michal Novotny 7f22d3a3e9 Bug 1325336 - Generate statistics for cache performance on the given HW, r=valentin, r=honzab
CachePerfStats gathers performance data for single open, read and write operations as well as the whole cache entry opening. It maintains long term and short term average. The long term average filters out excessive values and it represents and average time for a given operation when the cache is not busy. The short term average represents the current cache speed. By comparing these two stats we know pretty quickly that the cache is getting slower and then we race the cache with network immediately without a delay. Otherwise the delay is based on the average cache entry open time.
2017-06-22 15:44:00 +02:00
Tom Tromey 818e335541 Bug 1369830 - fix "telementry" typo in netwerk; r=michal
MozReview-Commit-ID: KPsXmJ6UYyZ

--HG--
extra : rebase_source : 02eb2f0d095edee45e92eb650055a2cc81e57ebe
2017-06-02 12:49:22 -06:00
Cervantes Yu cc5836fbae Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
NS_SetCurrentThreadName() is added as an alternative to PR_SetCurrentThreadName()
inside libxul. The thread names are collected in the form of crash annotation to
be processed on socorro.

MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00