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

806 Коммитов

Автор SHA1 Сообщение Дата
Mark Banner dcf3abed55 Bug 1788038 - Turn on ESLint rule for prefer-boolean-length-check for netwerk. r=necko-reviewers,dragana
Depends on D155965

Differential Revision: https://phabricator.services.mozilla.com/D155966
2022-09-05 22:01:07 +00:00
Manuel Bucher 25837aaf2e Bug 1787729 - Move NS_HasRootDomain, CheckForBrokenChromeURL, IsCoepCredentiallessEnabled to mozilla::net namespace r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D155992
2022-08-31 11:19:14 +00:00
Valentin Gosu 7e916cece1 Bug 1785018 - Avoid data race when calling GetParent for nsLocalFileUnix r=necko-reviewers,kershaw
We avoid the race by cloning the file before calling GetParent, to avoid
writing to mCacheDirectory's buffer on the main thread during shutdown,
when called from SyncRemoveAllCacheFiles.

Additionally, we dispatch OnDelayedStartupFinished to the IO thread
to avoid accessing mCacheDirectory on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D155798
2022-08-31 09:59:32 +00:00
edguloien 6f463ede32 Bug 1745972 - Dispatch cache wrapper deletion to caller thread to acquire lock before deletion and safety-removal from frecency array. r=kershaw,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D151764
2022-08-29 17:29:32 +00:00
Dana Keeler ed171d40cf Bug 1784098 - make nsICacheEntry.securityInfo explicit as nsITransportSecurityInfo r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D154472
2022-08-23 03:37:18 +00:00
Narcis Beleuzu 5fb7ed6946 Backed out 4 changesets (bug 1784098) for bustages on nsCOMPtr.h . CLOSED TREE
Backed out changeset d22ac7bcb472 (bug 1784098)
Backed out changeset a97052238dba (bug 1784098)
Backed out changeset a2bb8ecd6170 (bug 1784098)
Backed out changeset 16ab6547619c (bug 1784098)
2022-08-22 20:50:21 +03:00
Dana Keeler 51aa6b77a8 Bug 1784098 - make nsICacheEntry.securityInfo explicit as nsITransportSecurityInfo r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D154472
2022-08-22 16:32:02 +00:00
Valentin Gosu 6389d6bc6c Bug 1705676 - Use CachePurgeLock to prevent multiple background tasks deleting the same folder. r=nalexander,necko-reviewers,dragana
This patch uses a CachePurgeLock for every directory it deletes.
Because we can't possibly know if a folder was already deleted before we
aquire the lock or if it never existed (without the use of a log file) we
can assume that if a folder isn't there after the timeout has expired it's
already been purged by a different cleanup task.

Depends on D132164

Differential Revision: https://phabricator.services.mozilla.com/D132165
2022-08-15 07:07:46 +00:00
Valentin Gosu aaeda3ef3b Bug 1705676 - Add CachePurgeLock to lock access to the purged cache directory r=nalexander,necko-reviewers,dragana
Depends on D132595

Differential Revision: https://phabricator.services.mozilla.com/D132164
2022-08-15 07:07:45 +00:00
Valentin Gosu 00ed953e23 Bug 1705676 - Purge HTTP disk cache using backgroundtasks (out-of-process) r=nalexander,necko-reviewers,dragana
Purge HTTP disk cache using backgroundtasks

Motivation:

In the History settings preferences panel you may choose to
`Clear History when Firefox closes` - which sets the
`privacy.sanitize.sanitizeOnShutdown` pref.
If the `Cache` checkbox is also checked it sets the
`privacy.clearOnShutdown.cache` pref to true.

