Commit Graph

120 Commits

Author SHA1 Message Date
criss
c1b045ddda 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
c1e4a1e52c 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
Jan Varga
f3b6f859bd Bug 1731969 - Rename ToResultInvoke member function overloads to ToResultInvokeMember; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126328
2021-11-30 05:05:53 +00:00
Haiyang Xu
79af612655 Bug 1672140 - Rename cache::ClientMetadata to cache::CacheDirectoryMetadata; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D131590
2021-11-24 20:50:37 +00:00
hxu
d2301973ac Bug 1672140 - Change cache::ClientMetadata's base class from quota::OriginMetadata to quota::ClientMetadata; r=dom-storage-reviewers,janv
Depends on D125583

Differential Revision: https://phabricator.services.mozilla.com/D126056
2021-11-24 20:50:37 +00:00
hxu
6940518aa5 Bug 1672140 - Rename cache::QuotaInfo to cache::ClientMetadata and rename corresponding functions; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D125583
2021-11-24 20:50:36 +00:00
Butkovits Atila
2972038726 Backed out 3 changesets (bug 1672140) for causing Bp-hybrid build bustages.
Backed out changeset 32edbc243607 (bug 1672140)
Backed out changeset 549556f430a7 (bug 1672140)
Backed out changeset 396640d13ece (bug 1672140)
2021-11-23 20:25:56 +02:00
Haiyang Xu
83543e511c Bug 1672140 - Rename cache::ClientMetadata to cache::CacheDirectoryMetadata; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D131590
2021-11-23 16:53:50 +00:00
hxu
0034188532 Bug 1672140 - Change cache::ClientMetadata's base class from quota::OriginMetadata to quota::ClientMetadata; r=dom-storage-reviewers,janv
Depends on D125583

Differential Revision: https://phabricator.services.mozilla.com/D126056
2021-11-23 16:53:50 +00:00
hxu
0ddf5a9d23 Bug 1672140 - Rename cache::QuotaInfo to cache::ClientMetadata and rename corresponding functions; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D125583
2021-11-23 16:53:49 +00:00
Jan Varga
7fbbc22b76 Bug 1731544 - Replace existing ToResult uses with MOZ_TO_RESULT; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D125324
2021-10-10 19:06:36 +00:00
Jan Varga
bbfd5be8cd Bug 1728267 - Remove implicit ToResult from QM_TRY when no extra argument is passed in dom/cache; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125319
2021-09-24 13:08:30 +00:00
Jan Varga
a0895ea9fc Bug 1711848 - Add argument separation comments for QM_OR_ELSE(WARN|NOTE|LOG_VERBOSE)(_IF) uses; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D115465
2021-06-01 13:58:27 +00:00
Jan Varga
ea18231e8b Bug 1711656 - Rename QM_OR_ELSE_LOG to QM_OR_ELSE_LOG_VERBOSE; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D115363
2021-06-01 12:12:27 +00:00
Jan Varga
72a62d1841 Bug 1708643 - CACHE: Replace QM_OR_ELSE_(WARN|LOG) with QM_OR_ELSE_(WARN|LOG)_IF in places where the fallback needs to be called conditionally; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D115150
2021-05-30 11:08:02 +00:00
Jan Varga
7e88bb0001 Bug 1711181 - Change uses of ordinary orElse to QM_OR_ELSE_LOG; r=dom-storage-reviewers,jstutte
This is more consistent with other cases where we either use QM_OR_ELSE_WARN or
QM_OR_ELSE_NOTE. We will later change some uses of QM_OR_ELSE_LOG to
QM_OR_ELSE_LOG_IF. The switch from custom OrElseIf to Result::orElseIf will be
easier when we don't use OrElseIf directly.

This patch only changes uses of ordinary orElse introduced in bug 1701346.

Remaining uses will be handled in bug 1711180 (the ones that were missed in bug
1686191).

Differential Revision: https://phabricator.services.mozilla.com/D115055
2021-05-21 09:30:30 +00:00
Jan Varga
f35732b709 Bug 1709067 - CACHE: Remove module specific QM_TRY macros; r=dom-storage-reviewers,jstutte
Depends on D114080

Differential Revision: https://phabricator.services.mozilla.com/D114081
2021-05-03 19:44:39 +00:00
Jan Varga
7ae200db8a Bug 1701346 - CACHE: Add explanatory comments for some ordinary orElse uses; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D113526
2021-04-28 07:33:55 +00:00
Jan Varga
88db9b66fa Bug 1690326 - Follow-up fix for the ERROR_FILE_CORRUPT to NS_ERROR_FILE_FS_CORRUPTED mapping; r=jstutte
The code which depends on the old generic NS_ERROR_MODULE_WIN32 mapping needs
to be updated too.

Depends on D113505

Differential Revision: https://phabricator.services.mozilla.com/D113518
2021-04-28 07:33:54 +00:00
Jan Varga
762c175df7 Bug 1706005 - Report failed DirectoryPaddingGet as a warning (instead of an error); r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D113392
2021-04-27 07:12:23 +00:00
Jan Varga
8714c5e6a8 Bug 1706350 - Follow-up cleanup for bug 1648399; r=dom-storage-reviewers,asuth
This patch addresses remaining review comments from
https://phabricator.services.mozilla.com/D81680.
It also adds missing origin initialization to the tests which was causing
unnecessary warnings during test execution.

Differential Revision: https://phabricator.services.mozilla.com/D112759
2021-04-21 13:55:04 +00:00
Tom Tung
8bbac5bc49 Bug 1655953 - Remove mutex lock for protecting the padding file; r=dom-workers-and-storage-reviewers,sg,asuth,janv
Depends on D81680

