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

22177 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione fc1c2b1b04 Bug 1773770: Part 7 - Migrate PowerManagerService to static component registration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149434
2022-06-24 07:10:17 +00:00
Kris Maglione 04a1bd3551 Bug 1773770: Part 5 - Migrate necko category entries to static registration. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D149433
2022-06-24 07:10:17 +00:00
Kris Maglione 4bd7eb42a2 Bug 1773770: Part 4 - Migrate INI parser factory to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149432
2022-06-24 07:10:16 +00:00
Kris Maglione 29aac4ac21 Bug 1773770: Part 3 - Migrate XRE module to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149431
2022-06-24 07:10:16 +00:00
Kris Maglione a7dfec363a Bug 1773770: Part 2 - Migrage KeyValueStore to static component registration. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D149430
2022-06-24 07:10:16 +00:00
Kris Maglione 3b276e743a Bug 1773770: Part 1 - Remove defunct layout module. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149429
2022-06-24 07:10:15 +00:00
criss 6abc242b8d Backed out 11 changesets (bug 1773770) for causing mochitest failures on test_bug466599.xhtml. CLOSED TREE
Backed out changeset d35762c3242d (bug 1773770)
Backed out changeset 0501c85d3f58 (bug 1773770)
Backed out changeset cdd28e0e3434 (bug 1773770)
Backed out changeset a48829529dd0 (bug 1773770)
Backed out changeset c3fcdd7e88e5 (bug 1773770)
Backed out changeset 8f334c5dc0cd (bug 1773770)
Backed out changeset 337e76b67647 (bug 1773770)
Backed out changeset 71f539b482ba (bug 1773770)
Backed out changeset b996cbbbc2f5 (bug 1773770)
Backed out changeset a6ddc3cdc9ba (bug 1773770)
Backed out changeset c8d7da3cf2ac (bug 1773770)
2022-06-24 08:12:40 +03:00
Kris Maglione 8636bacdcd Bug 1773770: Part 12 - Remove XPCOM Module infrastructure. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149439
2022-06-24 00:47:46 +00:00
Kris Maglione 43fbc92a6b Bug 1773770: Part 11 - Migrate TestRacingServiceManager to register factories directly. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149438
2022-06-24 00:47:46 +00:00
Kris Maglione b973622a94 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-24 00:47:45 +00:00
Kris Maglione 00c2a2d33f Bug 1773770: Part 8 - Migrate Cocoa widget module to static component registration. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D149435
2022-06-24 00:47:44 +00:00
Kris Maglione 41bf38fd96 Bug 1773770: Part 7 - Migrate PowerManagerService to static component registration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149434
2022-06-24 00:47:44 +00:00
Kris Maglione 3d617d9036 Bug 1773770: Part 5 - Migrate necko category entries to static registration. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D149433
2022-06-24 00:47:44 +00:00
Kris Maglione 36eea502fb Bug 1773770: Part 4 - Migrate INI parser factory to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149432
2022-06-24 00:47:43 +00:00
Kris Maglione 27f3cba873 Bug 1773770: Part 3 - Migrate XRE module to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149431
2022-06-24 00:47:43 +00:00
Kris Maglione e3abe6253a Bug 1773770: Part 2 - Migrage KeyValueStore to static component registration. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D149430
2022-06-24 00:47:42 +00:00
Kris Maglione 0d8489ee70 Bug 1773770: Part 1 - Remove defunct layout module. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149429
2022-06-24 00:47:42 +00:00
Marian-Vasile Laza 7dd26a3f65 Backed out 11 changesets (bug 1773770) for causing bc failures on browser_xpcom_graph_wait.js. CLOSED TREE
Backed out changeset 72ace9ee39ae (bug 1773770)
Backed out changeset e8a3a040b4c4 (bug 1773770)
Backed out changeset 4ff5f4f0f5d1 (bug 1773770)
Backed out changeset f96e9664168d (bug 1773770)
Backed out changeset b6a696897ca8 (bug 1773770)
Backed out changeset 1b8ad6be2dce (bug 1773770)
Backed out changeset 7e3a1a32a88d (bug 1773770)
Backed out changeset 6dbe5fa1ad4f (bug 1773770)
Backed out changeset 86e09dcdadde (bug 1773770)
Backed out changeset 1ee8d852d9d5 (bug 1773770)
Backed out changeset c99e93023059 (bug 1773770)
2022-06-24 03:25:34 +03:00
Kris Maglione ca338cab57 Bug 1773770: Part 12 - Remove XPCOM Module infrastructure. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149439
2022-06-23 23:05:38 +00:00
Kris Maglione 85eac7b7e1 Bug 1773770: Part 11 - Migrate TestRacingServiceManager to register factories directly. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149438
2022-06-23 23:05:37 +00:00
Kris Maglione fe9734c5db Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-23 23:05:36 +00:00
Kris Maglione ece8a769ae Bug 1773770: Part 8 - Migrate Cocoa widget module to static component registration. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D149435
2022-06-23 23:05:36 +00:00
Kris Maglione 718f69958a Bug 1773770: Part 7 - Migrate PowerManagerService to static component registration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149434
2022-06-23 23:05:36 +00:00
Kris Maglione d8b52db8c7 Bug 1773770: Part 5 - Migrate necko category entries to static registration. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D149433
2022-06-23 23:05:35 +00:00
Kris Maglione 56cbf4f676 Bug 1773770: Part 4 - Migrate INI parser factory to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149432
2022-06-23 23:05:35 +00:00
Kris Maglione f0384eb2c1 Bug 1773770: Part 3 - Migrate XRE module to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149431
2022-06-23 23:05:34 +00:00
Kris Maglione 673b73996e Bug 1773770: Part 2 - Migrage KeyValueStore to static component registration. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D149430
2022-06-23 23:05:34 +00:00
Kris Maglione a91dabf727 Bug 1773770: Part 1 - Remove defunct layout module. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149429
2022-06-23 23:05:34 +00:00
Marian-Vasile Laza 969bcd8dfe Backed out 11 changesets (bug 1773770) for causing bustages on nsComponentManager.obj.
Backed out changeset 3538e99dd668 (bug 1773770)
Backed out changeset 0862b3275742 (bug 1773770)
Backed out changeset 45dbd95d94bb (bug 1773770)
Backed out changeset 1d079a6ae89c (bug 1773770)
Backed out changeset ac4c4a143ff7 (bug 1773770)
Backed out changeset 0e3233868101 (bug 1773770)
Backed out changeset ac727812fd06 (bug 1773770)
Backed out changeset fe46df06e31a (bug 1773770)
Backed out changeset 51b89b344d7f (bug 1773770)
Backed out changeset 62e49ca3f288 (bug 1773770)
Backed out changeset 6df39588ec9a (bug 1773770)
2022-06-24 01:16:58 +03:00
Kris Maglione bd53de0ad1 Bug 1773770: Part 12 - Remove XPCOM Module infrastructure. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149439
2022-06-23 20:13:11 +00:00
Kris Maglione aa103d0067 Bug 1773770: Part 11 - Migrate TestRacingServiceManager to register factories directly. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149438
2022-06-23 20:13:11 +00:00
Kris Maglione 38b1250f24 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-23 20:13:10 +00:00
Kris Maglione 8336ead7f1 Bug 1773770: Part 8 - Migrate Cocoa widget module to static component registration. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D149435
2022-06-23 20:13:09 +00:00
Kris Maglione 48fc5931f4 Bug 1773770: Part 7 - Migrate PowerManagerService to static component registration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149434
2022-06-23 20:13:09 +00:00
Kris Maglione 5c8f3b9df7 Bug 1773770: Part 5 - Migrate necko category entries to static registration. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D149433
2022-06-23 20:13:09 +00:00
Kris Maglione b41d646441 Bug 1773770: Part 4 - Migrate INI parser factory to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149432
2022-06-23 20:13:08 +00:00
Kris Maglione 0c8c6bd04f Bug 1773770: Part 3 - Migrate XRE module to static component registration. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149431
2022-06-23 20:13:08 +00:00
Kris Maglione 18cba4e2ed Bug 1773770: Part 2 - Migrage KeyValueStore to static component registration. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D149430
2022-06-23 20:13:07 +00:00
Kris Maglione a8ec09424c Bug 1773770: Part 1 - Remove defunct layout module. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D149429
2022-06-23 20:13:07 +00:00
Kris Maglione 27515a3d83 Bug 1770237: Part 17 - Rename mozJSComponentLoader to mozJSModuleLoader r=mccr8,decoder
Differential Revision: https://phabricator.services.mozilla.com/D148197
2022-06-22 20:31:37 +00:00
Kris Maglione 2b9e8682a2 Bug 1770237: Part 16 - Remove component loading logic from mozJSComponentLoader. r=mccr8,florian
Differential Revision: https://phabricator.services.mozilla.com/D148196
2022-06-22 20:31:37 +00:00
Kris Maglione 37545fb01a Bug 1770237: Part 15 - Remove component/contract support from manifest parser. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D148195
2022-06-22 20:31:37 +00:00
Kris Maglione 10e2279ff4 Bug 1770237: Part 13 - Use category entries to test manifest process directives. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D148193
2022-06-22 20:31:36 +00:00
Kris Maglione 2c3055767b Bug 1770237: Part 10 - Remove test_bug725015.js. r=mccr8
It was for the sake of legacy extensions, which we don't care about, and
applies to `contract` manifest entries, which are being removed.