When both of these prefs are true `CacheObserver::ClearCacheOnShutdown()`
will return true, which will cause Firefox to clear the HTTP disk cache
during shutdown. This will block shutdown for howeverlong this takes. If the
user has a slow disk, or the user is on Windows and something is blocking the
deletion of those files, this will trigger a shutdown hang making Firefox
crash. This leads to a bad user experience as trying to start Firefox again
during this time will show the "Firefox is already running message".
Eventually a crash dump is produced. Bug 1356853 and bug 1682899 are caused
by this specific issue.

In order to avoid these crashes and a bad user experience we have
a few options:

1. Completely disable the disk cache when a user checks this box.
  This option will degrade the user's browsing experience.
2. Don't delete the folder at shutdown
  Whether we do this by removing the checkbox or simply not respecting
  the pref value, users who already have this setting would be surprised
  if the cache folder stops being deleted.
3. Use a thread pool to delete the files
  While it's likely to speed up the deletion at least a little bit,
  this would introduce additional complexity while not completely
  fixing the issue. A slow disk will still block shutdown.
4. Delete the cache at shutdown using a separate process
  This is likely the best option. It has the advantage of not blocking
  shutdown while at the same time maintaining similar properties to the
  existing functionality:
  - The cache folder is deleted at shutdown.
  - Has the same behaviour if Firefox gets killed or crashes for different issues.
  - Behaves similarly if the OS is forcefully shutdown during or before we begin to purge.
  - Additionaly, because we rename the folder prior to dispatching the background task, if the purging isn't completed we
    - don't rebuild the cache from an incomplete folder on next restart
    - are able to resume the purging after Firefox startup

A particularly special case is the Windows shutdown.
If the user shuts down windows that will try to close Firefox. If the shutdown
takes too long, the user will see the "Close anyway" button and may click
it thus preventing the cache purge to complete.
When using a background task we have a similar situation, but the button won't
even appear. So after the next Firefox restart we will check if the cache
needs to be purged.

Largely, the new behaviour will be:
- At shutdown we conditionally dispatch a background task to delete the folder
- If creating the process fails (for some reason) we fallback to the old way
  of synchronously deleting the folder.
- The task will then try to delete the folder in the background
- If for some reason it fails, we will dispatch a new background task shortly
  after Firefox restarts to clean up the old folders.

Differential Revision: https://phabricator.services.mozilla.com/D126339
2022-08-15 07:07:45 +00:00
Bryan Thrall 89d1e07b8b Bug 1768679 - Add 'Alt Data size' column to about:cache r=necko-reviewers,dragana
In CacheFileIOManager::GetEntryInfo(), there is only a problem if the Alt Data
element is present but we can't parse a reasonable value out of it (a value
smaller than the metadata offset).

Differential Revision: https://phabricator.services.mozilla.com/D146467
2022-08-04 16:20:17 +00:00
Bryan Thrall f9c451035e Bug 1768679 - Expose cache fetch count as uint32_t r=dragana,necko-reviewers
The value is stored as uint32_t, and there doesn't seem to be a need to convert
it to int.

Differential Revision: https://phabricator.services.mozilla.com/D147888
2022-08-04 16:20:17 +00:00
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Serge Guelton daee4de4d2 Bug 1769027 - Cleanup netwerk includes r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D146164
2022-05-30 14:21:13 +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
Jan Rio Krause 057785b6d5 Bug 1519200 - Remove `NS_ERROR_FILE_TARGET_DOES_NOT_EXIST` in favor of `NS_ERROR_FILE_NOT_FOUND`. r=xpcom-reviewers,nika,dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D77575
2022-04-05 15:17:03 +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
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Kershaw Chang ca859523ff Bug 1745972 - Check if CacheIndexRecordWrapper is still in mFrecencyArray, r=necko-reviewers,valentin
The idea in this patch is like D99680, but the difference is that mFrecencyArray now contains CacheIndexRecordWrapper.
This should be able to help us track why CacheIndexRecordWrapper is released before removing it from mFrecencyArray.

