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

2384 Коммитов

Автор SHA1 Сообщение Дата
Andreea Pavel ed05ed7ebb Bug 1422219 - disable ThreadUtils.IdleRunnableMethod due to frequent failures r=intermittent-reviewers,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D134762
2021-12-31 18:18:58 +00:00
Barret Rennie 772d29da89 Bug 1736331 - Add nsILocalFileMac methods for interacting with extended attributes r=nika
This patch adds support for setting, getting, and reading extended filesystem
attributes on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D133836
2021-12-25 00:30:10 +00:00
Butkovits Atila 1ce2eea394 Backed out 2 changesets (bug 1736331) for causing failures at test_ioutils_mac_xattr.html. CLOSED TREE
Backed out changeset 3d627a038faa (bug 1736331)
Backed out changeset b0df890ed09e (bug 1736331)
2021-12-24 03:26:45 +02:00
Barret Rennie f93fd9cc79 Bug 1736331 - Add nsILocalFileMac methods for interacting with extended attributes r=nika
This patch adds support for setting, getting, and reading extended filesystem
attributes on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D133836
2021-12-23 23:02:13 +00:00
Sandor Molnar 8032ae5c31 Backed out 2 changesets (bug 1736331) for causing build bustages in IOUtils. CLOSED TREE
Backed out changeset 5745c2669e88 (bug 1736331)
Backed out changeset 0a34c502e65f (bug 1736331)
2021-12-22 22:04:10 +02:00
Barret Rennie de949e8aca Bug 1736331 - Add nsILocalFileMac methods for interacting with extended attributes r=nika
This patch adds support for setting, getting, and reading extended filesystem
attributes on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D133836
2021-12-22 19:46:15 +00:00
Csoregi Natalia cbfb9e9a8e Backed out 2 changesets (bug 1736331) for bustage on IOUtils.webidl CLOSED TREE
Backed out changeset 293085bdd5a1 (bug 1736331)
Backed out changeset 275621f46891 (bug 1736331)
2021-12-22 19:09:54 +02:00
Barret Rennie 83aee913ba Bug 1736331 - Add nsILocalFileMac methods for interacting with extended attributes r=nika
This patch adds support for setting, getting, and reading extended filesystem
attributes on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D133836
2021-12-22 16:40:52 +00:00
Nika Layzell 7b2e6d4996 Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131422
2021-12-13 21:47:56 +00:00
Jari Jalkanen 986851e08e Bug 1740212 - Get disk capacity on Windows. r=dom-storage-reviewers,janv,xpcom-reviewers,nika DONTBUILD
Depends on D130640

Differential Revision: https://phabricator.services.mozilla.com/D130908
2021-12-08 16:08:03 +00:00
Jan Varga 1a3d2b084c Bug 1735717 - Add a way for getting information about total disk space (disk capacity); r=dom-storage-reviewers,jari,xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D130640
2021-12-08 14:41:38 +00:00
Randell Jesup 08f296ee63 Bug 1743895: Add names to all TaskQueues, remove no-name constructor r=nika,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D132638
2021-12-03 03:16:15 +00:00
kriswright df91a347b4 Bug 1532955 - Track available memory on linux. r=gsvelto,tkikuchi
This introduces a low memory watcher that dispatches an offthread read of /proc/meminfo every 5000/1000ms depending on memory levels, then determines which information to act on. It works like this:
- Get a percentage of `MemAvailable` versus `MemTotal`.
- If memory drops below 5% availability, we are in a memory pressure scenario
- If `MemAvailable` is not large enough to accommodate a content process, we are in a memory pressure scenario
- If we are in a memory pressure scenario, notify the observers from the main thread.

The value I decided to use to represent a content process was based on observation and should be adjusted if it is not representative of what we consider a "typical" content process.