Differential Revision: https://phabricator.services.mozilla.com/D148190
2022-06-22 20:31:35 +00:00
Kris Maglione c4e585b525 Bug 1770237: Part 3 - Migrate StartupRecorder to static component registration. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D148183
2022-06-22 20:31:32 +00:00
Kris Maglione 3d0ddc30e8 Bug 1770237: Part 1a - Fix components.conf Categories property. r=mccr8
This apparently hasn't been used for a while and has bit rotted, but it's
necessary for some migrations in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D148180
2022-06-22 20:31:31 +00:00
Jan Rio Krause ceb9221d80 Bug 1690326 - Map Windows error `ERROR_DEV_NOT_EXIST` (0x37) to `NS_ERROR_FILE_DEVICE_FAILURE`. r=xpcom-reviewers,barret
Differential Revision: https://phabricator.services.mozilla.com/D149904
2022-06-22 16:44:36 +00:00
Ryan VanderMeulen 78ab363cf5 Bug 1738054 - Remove obsolete "skip-if = python == 2" keys from testing manifests and re-enable some skipped tests which now pass. r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D149573
2022-06-21 01:46:44 +00:00
Gerald Squelart 9d6e7ee7a4 Bug 1767396 - Don't wake up the timer thread when removing timers - r=florian,smaug
Differential Revision: https://phabricator.services.mozilla.com/D146031
2022-06-20 11:33:09 +00:00
Gerald Squelart 921f2c32d8 Bug 1767396 - AddTimer also awakens the timer thread if the new timer has a zero delay - r=smaug
This ensures that 0-delay timers are executed very quickly; without this, they
would rely on the timer thread waking up "naturally" as scheduled, but on some
platforms there could be significant delays (many milliseconds) before the
thread would actually wake up, compared to notifications that are handled
almost immediately.

Even though by specs, timers may be subject to being late, some users of
0-delay timers, in particular through JS' `setTimeout(code, 0)`, rely on the
code being executed as soon as possible (i.e., queued pretty much immediately
on the event loop).
Until now, this was almost guaranteed by the very frequent calls to
RemoveTimer, which always notified the timer thread and made it wake up very
quickly.
However the following patch is going to remove notifications from RemoveTimer,
so before that one lands we now need to ensure that 0-delay timer will still
be invoked at least as quickly as before.

Depends on D146030

Differential Revision: https://phabricator.services.mozilla.com/D149706
2022-06-20 11:33:09 +00:00
Gerald Squelart 130cbc8feb Bug 1767396 - AUTO_TIMERS_STATS - r=florian
This will help during development, to measure before/after times in TimerThread functions.

