sunil mayya
87ce7b8888
Bug 1845848 - prevent disk cache entries eviction for private browsing mode. r=necko-reviewers,valentin
...
The assertion in the bug is because we were trying to evict disk cache entries in the context of private browsing mode.
Generally, for Private browsing mode we don't write use Disk Storage. During the [initialization](https://searchfox.org/mozilla-central/source/netwerk/cache2/CacheStorageService.cpp#1557 ). of storage entry, WriteToDisk[https://searchfox.org/mozilla-central/rev/5f0a7ca8968ac5cef8846e1d970ef178b8b76dcc/netwerk/cache2/CacheStorage.h#54 ] will be false due to private browsing mode. Due to this, we are sure that private browsing mode cache entries wont be written to disks.
The solution for the bug here is to prevent an attempt to evict the disk cache entries in private browsing mode, similar to the check in [DoomStorageEntries](https://searchfox.org/mozilla-central/source/netwerk/cache2/CacheStorageService.cpp#1929 ).
Differential Revision: https://phabricator.services.mozilla.com/D204810
2024-03-18 08:49:10 +00:00
Jens Stutte
b191ad0177
Bug 1879814 - Rename network.cache.purgebyfrecency_minprogress_xxx to network.cache.purge_minprogress_xxx and use it for all purge variants. r=necko-reviewers,jesup,valentin
...
Disk operations may cause blocking IO, so for now we do not force any minprogress for the disk backed cache.
Differential Revision: https://phabricator.services.mozilla.com/D202172
2024-03-04 08:45:45 +00:00
Jens Stutte
cf5f5378be
Bug 1879800 - Avoid WalkMemoryCacheRunnable::mEntryArray to be shifted on each iteration. r=necko-reviewers,valentin
...
Differential Revision: https://phabricator.services.mozilla.com/D201368
2024-02-13 12:06:06 +00:00
Jens Stutte
14b6314626
Bug 1875859 - Refactor MemoryPool::PurgeExpired and PurgeByFrecency to reduce overhead and protect against races while sorting. r=necko-reviewers,valentin
...
A `CacheEntry`'s `mExpirationTime` and `mFrecency` can be updated asynchronously while sorting. This is at best undefined behavior and at worst it can derail `std::sort`'s algorithm out of bounds.
Looking a bit closer it turns out that sorting for `PurgeExpired` is actually not needed and we can have just a `mManagedEntries` linked list in a memory pool instead of two arrays. This way we can also achieve constant O(1) time for unregistering entries when purging.
`PurgeByFrecency` needs sorting and must ensure to not race with modifications of `mFrecency`. We ensure to make some progress on each run to compensate for the cost of sorting.
We also do `PurgeExpired` always, not only if under memory pressure, as it is cheap (no sorting) and interuptable., as well as an emergency handling if `PurgeByFrecency` failed to allocate the auxiliary sort array.
Differential Revision: https://phabricator.services.mozilla.com/D199955
2024-02-12 12:22:03 +00:00
Andrew Creskey
9ba2232e4a
Bug 1648002 - Intermittent Assertion failure: mInsideLoop in CacheIOThread.cpp r=valentin,necko-reviewers
...
We will no longer dispatch timer events to the cacheIOThread after shutdown as they would not be proccessed (and trigger an assertion in debug builds).
Differential Revision: https://phabricator.services.mozilla.com/D191899
2023-10-26 12:21:48 +00:00
Nika Layzell
30c48eac49
Bug 1839920 - Rename Get{ASCII,UTF}Origin to GetWebExposedOriginSerialization, r=smaug,necko-reviewers,anti-tracking-reviewers,bvandersloot,jesup
...
This should make uses of the type more clearly indicating where the
origin came from, and should help avoid potential confusion between this
origin and nsIPrincipal::origin in new code.
This new name is long, but explicit. The string returned from this
function corresponds to the "serialization of an origin" from the WHATWG
html spec:
https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin
Differential Revision: https://phabricator.services.mozilla.com/D181794
2023-06-27 19:59:15 +00:00
Manuel Bucher
d8f937616b
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
Bryan Thrall
2f998d325f
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
e14eb038c7
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
Randell Jesup
a73984c9ff
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
ee44205723
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
6cd5050b51
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
0e7405b93d
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
85921f4882
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
ecedf26a92
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
Valentin Gosu
c410a1c12f
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
8475937065
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
cfa7ec1bf7
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
200b910915
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
0f56f9b8f3
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
1deb55baa4
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
8cfa7af727
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
10432fde89
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
Paul Zuehlcke
5c8d7ecfa6
Bug 1705030 - Added NetworkCacheCleaner deleteByBaseDomain. r=necko-reviewers
...
Differential Revision: https://phabricator.services.mozilla.com/D113128
2021-06-24 09:13:30 +00:00
Valentin Gosu
ce92a11356
Bug 1708673 - Do not recreate CacheEntry when OPEN_READONLY flag is passed r=necko-reviewers,dragana
...
This bug is caused by two cache visitors working in parallel:
Visitor1: calls asyncDoomURI
Visitor2: calls asyncOpenURI
This causes CacheStorageService::AddStorageEntry to create a new entry and add
it to the hashtable:
https://searchfox.org/mozilla-central/rev/308ea44d0d60b391b031ccee695920bd543f7d2f/netwerk/cache2/CacheStorageService.cpp#1566,1574,1576
Visitor3: will then go through the hashtable and see the newly added entry.
Differential Revision: https://phabricator.services.mozilla.com/D118344
2021-06-22 08:23:36 +00:00
Valentin Gosu
56cd5036af
Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 12:35:16 +00:00
Butkovits Atila
1f3e4dc865
Backed out changeset c4b44c4ef15b (bug 1714307) for causing build bustages on nsHTTPCompressConv.h. CLOSED TREE
2021-06-04 13:53:37 +03:00
Valentin Gosu
5b4ead87fd
Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 10:00:55 +00:00
Valentin Gosu
25a3a97fbb
Bug 1694662 - Remove old cache implementation r=necko-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D106456
2021-04-30 07:20:24 +00:00
Valentin Gosu
b48d0f6ea6
Bug 1694662 - Remove Appcachestorage & oldwrappers r=necko-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D106455
2021-04-30 07:20:24 +00:00
Valentin Gosu
e0c404c065
Bug 1694662 - Remove appcache storage attribute r=necko-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D106454
2021-04-30 07:20:23 +00:00
Simon Giesecke
9e995a79e8
Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
...
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Simon Giesecke
a34c1d671f
Bug 1184468 - Use nsTHashtable::Keys where possible in netwerk. r=necko-reviewers,valentin
...
Differential Revision: https://phabricator.services.mozilla.com/D106950
2021-03-24 17:51:12 +00:00
Csoregi Natalia
37fe7677dd
Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
...
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke
a4404d84e8
Bug 1184468 - Use nsTHashtable::Keys where possible in netwerk. r=necko-reviewers,valentin
...
Differential Revision: https://phabricator.services.mozilla.com/D106950
2021-03-24 16:58:57 +00:00
Simon Giesecke
86e29e162f
Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
...
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
Simon Giesecke
95c38cc6b8
Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
...
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.
Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke
7c075f27d9
Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
...
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).
Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Simon Giesecke
3c36abd9aa
Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
...
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-16 15:53:33 +00:00
Simon Giesecke
8adc4d231c
Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
...
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 15:12:17 +00:00
smolnar
03bc7728ba
Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
...
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke
f04f372040
Bug 1691894 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
...
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-15 10:04:46 +00:00
Simon Giesecke
1a0fd1ffb7
Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
...
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 10:04:45 +00:00
Alexis Beingessner
d4ff1589b5
Bug 1633239 - make the bitfields on CacheStorageService atomic. r=valentin,necko-reviewers
...
this is only a hypothetical fix to the underlying issue since we don't have a clean trace.
Differential Revision: https://phabricator.services.mozilla.com/D103057
2021-01-28 11:05:02 +00:00
David Major
9829f29105
Bug 1688292 - Fix non-unified build errors in netwerk/cache2/ r=necko-reviewers,valentin
...
This is a drive-by fix while I was looking into something else.
Differential Revision: https://phabricator.services.mozilla.com/D102795
2021-01-25 12:23:13 +00:00
Alexis Beingessner
839a64934a
Bug 1681546 - rename MOZ_ATOMIC_BITFIELDS methods to Load/Store. r=valentin,necko-reviewers
...
I was running into issues where these names would conflict with the type's own Get/Set methods
and these names have the added benefit of indicating a bit more that atomic stuff is going on.
Differential Revision: https://phabricator.services.mozilla.com/D99268
2020-12-09 18:14:55 +00:00
Alexis Beingessner
5f2921328a
Bug 1670982 - Make the bitflags in CacheStorageService actually atomic. r=decoder,necko-reviewers,dragana,valentin
...
TSan found races on these flags that are ostensibly benign but this way there's no UB.
This code is a bit weird. These bitfields are seemingly pointless as
they're squeezed between a uint64_t and an Atomic<bool>. There's plenty
of space for 2 more bools there.
Also the Atomic<bool> could theoretically be merged into the flags. For
now, here's the version of this patch that preserves the semantics of
this code as closely as possible, for review by the code owners.
Differential Revision: https://phabricator.services.mozilla.com/D93416
2020-12-08 16:56:23 +00:00
Bogdan Tara
dc705240d6
Backed out 2 changesets (bug 1670982) for tsan xpc shell failures CLOSED TREE
...
Backed out changeset 3ce1e8c65cbc (bug 1670982 )
Backed out changeset e7211a44d968 (bug 1670982 )
2020-12-08 01:59:32 +02:00
Alexis Beingessner
b6f9e670b0
Bug 1670982 - Make the bitflags in CacheStorageService actually atomic. r=decoder,necko-reviewers,dragana,valentin
...
TSan found races on these flags that are ostensibly benign but this way there's no UB.
This code is a bit weird. These bitfields are seemingly pointless as
they're squeezed between a uint64_t and an Atomic<bool>. There's plenty
of space for 2 more bools there.
Also the Atomic<bool> could theoretically be merged into the flags. For
now, here's the version of this patch that preserves the semantics of
this code as closely as possible, for review by the code owners.
Differential Revision: https://phabricator.services.mozilla.com/D93416
2020-12-07 18:32:51 +00:00
Simon Giesecke
ab6f0a7137
Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
...
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00