Differential Revision: https://phabricator.services.mozilla.com/D117972
2021-12-02 11:14:30 +00:00
Noemi Erli c25daf6c77 Backed out changeset 4b8b155c97a5 (bug 1532955) for causing build bustage in TestAvailableMemoryWatcherLinux.cpp CLOSED TREE 2021-12-02 12:24:03 +02:00
kriswright 58551a6795 Bug 1532955 - Track available memory on linux. r=gsvelto,tkikuchi
This introduces a low memory watcher that dispatches an offthread read of /proc/meminfo every 5000/1000ms depending on memory levels, then determines which information to act on. It works like this:
- Get a percentage of `MemAvailable` versus `MemTotal`.
- If memory drops below 5% availability, we are in a memory pressure scenario
- If `MemAvailable` is not large enough to accommodate a content process, we are in a memory pressure scenario
- If we are in a memory pressure scenario, notify the observers from the main thread.

The value I decided to use to represent a content process was based on observation and should be adjusted if it is not representative of what we consider a "typical" content process.

Differential Revision: https://phabricator.services.mozilla.com/D117972
2021-12-02 07:16:50 +00:00
Csoregi Natalia 5d43115f90 Backed out changeset 44b7971a0893 (bug 1532955) for bustage on AvailableMemoryWatcher.cpp and other failures. CLOSED TREE 2021-12-01 22:40:47 +02:00
kriswright 6c2438cacc Bug 1532955 - Track available memory on linux. r=gsvelto,tkikuchi
This introduces a low memory watcher that dispatches an offthread read of /proc/meminfo every 5000/1000ms depending on memory levels, then determines which information to act on. It works like this:
- Get a percentage of `MemAvailable` versus `MemTotal`.
- If memory drops below 5% availability, we are in a memory pressure scenario
- If `MemAvailable` is not large enough to accommodate a content process, we are in a memory pressure scenario
- If we are in a memory pressure scenario, notify the observers from the main thread.

The value I decided to use to represent a content process was based on observation and should be adjusted if it is not representative of what we consider a "typical" content process.

Differential Revision: https://phabricator.services.mozilla.com/D117972
2021-12-01 19:12:31 +00:00
Mike Hommey fcb58fa3cf Bug 1703554 - Use jemalloc_ptr_info as validation step in AllocReplacement tests. r=xpcom-reviewers,mccr8
Those AllocReplacement tests have been going intermittent on and off for
a while. See bug 1556754, bug 1554330, bug 1475411, bug 1544926, bug
1732998, bug 1730436.

The last non-whitespace change to the test file was bug 1433015 which
was filed for the exact same problem, but the patch didn't actually do
what it was advertizing to be doing: adding "DeathTest" to the test
names doesn't turn them into death tests.

Actually turning them into death tests doesn't fix the tests either, in
fact, it would tend to make things worse because death tests run in a
subprocess, and that subprocess runs a bunch of initialization code
including initializing threads, and all the initialization code adds
chances to race with these threads.

I'm not sure exactly why bug 1696504 makes things worse, but overall,
the problem is that these tests assume they are alone running, but they
aren't, and allocations/deallocations happening in other threads do
break the tests (IOW, the comment saying that it doesn't seem to be a
problem in practice is unfortunately wrong or outdated).

Since bug 1254779, which added these tests, things have changed, though,
and we now have another way to validate whether an allocation comes from
jemalloc or not.

Also completely disable the test when not building with jemalloc because
it's not doing anything useful (and jemalloc_ptr_info is not available
in that case).

Differential Revision: https://phabricator.services.mozilla.com/D131999
2021-11-24 21:15:48 +00:00
Andi-Bogdan Postelnicu 1faa3d40cf Bug 1519636 - Reformat recent changes to the Google coding style. r=firefox-build-system-reviewers,mhentges,sylvestre
Reformat with clang-format version 12.0.1 (taskcluster-FYV2l5wGTseBAhiqf8cxfQ)

Differential Revision: https://phabricator.services.mozilla.com/D131114
2021-11-16 08:07:29 +00:00
Haik Aftandilian 3cf27e9320 Bug 1737854 - macOS 'Share' menu modifies URL such that shared page doesn't load r=necko-reviewers,mstange,valentin
Revert some of the fix for 1722758 so that only the URL ref component is re-encoded for NSURL compatibility. Other URL fields need additional work to be addressed in a follow up.

Update the set of characters re-encoded to be as minimal as possible and include missing characters.

Add tests to ensure encoding works as expected, not just that it is accepted by NSURL.