Differential Revision: https://phabricator.services.mozilla.com/D146030
2022-06-20 11:33:08 +00:00
Tooru Fujisawa 802076406b Bug 1769002 - Support ESM in components.conf. r=kmag
Also ESM-ify SimpleServices.jsm as an example, given an empty array is not
allowed inside StaticComponents.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D147414
2022-06-17 04:59:14 +00:00
criss 8fc8ec5d8e Backed out 8 changesets (bug 1771092, bug 1768870, bug 1771097, bug 1769002, bug 1768819) for causing mochitest failures on browser_sendQuery.js. CLOSED TREE
Backed out changeset 8a4d712f819a (bug 1771092)
Backed out changeset f4e27a35c83c (bug 1771092)
Backed out changeset 072323bc72cc (bug 1771092)
Backed out changeset 2ccf2a00fff7 (bug 1769002)
Backed out changeset ba7086fd9b1f (bug 1768819)
Backed out changeset 6205d3e2c666 (bug 1771097)
Backed out changeset 960f0aee97d5 (bug 1768870)
Backed out changeset 5f53760c5637 (bug 1768870)
2022-06-17 05:44:37 +03:00
Tooru Fujisawa 730eee44d0 Bug 1769002 - Support ESM in components.conf. r=kmag
Also ESM-ify SimpleServices.jsm as an example, given an empty array is not
allowed inside StaticComponents.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D147414
2022-06-17 01:30:23 +00:00
Mike Hommey df77ed0752 Bug 1774501 - Update to env_logger 0.9 in various in-tree crates. r=nbp,keeler,xpcom-reviewers,rhunt,nika
Differential Revision: https://phabricator.services.mozilla.com/D149453
2022-06-16 20:44:03 +00:00
Molnar Sandor c1ae6857f8 Backed out 9 changesets (bug 1769002, bug 1768870, bug 1771097, bug 1771092, bug 1768819) for causing lint failures. CLOSED TREE
Backed out changeset 829df1dfad70 (bug 1769002)
Backed out changeset f0537d333adc (bug 1771092)
Backed out changeset 25b43856bc00 (bug 1771092)
Backed out changeset a49f754ca73f (bug 1771092)
Backed out changeset 164f85686a32 (bug 1769002)
Backed out changeset ef5cf9ceb915 (bug 1768819)
Backed out changeset c64e6c1fbfe7 (bug 1771097)
Backed out changeset f85393f988a8 (bug 1768870)
Backed out changeset fe708d13cc1d (bug 1768870)
2022-06-16 20:15:14 +03:00
Molnar Sandor 61f9c8f237 Bug 1769002 - FIx lint failure. a=lint-fix CLOSED TREE 2022-06-16 19:57:21 +03:00
Tooru Fujisawa 591472f193 Bug 1769002 - Support ESM in components.conf. r=kmag
Also ESM-ify SimpleServices.jsm as an example, given an empty array is not
allowed inside StaticComponents.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D147414
2022-06-16 16:20:37 +00:00
Chris Martin 190ac22f48 Bug 1770098 - Disable Win32k Lockdown with incompatible mitigations r=handyman,Gankra
Differential Revision: https://phabricator.services.mozilla.com/D148962
2022-06-16 14:05:00 +00:00
James Teh 237c1cc6fa Bug 1760739 part 3: Expose ARIA object attributes for cached RemoteAccessibles. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D149222
2022-06-16 06:25:51 +00:00
Jens Stutte 19feec8f98 Bug 1770451 - Trace important shutdown events in a thread's name if MOZ_DIAGNOSTIC_ASSERT_ENABLED. r=xpcom-reviewers,barret
Depends on D148761

Differential Revision: https://phabricator.services.mozilla.com/D148775
2022-06-15 18:15:02 +00:00
Jens Stutte ddb3007e4e Bug 1770451 - Release assert if a thread shutdown is unexpectedly going to cause a hang on the joining thread. r=xpcom-reviewers,nika
There is a code path that can make us not dispatch the `nsThreadShutdownAckEvent` at the end of `nsThread::ThreadFunc`. The only known and legitimate way to arrive here should be via StopWaitingAndLeakThread. We want to ensure that if we take this code path someone else already marked the shutdown context as complete.

Differential Revision: https://phabricator.services.mozilla.com/D148761
2022-06-15 18:15:01 +00:00
Florian Quèze 1290aef373 Bug 1770087 - Show the task priority in task controller Runnable markers, r=bas,gerald.
Differential Revision: https://phabricator.services.mozilla.com/D146761
2022-06-15 15:00:40 +00:00
Emilio Cobos Álvarez b1ecfa4d1e Bug 1774158 - Use RefPtrTraits in StaticRefPtr. r=xpcom-reviewers,barret
This allows it to be used with more types.

Differential Revision: https://phabricator.services.mozilla.com/D149216
2022-06-14 13:33:27 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell cb50fa288b Bug 1772006 - Part 9: Allow building xpcom/string without unified builds, r=xpcom-reviewers,barret
The last remaining things requiring unified builds in this directory are the
explicit specializations. As each class' methods are now confined to a single
file, these can now be moved to the appropriate .cpp files.

Differential Revision: https://phabricator.services.mozilla.com/D148303
2022-06-10 21:12:09 +00:00
Nika Layzell 18a773c2f8 Bug 1772006 - Part 8: Remove unnecessary files from the string implementation, r=xpcom-reviewers,barret
These files exist only due to the history of how strings were previously
declared using macros, and aren't necessary anymore. The header files were not
removed, as they may be depended on from outside of the module. Cleaning up the
header situation is something which should probably happen in a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D148302
2022-06-10 21:12:09 +00:00
Nika Layzell fbec8096a9 Bug 1772006 - Part 7: Simplify and move the find+replace methods from ns[T]StringObsolete, r=xpcom-reviewers,barret
The remaining methods in ns[T]StringObsolete are all find+replace methods for
nsTSubstring. These were migrated in a similar way to the find methods, and
partially updated to avoid using methods from nsStringObsolete.cpp.

This change removes the ns[T]StringObsolete.cpp files completely, as they are
no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D148301
2022-06-10 21:12:08 +00:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
Nika Layzell 1475267b8c Bug 1772006 - Part 5: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret
In addition to moving these methods to a more appropriate file, they were
simplified to make them easier to maintain in the future.
nsTStringRepr::Compare was extended to also work on char16_t strings, and the
case insensitive and other options were removed as they aren't necessary. This
required some changes to callers in the tree.

The EqualsIgnoreCase method was also simplified by using `std::string_view`.

Differential Revision: https://phabricator.services.mozilla.com/D148299
2022-06-10 21:12:07 +00:00
Nika Layzell f9e47898c5 Bug 1772006 - Part 4: Move basic string APIs to more appropriate .cpp files, r=xpcom-reviewers,barret
Due to the history of how nsString was implemented, many APIs ended up being
implemented in inappropriate files. This change moves simple definitions which
won't require any changes for each type to happen within that type's .cpp file.

This is necessary to eventually enable the directory to be built without
unified builds.

Differential Revision: https://phabricator.services.mozilla.com/D148298
2022-06-10 21:12:07 +00:00
Nika Layzell 2f4d6ae03e Bug 1772006 - Part 3: Support converting nsTStringRepr<T> to std::basic_string_view<T>, r=xpcom-reviewers,barret
This type was introduced in c++17, and can be used as a convenient standard
medium for passing around borrowed substring references. It can be implicitly
converted to from string literals and `const char_type*`, meaning that after
this change it can be used as a convenient catch-all type to replace seperate
overloads for `const self_type&`, `const char_type*` and `const
char_type(&)[N]`.

std::basic_string_view also provides standard implementations of some
algorithms which will be convenient for code cleanup in later parts of this
bug.