Differential Revision: https://phabricator.services.mozilla.com/D139469
2022-03-11 19:40:44 +00:00
Randell Jesup 60e3d370b3 Bug 1757258: CacheFileUtils cleanup r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D139782
2022-02-26 17:44:33 +00:00
Randell Jesup 6ef1621b21 Bug 1747439: netwerk/cache2 cleanup r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D135167
2022-01-12 20:38:37 +00:00
Marian-Vasile Laza 205e4f70a7 Backed out changeset 7c1a1109d729 (bug 1747439) for causing build bustages on CacheEntry.cpp. CLOSED TREE 2022-01-12 16:52:24 +02:00
Randell Jesup 4037dc1397 Bug 1747439: netwerk/cache2 cleanup r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D135167
2022-01-12 13:54:01 +00:00
Randell Jesup 3a919a88f1 Bug 1746875: netwerk/cache memory reporter cleanup r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D134294
2021-12-21 22:52:17 +00:00
Valentin Gosu ed77e7c029 Bug 1692299 - tsan race on CacheEntry::mIsDoomed r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D133201
2021-12-08 15:06:03 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +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 cc8b1ac579 Bug 1735299 - Use fewer NS_ADDREF in netwerk/ r=nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D128176
2021-10-19 13:44:24 +00:00
Valentin Gosu 0cbc1f290d Bug 1312057 - Fix prefetch telmetry r=mayhemer,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D11518
2021-10-12 15:41:15 +00:00
Valentin Gosu 0504488366 Bug 1731054 - Reenable bug1708673 without perf regression r=necko-reviewers,kershaw
Depends on D126360

Differential Revision: https://phabricator.services.mozilla.com/D126361
2021-09-28 07:08:28 +00:00
Kershaw Chang 25350b4da3 Bug 1615017 - Use a wrapped lock to protect data in CacheFileMetadata, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D126650
2021-09-27 20:59:17 +00:00
Valentin Gosu e41b7a871b Bug 1732095 - Remove unused nsICacheStorageService.synthesizedCacheStorage r=necko-reviewers,kershaw
Depends on D126357

Differential Revision: https://phabricator.services.mozilla.com/D126360
2021-09-23 09:14:19 +00:00
Valentin Gosu d99d6259ee Bug 1732095 - Clean up CacheStorageService r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D126357
2021-09-23 09:14:19 +00:00
Valentin Gosu a80ffb44aa Bug 1729717 - Remove unused nsDeleteDir helpers r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D124925
2021-09-13 12:07:38 +00:00
Valentin Gosu e209403593 Bug 1729717 - Remove unused CleanupCacheDirectories r=necko-reviewers,dragana
This was used previously when switching between cache backend versions.

Differential Revision: https://phabricator.services.mozilla.com/D124922
2021-09-13 12:07:37 +00:00
Csoregi Natalia 2ecacd2e2d Backed out 2 changesets (bug 1729717) for causing assertion failures on CacheObserver.cpp. CLOSED TREE
Backed out changeset 7123efe825f0 (bug 1729717)
Backed out changeset 92e06bd625c9 (bug 1729717)
2021-09-13 12:40:11 +03:00
Valentin Gosu 4ee56c10e6 Bug 1729717 - Remove unused nsDeleteDir helpers r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D124925
2021-09-13 09:12:35 +00:00
Valentin Gosu fc6cd46e34 Bug 1729717 - Remove unused CleanupCacheDirectories r=necko-reviewers,dragana
This was used previously when switching between cache backend versions.

Differential Revision: https://phabricator.services.mozilla.com/D124922
2021-09-13 09:12:34 +00:00
Paul Zuehlcke 6eb0d4fb20 Bug 1714608 - Cleaned up partitionKey base domain helpers. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D118724
2021-07-07 16:05:06 +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
Paul Zuehlcke 2e06ca7e1c Bug 1705030 - Added NetworkCacheCleaner deleteByBaseDomain. r=necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D113128
2021-06-24 09:13:30 +00:00