Differential Revision: https://phabricator.services.mozilla.com/D130445
2021-11-10 19:32:53 +00:00
Agi Sferro 8c6612b46b Bug 1738966 - Pass in argc, argv in GreOmniPath. r=kershaw,valentin
A call to InitCommandLine was added in Bug 1727180 where gArgc and gArgv are
not defined.

The same bug also re-enabled some tests that appeared to pass (but really they
were just silently crashing), this patch fixes that too.

Differential Revision: https://phabricator.services.mozilla.com/D130223
2021-11-03 16:31:06 +00:00
Andreas Pehrson 006d770a5f Bug 1529581 - Introduce initHighResolutionWithNamedFuncCallback for nsITimer. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D129654
2021-11-03 15:23:27 +00:00
Kershaw Chang 34f9cb2633 Bug 1727180 - Call XRE_InitCommandLine for xpcshell, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D124890
2021-11-02 16:01:10 +00:00
Iulian Moraru 4008be6b81 Backed out 10 changesets (bug 1529581) for causing bp-hybrid build bustages on TestPacer. CLOSED TREE
Backed out changeset e7b7072ac90c (bug 1529581)
Backed out changeset 3c5d719c54db (bug 1529581)
Backed out changeset 39e2b3143ecd (bug 1529581)
Backed out changeset bd2122ea3cc3 (bug 1529581)
Backed out changeset 033cc341ad2e (bug 1529581)
Backed out changeset 8a8ee5055c0d (bug 1529581)
Backed out changeset 8c204db3e91d (bug 1529581)
Backed out changeset 142d94304c86 (bug 1529581)
Backed out changeset ac180bf89fd0 (bug 1529581)
Backed out changeset d0640f52161d (bug 1529581)
2021-11-02 17:53:17 +02:00
Andreas Pehrson b9f92d2e95 Bug 1529581 - Introduce initHighResolutionWithNamedFuncCallback for nsITimer. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D129654
2021-11-02 14:35:58 +00:00
Riya c45c0f507e Bug 1730126 - Enable ESLint rule no-loss-of-precision. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D129336
2021-10-29 08:29:26 +00:00
Haik Aftandilian 129adcc9a3 Bug 1730066 - Enable tab unloading on macOS r=spohl
Enable tab unloading on macOS when the OS memory pressure level reaches "critical".

Add a gtest that exercises the memory pressure response by testing that a tab unload attempt occurs and the internal memory-pressure notification is sent. Test does not cause a real OS memory pressure event.

Use the memory_pressure(1) macOS command to generate artificial memory pressure events to test the browser response. For example, the following artificially puts the OS in the "critical" memory pressure level for 60 seconds.

`$ sudo memory_pressure -S -l critical -s 60`

Differential Revision: https://phabricator.services.mozilla.com/D126560
2021-10-21 04:43:35 +00:00
Jon Coppeard db96c56df8 Bug 1536061 - Part 4: Add some tests for incremental iteration of the holder map r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D127679
2021-10-10 11:06:51 +00:00
Jon Coppeard f001c8f0fe Bug 1734362 - Add some tests for JS holder / GC integration r=mccr8
This tests that JS holders get marked gray by GC and updated when moved by
compacting GC. The latter would have caught the problem reported in bug
1731432.

Differential Revision: https://phabricator.services.mozilla.com/D127670
2021-10-08 14:00:02 +00:00
Csoregi Natalia 03c4091654 Backed out 5 changesets (bug 1734392, bug 1734362) for bustages on TestJSHolderMap.cpp. CLOSED TREE
Backed out changeset 53f7d8f6758a (bug 1734392)
Backed out changeset c55d9ca8c869 (bug 1734392)
Backed out changeset cd61ff016587 (bug 1734392)
Backed out changeset 211f5803783a (bug 1734362)
Backed out changeset 5f118a3deafc (bug 1734362)
2021-10-08 14:45:33 +03:00
Jon Coppeard 835249bd4a Bug 1734362 - Add some tests for JS holder / GC integration r=mccr8
This tests that JS holders get marked gray by GC and updated when moved by
compacting GC. The latter would have caught the problem reported in bug
1731432.