Differential Revision: https://phabricator.services.mozilla.com/D148297
2022-06-10 21:12:06 +00:00
Nika Layzell f5f60897ff Bug 1772006 - Part 2: Split nsSubstring.cpp into relevant files, r=xpcom-reviewers,barret
This file only exists as a wrapper around nsTSubstring.cpp, with some methods
left in it due to how the string types were defined before they were turned
into templates.

Differential Revision: https://phabricator.services.mozilla.com/D148296
2022-06-10 21:12:06 +00:00
Nika Layzell 6c62a57da3 Bug 1772006 - Part 1: Move definition of `kNotFound` to `nsStringFwd.h`, r=xpcom-reviewers,barret
This also changes the definition to be a static rather than a #define, in order
to reduce the potential impact.

Differential Revision: https://phabricator.services.mozilla.com/D148295
2022-06-10 21:12:06 +00:00
alwu bd19cead27 Bug 1767899 - add `explicit` on EventTargetCapability ctor to fix build error. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D148846
2022-06-10 18:08:12 +00:00
Barret Rennie bee899913a Bug 1773095 - Remove XRE_API macro r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D148536
2022-06-08 00:02:02 +00:00
Norisz Fay 437a9698ca Backed out changeset 4f8da65af9b3 (bug 1773095) for causing XRE related build bustages CLOSED TREE 2022-06-08 01:01:55 +03:00
Barret Rennie ffde9cb41a Bug 1773095 - Remove XRE_API macro r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D148536
2022-06-07 21:31:03 +00:00
Nika Layzell e90c239516 Bug 1497246 - Release-check aCount for underflow in ReplaceElementsAt, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D148456
2022-06-07 17:06:41 +00:00
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Mike Hommey 7ce663eb08 Bug 1772048 - Update rustc_version and semver crates. r=emilio,webdriver-reviewers,kinetik,whimboo
semver 1.0 doesn't and won't support Clone on semver::Error[1], so we
convert the mozversion error type to store the string version of the
error, which is an incompatible change requiring a version bump on the
crate.

1. https://github.com/dtolnay/semver/pull/280

Differential Revision: https://phabricator.services.mozilla.com/D147825
2022-06-07 10:01:32 +00:00
Steve Fink 20289c208c Bug 1661293 - Make nsJSContext::MaybePokeGC trigger eager minor GCs, and change the naming to support later adding EAGER_ALLOC_TRIGGER major GCs r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D100368
2022-06-06 22:53:11 +00:00
Steve Fink 7a6aa8b314 Bug 1661293 - Move idle-time nursery GCs to a new nsJSContext::MaybePokeGC r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D100367
2022-06-06 22:53:11 +00:00
Steve Fink 2a988c91ec Bug 1661293 - Rename JS::RunIdleGCTask -> JS::MaybeRunNurseryCollection and pass through the reason, also rename IDLE_TIME_COLLECTION -> EAGER_NURSERY_COLLECTION. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139208
2022-06-06 22:53:10 +00:00
Seweryn Pajor e30e84c58a Bug 1772523 - Fix compiler warning about unused variable rv. r=xpcom-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D148308
2022-06-06 14:26:10 +00:00
Jens Stutte f31ba2bcd9 Bug 1772281 - Reduce the scope of the mMutex lock in ThreadEventQueue::SetObserver to avoid a potential recursive deadlock. r=xpcom-reviewers,jesup,nika
Differential Revision: https://phabricator.services.mozilla.com/D148249
2022-06-03 18:03:36 +00:00
Emilio Cobos Álvarez 9349aeea85 Bug 1771796 - Remove -moz-scrollbar-thumb-proportional. r=dholbert
It unconditionally matches on all platforms, so it's not returning any useful information.

Depends on D147689

Differential Revision: https://phabricator.services.mozilla.com/D147690
2022-06-02 11:58:18 +00:00
Olli Pettay 7cdb022402 Bug 1771718, let idle period be shorter when frame rate is very high, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D147643
2022-06-02 10:40:54 +00:00
Nika Layzell d53b513ba3 Bug 1772171 - Move ToDouble back to nsTString, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D147896
2022-06-01 17:45:14 +00:00
Seweryn Pajor 542f474cbc Bug 1769485 - Replace if statement checking if service manager is present with MOZ_DIAGNOSTIC_ASSERT. r=xpcom-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D147882
2022-06-01 17:15:06 +00:00
Mozilla Releng Treescript 8e705edc38 Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2022-05-30 11:42:22 +00:00
Steve Fink 819ec57dae Bug 1735434 - Gather additional information for cycle collection profiler markers r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D128316
2022-05-27 23:42:54 +00:00
Narcis Beleuzu e3d25251cc Backed out changeset 7f67e3634e8f (bug 1735434) for multiple failures/crashes on nsJSEnvironment.cpp . CLOSED TREE 2022-05-27 19:39:37 +03:00
Steve Fink ab9c7c302b Bug 1735434 - Gather additional information for cycle collection profiler markers r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D128316
2022-05-27 15:44:22 +00:00
Kagami Sascha Rosylight 846680d799 Bug 1757635 - Part 1: Add `using ::ImplCycleCollectionUnlink` inside NS_IMPL_CYCLE_COLLECTION_WITH_JS_MEMBERS r=mccr8
Otherwise the global ImplCycleCollectionUnlink for JS members are shadowed by mozilla::dom::ImplCycleCollectionUnlink and can't be used.

Bug 1756794 is to move all the impls to the single namespace to prevent this, but that requires verbose changes, and currently the only affected uses are from these macros.

Differential Revision: https://phabricator.services.mozilla.com/D147234
2022-05-25 23:41:25 +00:00
Cathy Lu 803a4e8449 Bug 1721220 - Add BAD_STS_CERT error r=geckoview-reviewers,nika,agi,owlish
Differential Revision: https://phabricator.services.mozilla.com/D146234
2022-05-25 17:51:11 +00:00
Gijs Kruitbosch a3f9a3f4e2 Bug 1707462 - expose Windows' localized file display names through XPCOM, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D143480
2022-05-23 21:57:02 +00:00
Barret Rennie 868f461b18 Bug 1769094 - nsLocalFile::Append{,RelativePath} should throw when appending .. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146228
2022-05-21 23:03:51 +00:00
Emilio Cobos Álvarez 0076bed412 Bug 1770532 - Ensure options in listbox selects are not stacking contexts by default. r=dholbert
We could have a different property or something but this seems
reasonable as well probably.

Differential Revision: https://phabricator.services.mozilla.com/D146994
2022-05-21 17:23:24 +00:00
Chris Peterson c686ea7b47 Bug 1770107 - Disambiguate char16_t* operator== overloads in MinGW build for C++23. r=xpcom-reviewers,nika
C++23 is stricer about matching operator== overloads than C++17 and char16ptr_t's implicit constructor causes some overload confusion. We can disambigutate the operator== overloads by adding typed local variables without needing type casts.