Differential Revision: https://phabricator.services.mozilla.com/D85279
2021-04-16 01:09:10 +00:00
Tom Tung
2e3219a90a Bug 1647316 - Align the InitOrigin for Cache with other client's; r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D80823
2021-04-16 01:09:09 +00:00
Jan Varga
102110c895 Bug 1686031 - Rename GroupAndOrigin to OriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104970
2021-02-12 14:03:28 +00:00
Simon Giesecke
c258eae6a1 Bug 1690234 - Ignore ERROR_FILE_CORRUPT when calling BodyTraverseFiles from within CollectEachFile/ReduceUsageInfo. r=dom-workers-and-storage-reviewers,janv,asuth
Differential Revision: https://phabricator.services.mozilla.com/D103785
2021-02-12 09:14:21 +00:00
Simon Giesecke
27276f018c Bug 1687321 - Use GetDirEntryKind instead of IsDirectory when iterating over directory entries in dom/cache. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D103763
2021-02-08 13:15:50 +00:00
Simon Giesecke
db09a74267 Bug 1687254 - Skip directory entries that no longer exist in GetBodyUsage. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D102204
2021-01-21 15:33:04 +00:00
Simon Giesecke
5eccc76341 Bug 1683828 - Use QM_TRY et al. in QuotaClient. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100770
2021-01-18 08:52:06 +00:00
Simon Giesecke
7e59717027 Bug 1683828 - Use QM_TRY et al. in FileUtils and modernize signatures. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100320
2021-01-14 16:42:32 +00:00
Simon Giesecke
e2aad55163 Bug 1679540 - Extract CollectEachFile function and use in quota manager and clients. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D98075
2021-01-05 09:27:18 +00:00
Mihai Alexandru Michis
d8d2eda6ba Backed out changeset 9ef5f1fe26e8 (bug 1679540) for causing Bug 1683863. a=backout 2020-12-22 17:00:34 +02:00
Simon Giesecke
57bf9fd5a4 Bug 1679540 - Extract CollectEachFile function and use in quota manager and clients. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D98075
2020-12-21 18:13:56 +00:00
Jan Varga
190d6c669b Bug 1680031 - Abort operations for given directory lock ids; r=dom-workers-and-storage-reviewers,sg
This patch changes the way how we abort operations when clearing of data is
requested. Instead of aborting all operations for given origin, we now abort
all operations for given directory locks which are blocking clearing of data.

Differential Revision: https://phabricator.services.mozilla.com/D98609
2020-12-09 08:13:44 +00:00
Jan Varga
d0583cd4f3 Bug 1680031 - Introduce Client::AbortAllOperations; r=dom-workers-and-storage-reviewers,sg
Client::AbortOperations no longer supports the case when an empty origin string
is passed (which was used to abort all operations).

Differential Revision: https://phabricator.services.mozilla.com/D98344
2020-12-02 16:38:07 +00:00
Simon Giesecke
f937914abb Bug 1672369 - Record Cache API shutdown steps. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D94740
2020-11-30 13:04:23 +00:00
Simon Giesecke
a6f86031f9 Bug 1672369 - Unify handling shutdown timeout of quota clients. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D94318
2020-11-30 10:40:59 +00:00
Simon Giesecke
601d8c1d2b Bug 1672369 - Pull up common ShutdownWorkThreads into QuotaClient. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D94298
2020-11-26 09:20:03 +00:00
Simon Giesecke
39bbcf93e6 Bug 1671369 - Change GetUsageForClient to return a UsageInfo. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93777
2020-11-17 13:17:24 +00:00
Simon Giesecke
5703b7bc5a Bug 1671369 - Change LockedDirectoryPaddingGet to return a Result and use CACHE_TRY. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93775
2020-11-17 09:07:03 +00:00
Simon Giesecke
d8b578ede4 Bug 1671369 - Change LockedDirectoryPaddingRestore to return a Result and use CACHE_TRY. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93774
2020-11-17 09:04:35 +00:00
Simon Giesecke
33fdc4cd0b Bug 1671369 - Change OpenDBConnection to return a Result. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93773
2020-11-17 09:04:33 +00:00
Simon Giesecke
cfd38cd416 Bug 1671369 - Extract ReduceEach function from ReduceUsageInfo. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93772
2020-11-17 09:04:28 +00:00
Simon Giesecke
d7fd8096e5 Bug 1671369 - Extract ReduceUsageInfo function from GetBodyUsage and GetUsageForOriginInternal. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93771
2020-11-17 09:04:25 +00:00
Simon Giesecke
f1edd61af0 Bug 1671369 - Change GetBodyUsage to return a Result. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93769
2020-11-17 09:04:23 +00:00
Simon Giesecke
51e2e95f06 Bug 1671369 - Move anonymous namespace inside mozilla::dom::cache. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D93767
2020-11-17 09:04:21 +00:00
Simon Giesecke
a99b8f21c1 Bug 1671369 - Change LockedGetPaddingSizeFromDB to return a Result. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D93766
2020-11-17 09:04:18 +00:00
Simon Giesecke
6b520a8edc Bug 1671369 - Use CACHE_TRY in CacheQuotaClient::GetUsageForOriginInternal. r=ttung
Differential Revision: https://phabricator.services.mozilla.com/D93662
2020-11-17 09:04:16 +00:00
Sylvestre Ledru
68b806d604 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila
a6e7dcc53f Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru
8f709b39e8 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00