Differential Revision: https://phabricator.services.mozilla.com/D127670
2021-10-08 08:53:28 +00:00
Jens Stutte 7700e81876 Bug 1731564: Use motivated SpinEventLoopUntil inside xpcom/*. r=xpcom-reviewers,nika
Depends on D127236

Differential Revision: https://phabricator.services.mozilla.com/D127237
2021-10-07 08:06:16 +00:00
Marian-Vasile Laza 18fb16c542 Backed out 18 changesets (bug 1731564) for causing build bustages on SpinEventLoopUntil. CLOSED TREE
Backed out changeset 0464dbdc8584 (bug 1731564)
Backed out changeset 0d996df13545 (bug 1731564)
Backed out changeset 5630a0e7a109 (bug 1731564)
Backed out changeset 37b41d187cdb (bug 1731564)
Backed out changeset d37700fa60b6 (bug 1731564)
Backed out changeset b0ce7db44b99 (bug 1731564)
Backed out changeset aa5ec3aa1535 (bug 1731564)
Backed out changeset 73b648f1fa70 (bug 1731564)
Backed out changeset bb8fb0f9833e (bug 1731564)
Backed out changeset 0d8905144f5d (bug 1731564)
Backed out changeset 2cfb094a1ec3 (bug 1731564)
Backed out changeset 78d3b0257a6a (bug 1731564)
Backed out changeset e9d32926e93c (bug 1731564)
Backed out changeset 874cab520ce5 (bug 1731564)
Backed out changeset d8071cc32bd9 (bug 1731564)
Backed out changeset 283c5393cbbc (bug 1731564)
Backed out changeset 317bc38e3de5 (bug 1731564)
Backed out changeset 53e3f4862439 (bug 1731564)
2021-10-07 00:09:19 +03:00
Jens Stutte 7737c4488a Bug 1731564: Use motivated SpinEventLoopUntil inside xpcom/*. r=xpcom-reviewers,nika
Depends on D127236

Differential Revision: https://phabricator.services.mozilla.com/D127237
2021-10-06 19:45:18 +00:00
Mike Hommey 845953db24 Bug 1733308 - Allow to disable unified builds in xpcom/tests/windows. r=firefox-build-system-reviewers,andi
There's nothing wrong there.

Differential Revision: https://phabricator.services.mozilla.com/D127043
2021-10-01 01:49:19 +00:00
Mike Hommey 2d21eb6e9e Bug 1733308 - Fix non-unified builds errors in xpcom/tests/gtest. r=xpcom-reviewers,mccr8
objdir/dist/include/mozilla/Queue.h:251:31: error: use of undeclared identifier 'moz_xcalloc'
xpcom/base/nsCOMPtr.h:436:5: error: static_assert failed due to requirement '1 < sizeof (TestForIID<nsIEventTarget>(nullptr))' "nsCOMPtr only works for types with IIDs.  Either use RefPtr; add an IID to your type with NS_DECLARE_STATIC_IID_ACCESSOR/NS_DEFINE_STATIC_IID_ACCESSOR; or make the nsCOMPtr point to a base class with an IID."
xpcom/tests/gtest/TestDelayedRunnable.cpp:16:28: error: field has incomplete type '(anonymous namespace)::ReleaseDetector'
xpcom/tests/gtest/TestDelayedRunnable.cpp:16:3: error: 'explicit' can only appear on non-static member functions
xpcom/tests/gtest/TestDelayedRunnable.cpp:16:40: error: expected ')'
xpcom/tests/gtest/TestDelayedRunnable.cpp:16:61: error: use of undeclared identifier 'aActive'
xpcom/tests/gtest/TestDelayedRunnable.cpp:28:3: error: no template named 'Atomic'; did you mean 'mozilla::Atomic'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:34:3: error: no template named 'Atomic'; did you mean 'mozilla::Atomic'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:36:18: error: use of undeclared identifier 'TaskQueue'; did you mean 'taskQueue'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:36:18: error: variable 'taskQueue' declared with deduced type 'auto' cannot appear in its own initializer
xpcom/tests/gtest/TestDelayedRunnable.cpp:36:48: error: use of undeclared identifier 'MediaThreadType'
xpcom/tests/gtest/TestDelayedRunnable.cpp:36:48: error: use of undeclared identifier 'MediaThreadType'; did you mean 'mozilla::MediaThreadType'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:38:51: error: no matching conversion for functional-style cast from 'Atomic<bool> *' to '(anonymous namespace)::ReleaseDetector'
xpcom/tests/gtest/TestDelayedRunnable.cpp:54:3: error: no template named 'Atomic'; did you mean 'mozilla::Atomic'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:58:51: error: no matching conversion for functional-style cast from 'Atomic<bool> *' to '(anonymous namespace)::ReleaseDetector'
xpcom/tests/gtest/TestDelayedRunnable.cpp:88:3: error: use of undeclared identifier 'Unused'; did you mean 'mozilla::Unused'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:104:3: error: use of undeclared identifier 'Unused'; did you mean 'mozilla::Unused'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:109:10: error: unknown type name 'SharedThreadPool'; did you mean 'mozilla::SharedThreadPool'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:109:35: error: use of undeclared identifier 'SharedThreadPool'
xpcom/tests/gtest/TestDelayedRunnable.cpp:109:35: error: use of undeclared identifier 'SharedThreadPool'; did you mean 'mozilla::SharedThreadPool'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:110:25: error: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [-Werror,-Wc++20-extensions]
xpcom/tests/gtest/TestDelayedRunnable.cpp:110:36: error: unknown type name 'TaskQueue'; did you mean 'mozilla::TaskQueue'?
xpcom/tests/gtest/TestDelayedRunnable.cpp:112:36: error: unknown type name 'TaskQueue'; did you mean 'mozilla::TaskQueue'?
xpcom/tests/gtest/TestFileNTFSSpecialPaths.cpp:18:28: error: use of undeclared identifier 'do_CreateInstance'
xpcom/tests/gtest/TestFileNTFSSpecialPaths.cpp:26:28: error: use of undeclared identifier 'do_CreateInstance'
xpcom/tests/gtest/TestFileNTFSSpecialPaths.cpp:39:28: error: use of undeclared identifier 'do_CreateInstance'
xpcom/tests/gtest/TestFileNTFSSpecialPaths.cpp:279:28: error: use of undeclared identifier 'do_CreateInstance'
xpcom/tests/gtest/TestFilePreferencesWin.cpp:113:26: error: use of undeclared identifier 'do_CreateInstance'
xpcom/tests/gtest/TestFilePreferencesWin.cpp:140:26: error: use of undeclared identifier 'do_CreateInstance'
xpcom/tests/gtest/TestFilePreferencesWin.cpp:156:31: error: use of undeclared identifier 'NS_OS_TEMP_DIR'
xpcom/tests/gtest/TestJSHolderMap.cpp:50:28: error: unknown type name 'JSHolderMap'
xpcom/tests/gtest/TestJSHolderMap.cpp:52:35: error: use of undeclared identifier 'i'
xpcom/tests/gtest/TestJSHolderMap.cpp:52:45: error: use of undeclared identifier 'i'
xpcom/tests/gtest/TestJSHolderMap.cpp:52:8: error: use of undeclared identifier 'JSHolderMap'
xpcom/tests/gtest/TestJSHolderMap.cpp:52:8: error: use of undeclared identifier 'JSHolderMap'; did you mean 'mozilla::JSHolderMap'?
xpcom/tests/gtest/TestJSHolderMap.cpp:53:24: error: use of undeclared identifier 'i'
xpcom/tests/gtest/TestJSHolderMap.cpp:54:24: error: use of undeclared identifier 'i'
xpcom/tests/gtest/TestJSHolderMap.cpp:68:3: error: unknown type name 'JSHolderMap'; did you mean 'mozilla::JSHolderMap'?
xpcom/tests/gtest/TestJSHolderMap.cpp:73:3: error: unknown type name 'JSHolderMap'; did you mean 'mozilla::JSHolderMap'?
xpcom/tests/gtest/TestJSHolderMap.cpp:99:3: error: unknown type name 'JSHolderMap'; did you mean 'mozilla::JSHolderMap'?
xpcom/tests/gtest/TestJSHolderMap.cpp:104:9: error: use of undeclared identifier 'JSHolderMap'
xpcom/tests/gtest/TestJSHolderMap.cpp:104:9: error: use of undeclared identifier 'JSHolderMap'; did you mean 'mozilla::JSHolderMap'?
xpcom/tests/gtest/TestJSHolderMap.cpp:125:41: error: use of undeclared identifier 'MakeUnique'
xpcom/tests/gtest/TestJSHolderMap.cpp:147:3: error: unknown type name 'JSHolderMap'; did you mean 'mozilla::JSHolderMap'?
xpcom/tests/gtest/TestJSHolderMap.cpp:151:41: error: use of undeclared identifier 'MakeUnique'
xpcom/tests/gtest/TestRWLock.cpp:92:3: error: no template named 'Maybe'; did you mean 'mozilla::Maybe'?
xpcom/tests/gtest/TestRWLock.cpp:95:23: error: use of undeclared identifier 'SyncRunnable'; did you mean 'mozilla::SyncRunnable'?
xpcom/tests/gtest/TestRWLock.cpp:103:5: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:107:5: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:111:7: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:120:7: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:130:5: error: unknown type name 'AutoWriteLock'; did you mean 'mozilla::AutoWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:133:5: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:137:7: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:142:3: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:146:5: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:155:5: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:159:5: error: unknown type name 'AutoTryReadLock'; did you mean 'mozilla::AutoTryReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:163:7: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:172:7: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:182:5: error: unknown type name 'AutoReadLock'; did you mean 'mozilla::AutoReadLock'?
xpcom/tests/gtest/TestRWLock.cpp:184:5: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:188:7: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:194:5: error: unknown type name 'AutoWriteLock'; did you mean 'mozilla::AutoWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:197:5: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?
xpcom/tests/gtest/TestRWLock.cpp:201:7: error: unknown type name 'AutoTryWriteLock'; did you mean 'mozilla::AutoTryWriteLock'?

Differential Revision: https://phabricator.services.mozilla.com/D127042
2021-10-01 01:49:19 +00:00
Mike Hommey dcfb8d38be Bug 1732208 - Silence the unused-but-set-variable warning in xpcom. r=xpcom-reviewers,mccr8
xpcom/tests/gtest/TestAvailableMemoryWatcherWin.cpp(130,22): error: variable 'x' set but not used [-Werror,-Wunused-but-set-variable]
    volatile uint8_t x = 0;
                     ^
xpcom/tests/gtest/TestAvailableMemoryWatcherWin.cpp(152,12): error: variable 'consumed' set but not used [-Werror,-Wunused-but-set-variable]
    size_t consumed = 0;
           ^
xpcom/tests/gtest/TestSTLWrappers.cpp:48:7: error: variable 'rv' set but not used [-Werror,-Wunused-but-set-variable]
  int rv = 1;
      ^

Differential Revision: https://phabricator.services.mozilla.com/D126462
2021-09-28 00:02:48 +00:00
Jon Coppeard be7071699c Bug 1730534 - Part 5: Add some basic unit tests for JSHolderMap r=mccr8
Depends on D125431

Differential Revision: https://phabricator.services.mozilla.com/D126668
2021-09-27 16:41:53 +00:00
Byron Campen 50c3cf7a3c Bug 1651268: Make sure the pre-run code for FindExpirationTime waits for timers to fire on all threads. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D125603
2021-09-20 16:45:53 +00:00
kriswright e1c01499b6 Bug 1731098 - Include nsIThread in TestMultiplexInputStream.cpp r=xpcom-reviewers,nika
When adding new gtests I came across this build failure:

```
 0:12.59 In file included from Unified_cpp_xpcom_tests_gtest2.cpp:2:
 0:12.59 /home/kriswright/src/mozilla-unified/xpcom/tests/gtest/TestMultiplexInputStream.cpp:349:45: error: no viable conversion from 'nsCOMPtr<nsIThread>' to 'nsIEventTarget *'
```

It looks like this file needs to include nsIThread in its #includes.

Differential Revision: https://phabricator.services.mozilla.com/D125851
2021-09-16 16:56:39 +00:00
Jens Stutte 87de42e070 Bug 1726813: Ensure AppShutdown remains in sync with shutdown notifications in the parent process. r=xpcom-reviewers,nika,dom-worker-reviewers,asuth
The goal here is to ensure we can always rely on `AppShutdown::GetShutdownPhase` to be in sync with the "real" application status, mainly this was needed for xpcshell tests to not break if we add assertions on our shutdown state on some global singletons.

We keep the existing observer notification topics but force them (on the parent process) to be issued through the new `advanceShutdownPhase` function of the startup service using the `ShutdownPhase` enum. This way we can synchronize `AppShutdown`'s internal status accordingly.

Some further notes:

  # The `MOZ_ASSERT(AppShutdown::IsNoOrLegalShutdownTopic(aTopic));` in `NotifyObservers` helped a lot to identify missing cases. I think we should keep it in order to stay safe.
  # Introducing the `cenum IDLShutdownPhase` helps to keep the knowledge about the mapping from shutdown phases to observer topics exclusively inside AppShutdown.cpp. Still callers must know what they do in order to choose a proper phase, of course.
  # However we must be aware that `AppShutdown` this way can be kept in sync with the shutdown notifications only in the parent process and that `GetCurrentShutdownPhase` might not give the correct result in child processes. We might want to file a follow up bug that adds some asserts to avoid improper use of `AppShutdown` functions in child processes (but I do not want to make this patch bigger as needed to solve the blocking dependency for bug 1697972).
  # The socket process is one example of a child process that "overloads" shutdown topics. I was wondering if it is the right call to use the very same topic names here to request shutdown to the socket process or if it should have its own topics. Those topics triggered the assert and thus I had to disable it for child processes, for now.
  # This goes together with the more general approach to define process type specific shutdown phases (and hence mappings to topics) as drafted very roughly in bug 1697745.
  # This patch seemed to trigger a known intermittent more often, thus the change here in `ServiceWorkerManager`.

Differential Revision: https://phabricator.services.mozilla.com/D124350
2021-09-15 07:25:29 +00:00
Byron Campen 212446b536 Bug 1729921: Cancel with a sync dispatch to the target thread in these tests. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D125118
2021-09-10 19:08:25 +00:00
Gerald Squelart 132dffb9d9 Bug 1663382 - Add NS_Convert... constructors taking a Span - r=florian
Add `NS_ConvertUTF16toUTF8::NS_ConvertUTF16toUTF8(const Span<const char16_t>)` and `NS_ConvertUTF16toUTF8::NS_ConvertUTF8toUTF16(const Span<const char>)` explicit constructors.
This is consistent with `NS_ConvertASCIItoUTF16` that already had one.
More importantly, other constructors were calling `AppendUTF{16,8}To{8,16}` functions taking a `Span`, so for cases where the caller already has a `Span` it's most efficient to have constructors accepting that `Span` directly.

Differential Revision: https://phabricator.services.mozilla.com/D125146
2021-09-10 11:43:47 +00:00
Andreas Pehrson 4c15c8eb1d Bug 1727563 - Implement TryLock methods and RAII helpers for RWLock. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D124066
2021-09-08 10:40:07 +00:00
Byron Campen [:bwc] 4aee661e93 Bug 1726177: Update IDL file to better reflect previous behavior, and cover this behavior in the test-case. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D123813
2021-09-03 21:59:00 +00:00
Iulian Moraru 28f6ed5050 Backed out 2 changesets (bug 1726177) for causing gtest failures on TestTimers.cpp. CLOSED TREE
Backed out changeset 82ec582992fd (bug 1726177)
Backed out changeset 50952e0327ee (bug 1726177)
2021-09-02 03:09:10 +03:00
Byron Campen [:bwc] d912c972f5 Bug 1726177: Update IDL file to better reflect previous behavior, and cover this behavior in the test-case. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D123813
2021-09-01 21:46:48 +00:00
Cristian Tuns 8410d730ff Backed out changeset 38c2002963c9 bug(1727563) for causing gtest crashes on RWLock. CLOSED TREE DONTBUILD 2021-09-01 06:54:36 -04:00
Andreas Pehrson e6b64b97b1 Bug 1727563 - Implement TryLock methods and RAII helpers for RWLock. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D124066
2021-09-01 10:11:44 +00:00
Andreas Pehrson ca7808acf7 Bug 1727558 - Implement an RAII class for Mutex::TryLock. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D124058
2021-09-01 10:10:24 +00:00