xpcom/io/nsLinebreakConverter.cpp:447:17: error: use of overloaded operator '!=' is ambiguous (with operand types 'nsTSubstring<char16_t>::iterator' (aka 'char16_t *') and 'typename raw_type<char16_t, int>::type' (aka 'char16ptr_t'))
 if (stringBuf != aIoString.get()) {
     ~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
mozilla/Char16.h:95:8: note: candidate function (with reversed parameter order)
 bool operator==(const char16ptr_t& aOther) const {
      ^
xpcom/io/nsLinebreakConverter.cpp:447:17: note: built-in candidate operator!=(const char16_t *, const char16_t *)
 if (stringBuf != aIoString.get()) {
               ^
xpcom/io/nsLinebreakConverter.cpp:447:17: note: built-in candidate operator!=(const volatile char16_t *, const volatile char16_t *)
xpcom/io/nsLinebreakConverter.cpp:447:17: note: built-in candidate operator!=(const void *, const void *)
xpcom/io/nsLinebreakConverter.cpp:447:17: note: built-in candidate operator!=(const volatile void *, const volatile void *)

Differential Revision: https://phabricator.services.mozilla.com/D146772
2022-05-20 06:06:19 +00:00
Butkovits Atila 7bbda20470 Backed out changeset 37142ab92a09 (bug 1769094) for causing gecko view failures at TestFilePreferencesUnix. CLOSED TREE 2022-05-20 08:25:24 +03:00
Barret Rennie f32c9fbea0 Bug 1769094 - nsLocalFile::Append{,RelativePath} should throw when appending .. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146228
2022-05-20 03:03:27 +00:00
Narcis Beleuzu 8f30325b72 Backed out 2 changesets (bug 1767396) for wpt failures on iframe-focus-event-after-iframe-gets-focus.html CLOSED TREE
Backed out changeset 39b9ecc2224a (bug 1767396)
Backed out changeset 77aa60771db2 (bug 1767396)
2022-05-20 02:54:56 +03:00
Gerald Squelart 74d28327be Bug 1767396 - Don't wake up the timer thread when removing timers - r=florian,smaug
Differential Revision: https://phabricator.services.mozilla.com/D146031
2022-05-19 20:31:25 +00:00
Gerald Squelart 2275810480 Bug 1767396 - AUTO_TIMERS_STATS - r=florian
This will help during development, to measure before/after times in TimerThread functions.

Differential Revision: https://phabricator.services.mozilla.com/D146030
2022-05-19 20:31:24 +00:00
Iulian Moraru 4f7b7b518b Backed out changeset 6f5cd18d3b57 (bug 1769094) for causing gtest failures on TestFilePreferencesUnix.Simple. 2022-05-18 20:41:06 +03:00
Barret Rennie 06c8e5da3d Bug 1769094 - nsLocalFile::Append{,RelativePath} should throw when appending .. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146228
2022-05-18 16:45:44 +00:00
Kershaw Chang ed4399816c Bug 1754975 - Introduce a new error code for blocking a non-local connection, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D146281
2022-05-18 15:31:07 +00:00
Jon Coppeard 750da6ab68 Bug 1768734 - Make sure JS holders are cleared before a shutdown GC r=mccr8
Previously this was optimized to trace only gray roots in collecting zones, but
there was a bug in that it also skipped clearing roots because this happens
before the start of GC when zones are selected for collection.

Instead, make sure we only perform this optimziation when marking.

Differential Revision: https://phabricator.services.mozilla.com/D146585
2022-05-18 09:04:05 +00:00
Andrew McCreight 5b3d5c09ae Bug 1514936, part 3 - Remove NS_ERROR_NO_AGGREGATION which is no longer used. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146458
2022-05-17 20:24:20 +00:00
Andrew McCreight fa8bfd1245 Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146457
2022-05-17 20:24:19 +00:00
Andrew McCreight c8c5c819df Bug 1514936, part 1 - Remove the outer argument to nsIFactory::createInstance. r=xpcom-reviewers,preferences-reviewers,nika,Gijs
This patch won't actually build, because a few bits of code are used
for both nsIFactory::createInstance and static components, and static
components are not fixed until the next patch.

The first place is nsLoadGroupConstructor, which uses an nsIFactory
macro to create a static component constructor. (This could be worked
around by expanding the macro to the state before this patch.)

The other issue is that nsAppShellConstructor is used in an nsIFactory
on OSX, but as a static component on all other platforms. This could
be worked around by wrapping nsAppShellConstructor in an adaptor that
passes in the extra null argument to nsAppShellConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D146456
2022-05-17 20:24:19 +00:00
Andrew McCreight 01913de302 Bug 1769442 - Remove nsIFactory::lockFactory, breaking compatibility with IClassFactory. r=xpcom-reviewers,Jamie,necko-reviewers,kershaw,nika
nsIFactory is binary compatible with Windows COM's IClassFactory,
but nothing seems to depend on it. This patch removes the test
for compatibility, TestCOM, and removes the lockFactory
method that isn't otherwise needed.

Differential Revision: https://phabricator.services.mozilla.com/D146386
2022-05-16 22:38:51 +00:00
Nika Layzell 59f3f40567 Bug 1767517 - Part 2: Annotate nsPipe for the thread safety analysis, r=jesup,xpcom-reviewers,KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D145394
2022-05-16 20:40:49 +00:00
Nika Layzell 7d84828a9c Bug 1769332 - Generate XPCOM error code lists for Java, r=geckoview-reviewers,agi,calu
This allows us to replace a number of magic numbers in the
WebRequestError code with automatically generated constants which are
guaranteed to be kept up to date.

This build script is able to run early enough during the build step as
generated files which take a `.jinja` file as an argument are hard-coded
to be run during the pre-export phase for Android builds. As it is just
as simple python script with no other dependencies, this shouldn't
impact geckoview build performance even when using build artifacts.

Differential Revision: https://phabricator.services.mozilla.com/D146356
2022-05-16 18:01:19 +00:00
Kagami Sascha Rosylight c0ac0addf7 Bug 1769290 - Part 5: Apply mozilla-js-handle-rooted-typedef against xpcom r=xpcom-reviewers,mccr8
Depends on D146454

Differential Revision: https://phabricator.services.mozilla.com/D146469
2022-05-16 17:20:30 +00:00
Kagami Sascha Rosylight 2093ec97cf Bug 1769290 - Part 3: Use fully qualified JS types in xpidl r=xpcom-reviewers,mccr8
Depends on D146439

Differential Revision: https://phabricator.services.mozilla.com/D146453
2022-05-16 17:20:30 +00:00
Randell Jesup 00859f1620 Bug 1762959 - xpcom/io thread-safety annotations r=nika
Differential Revision: https://phabricator.services.mozilla.com/D142066
2022-05-16 13:54:05 +00:00
Randell Jesup d3b15de2f1 Bug 1762920: remove whitelist from xpcom/crashreporter r=nika,gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D142843
2022-05-16 01:37:39 +00:00
Autumn on Tape ba819ad54d Bug 1422312 - implement 'update' media feature r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D146338
2022-05-14 13:46:41 +00:00
Iulian Moraru 8cfdac9a59 Backed out changeset eb32954c1f4c (bug 1769094) for causing multiple failures. 2022-05-13 21:00:50 +03:00
Jens Stutte aa8c3727dc Bug 1766572: Part 3 - Make nsTerminator aware of late shutdown phases. r=xpcom-reviewers,nika
In order to get better shutdown hang reporting, we want to distinguish also the last phases, namely `XPCOMShutdownThreads`, `XPCOMShutdownMainThread` and `CCPostLastCycleCollection`.
This also makes `XPCOMShutdownNotified()` obsolete and we need to slightly re-arrange the watchdog function.

Differential Revision: https://phabricator.services.mozilla.com/D145433
2022-05-13 15:47:53 +00:00
Jens Stutte f02175db9d Bug 1766572: Part 2 - Synchronize KillClearOnShutdown phases with AdvanceShutdownPhase. r=xpcom-reviewers,dthayer,nika
The concept of a shutdown phase is meant to be a finite and named period of time where:

1. we can query if we are in or beyond a given phase
2. we may want to do a fast shutdown
3. we inform the terminator that we reached the next phase
4. if needed/wanted, we notify observers of the associated topic
5. we KillClearOnShutdown smart pointers associated with this phase
6. we do any further, phase-individual cleanup until the next phase starts

`AdvanceShutdownPhase(WithoutNotify)` now provides the functionality for 1. through 5. and must be the only place that calls `KillClearOnShutdown` in order to avoid misalignments.
In doing so, it becomes also the only caller of `MaybeFastShutdown`.

Please refer to bug 1768581 as working on this patch made us think if we should re-work the order inside AdvanceShutdownPhase.

Differential Revision: https://phabricator.services.mozilla.com/D145083
2022-05-13 15:47:52 +00:00
Jens Stutte 13675ac0e6 Bug 1766572: Part 1 - Remove obsolete ShutdownPhase::XPCOMShutdownLoaders. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D145082
2022-05-13 15:47:52 +00:00
Emilio Cobos Álvarez 87ff5a5d8d Bug 1768418 - Move various methods from nsTString to nsTSubstring/nsTStringRepr. r=xpcom-reviewers,nika
No reason these don't work on substrings.

Remove StripChars since it has an existing nsTSubstring version. Make
callers use rightly-typed characters for those.

Differential Revision: https://phabricator.services.mozilla.com/D145864
2022-05-13 15:39:19 +00:00
Barret Rennie 9dea84af2a Bug 1769094 - nsLocalFile::Append{,RelativePath} should throw when appending .. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146228
2022-05-13 15:08:47 +00:00
Nika Layzell 873e958e4f Bug 1754004 - Part 18: Ensure AsyncWait callbacks are cleared when NS_AsyncCopy completes, r=xpcom-reviewers,mccr8
When the NS_AsyncCopy completes, there may still be outstanding
AsyncWait callbacks which have not been invoked yet, due to two
AsyncWait callbacks being registered each time Process() yields (one to
wait for the blocked stream, and the other with WAIT_CLOSURE_ONLY to
handle errors), and only one callback being needed to resume processing.

This change ensures that any outstanding AsyncWait callbacks are
cancelled, breaking references from the streams to the
nsAStreamCallback. Some streams (such as nsPipe and DataPipe) may also
leak if there are oustanding AsyncWait callbacks, due to the need to
keep the stream alive so it can be passed into the callback, which this
helps avoid.

Previously leaks were largely avoided due to the call to `Close()`
cancelling the callbacks for us, however not all callsites specify to
close the source/sink.

This should also help avoid an unnecessary dispatch after the copy
completes due to our AsyncWait callback being invoked when the
source/sink stream is closed.

Differential Revision: https://phabricator.services.mozilla.com/D146130
2022-05-13 14:16:16 +00:00
Nika Layzell b82512de01 Bug 1754004 - Part 17: Keep pipe streams alive so long as there's a callback registered, r=asuth
If we don't do this, we can encounter issues where we'll spuriously close the
stream when the last reference to the input stream is dropped while an
AsyncWait is still pending.

Differential Revision: https://phabricator.services.mozilla.com/D145672
2022-05-13 14:16:16 +00:00
Nika Layzell d5fa382918 Bug 1754004 - Part 15: Don't track mOriginalInput in nsPipe, r=asuth
As discovered by TSan, this member could be raced on in some edge-cases if
cloned pipe streams raced on multiple threads to be destroyed. This change
instead moves the `nsIPipe` implementation to be on a seperate type from
`nsPipe`, allowing `mOriginalInput` to no longer need to be tracked.

This technically has slightly different behaviour than the previous
implementation for JS code, as code keeping the `nsIPipe` alive will now also
be keeping the output stream reference alive directly, rather than only holding
the `nsIPipe`, meaning that `pipe.outputStream` can be read multiple times
independently without implicitly closing the underlying stream. Based on a
quick read of the few remaining uses of `nsIPipe` in JS code, I don't think
this will be an issue, and it may actually be more intuitive and consistent.

Differential Revision: https://phabricator.services.mozilla.com/D145362
2022-05-13 14:16:15 +00:00
Nika Layzell ae579d351c Bug 1754004 - Part 14: Fix potential skipping of async streams in nsMultiplexInputStream, r=asuth
Before this change, we could run into issues when an async stream
accepts new data and queues a runnable to notify the stream listener,
but before that stream listener's runnable is run, the target thread
reads data from the async stream, emptying it of any available data.
This would mean that the stream appears empty in
nsMultiplexInputStream::OnInputStreamReady, and the rest of the stream
is skipped.

This patch changes the logic in OnInputStreamReady to re-call AsyncWait
in those situations and avoid skipping over the empty stream, preventing
data loss.

This situation came up when running some HTTP tests under rr with the
socket process enabled, as the upload stream can both be read due to an
OnInputStreamReady callback and due to other calls in the HTTP
machinery, leading to this potential race. With the socket process
enabled, it is possible for the upload stream to be an async pipe, which
doesn't happen in the parent process due to stream normalization.

This change makes an assumption about the behaviour of streams
implementing `nsIAsyncInputStream` which I believe is correct right now,
and has been documented. I originally had other patches which modified
`Available()`'s definition to add an extra outparameter or added extra
methods, but this seemed much simpler and accurate based on my memory of
having read the Available() implementations for async streams in-tree.

A gtest was added for the failing situation using both nsPipe and DataPipe.

Differential Revision: https://phabricator.services.mozilla.com/D144451
2022-05-13 14:16:14 +00:00
Nika Layzell 1aa11ffed6 Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-13 14:16:13 +00:00
Nika Layzell 89567e0ee9 Bug 1754004 - Part 8: Remove SeekableStreamWrapper, r=asuth,necko-reviewers,kershaw
This type is no longer necessary, and has various issues due to behaving
incorrectly when used with async streams or streams which are not nsIPipe.

Differential Revision: https://phabricator.services.mozilla.com/D141045
2022-05-13 14:16:12 +00:00
Nika Layzell 76b98a65e4 Bug 1754004 - Part 7: Consistently normalize upload streams passed to HTTP channels, r=asuth,necko-reviewers,dragana
Unfortunately, upload streams used by necko have various odd behaviours
and requirements which happened to be usually preserved by the previous
IPC serialization logic, but were not consistently preserved. This
includes requiring the stream to be synchronous (as some consumers such
as WebExtensions and DevTools appear to read it assuming Available() is
the stream length), seekable (as it needs to be rewound in various
places), and cloneable (as the stream information is often handed out to
other components).

In addition, the WebExtension WebRequest code makes assumptions about
the specific topology of the input stream for optimization purposes,
meaning that nsMultiplexInputStreams need to be preserved.

The way this was previously handled was by copying the entire payload
into a nsStorageStream as an async operation. This happened very
infrequently in out test suite, however, and had some issues. It could
lead to data loss if the stream was a nsMIMEInputStream (as the metadata
would be lost), and would destroy the topology required by WebRequest.

This patch changes the code to instead manually walk and replace streams
in the input stream's data structure, to efficiently copy only the
required data, preserve the invariants, and make the type seekable
before AsyncOpen continues. This helps keep the complexity of the
invariants HTTPChannel depends on out of generic input stream handling
code.

In addition, due to how early this happens, it replaces the need for
PartiallySeekableInputStream which will be removed a later part.

Differential Revision: https://phabricator.services.mozilla.com/D141044
2022-05-13 14:16:11 +00:00
Nika Layzell caacb618c0 Bug 1759572 - AsyncLengthWaitHelper should be threadsafe, r=asuth
This works only because the only implementation of nsIAsyncInputStreamLength
happened to only run on the current thread. Bug 1754004, changes this, and requires the reference to be threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D141037
2022-05-13 14:16:08 +00:00
Nika Layzell 7fb91b57a3 Bug 1759563 - Add SerializedComplexity to limit the complexity of serialized IPCStream instances, r=asuth,necko-reviewers,dragana
This will improve the efficiency of serializing large data pipes, which in bad
cases can end up serializing very small amounts of data in individual pipes
over IPC, and acts as a compliment to the existing logic for limiting
serialized message sizes. It is also necessary for the changes in bug 1754004,
which require the ability to include FileDescriptor inline in the message,
which could blow out our FileDescriptor count limits if pipe creation was
unlimited.

In some tests, this change reduces the number of pipes required to serialize a
nsIInputStream from over 5000 to 1.

Differential Revision: https://phabricator.services.mozilla.com/D141036
2022-05-13 14:16:08 +00:00
Nika Layzell 366aafadae Bug 1759569 - Retain nsIInputStreamLength through NS_CloneInputStream, r=asuth
This will help in bug 1754004 as in some cases we will want to clone a
DataPipe, which is non-cloneable, and without this change length information
would be lost.

In the future it might be worth making a more generic mechanism for efficiently
cloning wrapper input streams with a fallback rather than hard-coding this
interface.

Differential Revision: https://phabricator.services.mozilla.com/D141035
2022-05-13 14:16:08 +00:00
Nika Layzell a906eaf6b2 Bug 1754031 - AsyncWait implementations should support updating flags on an existing listener, r=asuth,necko-reviewers,dragana
This operation is often performed by nsAStreamCopier when switching
between the source and sink streams, in order to enable or disable the
WAIT_CLOSURE_ONLY flag. Failing to reset the wait flags can lead to a
NS_AsyncCopy hanging until the source or sink are closed when is
alternating between waiting on input and output streams. This patch
relaxes the incorrect checks on various input streams.

Differential Revision: https://phabricator.services.mozilla.com/D141034
2022-05-13 14:16:07 +00:00
Jonathan Watt 154323f370 Bug 1769113 - Kill off nsIPrintingPromptService and use nsIPrintDialogService directly. r=emilio
nsIPrintingPromptService comes from an era when the platform print code would
open the print settings dialog, which defaulted to the OS native dialogs.
Its purpose was to allow that dialog to be overridden by embedders to provide
their own interface for the user to select print settings. Nowadays the
platform print code does not open the dialogs. Instead apps like Firefox are
responsible for getting the print settings to pass to the platform code, and
the platform code provides a way to open the OS native print dialog if they
want to use that (nsIPrintDialogService). So nsIPrintingPromptService no longer
has any purpose, and just adds indirection and needless complexity.

Differential Revision: https://phabricator.services.mozilla.com/D146232
2022-05-13 11:20:59 +00:00
Butkovits Atila d5e0f927a0 Backed out changeset 9d6d0af194af (bug 1762920) for causing failures at test_crash_manager. CLOSED TREE 2022-05-13 01:44:55 +03:00
Randell Jesup e4786a68a6 Bug 1762920: remove whitelist from xpcom/crashreporter r=nika,gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D142843
2022-05-12 21:07:25 +00:00
Jonathan Watt ebabc1e31f Bug 1768919 - Avoid checking the original document for focus in nsPrintJob. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D146110
2022-05-12 12:06:57 +00:00
Mike Hommey 804a59ffc7 Bug 1768568 - Modify win32 xptcstubs to be clang-only. r=xpcom-reviewers,nika
GCC has been unsupported to build for Windows since bug 1601690.
MSVC has been unsupported since bug 1512504.
We can thus assume that xptcstubs is always compiled with clang.
At the same time, because clang-trunk did an erroneous change to how
it handles __declspec(naked)*, use __attribute__((naked)) instead,
which is clang-only, and handled differently.

[*] https://github.com/llvm/llvm-project/issues/55362

Differential Revision: https://phabricator.services.mozilla.com/D145929
2022-05-11 04:43:42 +00:00
Noemi Erli 45276205df Backed out 22 changesets (bug 1696894, bug 1759569, bug 1754031, bug 1759563, bug 1759572, bug 1754004) for causing leack failures CLOSED TREE
Backed out changeset 673ecd5337e1 (bug 1754004)
Backed out changeset ecbf5f3c51de (bug 1754004)
Backed out changeset fc6c39f56d21 (bug 1754004)
Backed out changeset 5b3d58fbaf9d (bug 1696894)
Backed out changeset 2e56c89cf55d (bug 1754004)
Backed out changeset b7723490f025 (bug 1754004)
Backed out changeset 1dfbf61ff5dd (bug 1754004)
Backed out changeset e73abb071bb3 (bug 1754004)
Backed out changeset f9abe4fbf501 (bug 1754004)
Backed out changeset ee7aeb631cd9 (bug 1754004)
Backed out changeset d66aacfcf983 (bug 1754004)
Backed out changeset 5c2872ad6912 (bug 1754004)
Backed out changeset e1ae48f30d2c (bug 1754004)
Backed out changeset 849b63707d7f (bug 1754004)
Backed out changeset 36563e3b1e04 (bug 1754004)
Backed out changeset ccb4be659107 (bug 1754004)
Backed out changeset 659581d4159b (bug 1754004)
Backed out changeset 611ea76d7a9c (bug 1754004)
Backed out changeset 9b24b561698c (bug 1759572)
Backed out changeset f820e0f209ff (bug 1759563)
Backed out changeset 8d82066fa181 (bug 1759569)
Backed out changeset a2835afab1ad (bug 1754031)
2022-05-11 06:16:25 +03:00
Bas Schouten 19d05fbfba Bug 1767875: Avoid ever waking up more than one thread at a time. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D145962
2022-05-10 23:52:31 +00:00
Nika Layzell d55bc07275 Bug 1754004 - Part 17: Keep pipe streams alive so long as there's a callback registered, r=asuth
If we don't do this, we can encounter issues where we'll spuriously close the
stream when the last reference to the input stream is dropped while an
AsyncWait is still pending.

Differential Revision: https://phabricator.services.mozilla.com/D145672
2022-05-10 22:27:49 +00:00
Nika Layzell 7068e4bbb7 Bug 1754004 - Part 15: Don't track mOriginalInput in nsPipe, r=asuth
As discovered by TSan, this member could be raced on in some edge-cases if
cloned pipe streams raced on multiple threads to be destroyed. This change
instead moves the `nsIPipe` implementation to be on a seperate type from
`nsPipe`, allowing `mOriginalInput` to no longer need to be tracked.

This technically has slightly different behaviour than the previous
implementation for JS code, as code keeping the `nsIPipe` alive will now also
be keeping the output stream reference alive directly, rather than only holding
the `nsIPipe`, meaning that `pipe.outputStream` can be read multiple times
independently without implicitly closing the underlying stream. Based on a
quick read of the few remaining uses of `nsIPipe` in JS code, I don't think
this will be an issue, and it may actually be more intuitive and consistent.

Differential Revision: https://phabricator.services.mozilla.com/D145362
2022-05-10 22:27:48 +00:00
Nika Layzell aa45b7b586 Bug 1754004 - Part 14: Fix potential skipping of async streams in nsMultiplexInputStream, r=asuth
Before this change, we could run into issues when an async stream
accepts new data and queues a runnable to notify the stream listener,
but before that stream listener's runnable is run, the target thread
reads data from the async stream, emptying it of any available data.
This would mean that the stream appears empty in
nsMultiplexInputStream::OnInputStreamReady, and the rest of the stream
is skipped.

This patch changes the logic in OnInputStreamReady to re-call AsyncWait
in those situations and avoid skipping over the empty stream, preventing
data loss.

This situation came up when running some HTTP tests under rr with the
socket process enabled, as the upload stream can both be read due to an
OnInputStreamReady callback and due to other calls in the HTTP
machinery, leading to this potential race. With the socket process
enabled, it is possible for the upload stream to be an async pipe, which
doesn't happen in the parent process due to stream normalization.

This change makes an assumption about the behaviour of streams
implementing `nsIAsyncInputStream` which I believe is correct right now,
and has been documented. I originally had other patches which modified
`Available()`'s definition to add an extra outparameter or added extra
methods, but this seemed much simpler and accurate based on my memory of
having read the Available() implementations for async streams in-tree.

A gtest was added for the failing situation using both nsPipe and DataPipe.

Differential Revision: https://phabricator.services.mozilla.com/D144451
2022-05-10 22:27:47 +00:00
Nika Layzell 024c6e0c0a Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-10 22:27:46 +00:00
Nika Layzell a520c86f48 Bug 1754004 - Part 8: Remove SeekableStreamWrapper, r=asuth,necko-reviewers,kershaw
This type is no longer necessary, and has various issues due to behaving
incorrectly when used with async streams or streams which are not nsIPipe.

Differential Revision: https://phabricator.services.mozilla.com/D141045
2022-05-10 22:27:44 +00:00
Nika Layzell 873f2d6175 Bug 1754004 - Part 7: Consistently normalize upload streams passed to HTTP channels, r=asuth,necko-reviewers,dragana
Unfortunately, upload streams used by necko have various odd behaviours
and requirements which happened to be usually preserved by the previous
IPC serialization logic, but were not consistently preserved. This
includes requiring the stream to be synchronous (as some consumers such
as WebExtensions and DevTools appear to read it assuming Available() is
the stream length), seekable (as it needs to be rewound in various
places), and cloneable (as the stream information is often handed out to
other components).

In addition, the WebExtension WebRequest code makes assumptions about
the specific topology of the input stream for optimization purposes,
meaning that nsMultiplexInputStreams need to be preserved.

The way this was previously handled was by copying the entire payload
into a nsStorageStream as an async operation. This happened very
infrequently in out test suite, however, and had some issues. It could
lead to data loss if the stream was a nsMIMEInputStream (as the metadata
would be lost), and would destroy the topology required by WebRequest.

This patch changes the code to instead manually walk and replace streams
in the input stream's data structure, to efficiently copy only the
required data, preserve the invariants, and make the type seekable
before AsyncOpen continues. This helps keep the complexity of the
invariants HTTPChannel depends on out of generic input stream handling
code.

In addition, due to how early this happens, it replaces the need for
PartiallySeekableInputStream which will be removed a later part.

Differential Revision: https://phabricator.services.mozilla.com/D141044
2022-05-10 22:27:44 +00:00