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

328 Коммитов

Автор SHA1 Сообщение Дата
Jan Varga a7f7389681 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
Jan Varga adc8da34e9 Bug 1731960 - Move all Result extensions from QMResult.h to a dedicated file; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126324
2021-11-30 05:05:51 +00:00
Haiyang Xu 4aae583bea Bug 1726809 - Simplify QuotaManager::GetOrCreate and intermediate state of opening QuotaManager; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D131592
2021-11-28 00:09:56 +00:00
Butkovits Atila 7f647e7f41 Backed out changeset b4b0ae95055b (bug 1726809) for causing build bustages at ActorsParent.cpp. CLOSED TREE 2021-11-26 12:02:18 +02:00
Haiyang Xu a12fd4fda6 Bug 1726809 - Simplify QuotaManager::GetOrCreate and intermediate state of opening QuotaManager; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D131592
2021-11-26 09:20:57 +00:00
Tim Huang 45bfad05fe Bug 1731982 - Part 6: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-11-25 13:11:31 +00:00
Alexandru Michis 490a04115c Backed out 12 changesets (bug 1731982, bug 1736401) for causing crashes. a=backout
DONTBUILD

Backed out changeset ab85eef8a4fd (bug 1736401)
Backed out changeset 347ce2439936 (bug 1731982)
Backed out changeset fa0ff1505daa (bug 1731982)
Backed out changeset 5b1f2b0a5673 (bug 1731982)
Backed out changeset 4adc65d2f1a3 (bug 1731982)
Backed out changeset a8700204af07 (bug 1731982)
Backed out changeset 88bd00ed8d94 (bug 1731982)
Backed out changeset 80bd8c79b931 (bug 1731982)
Backed out changeset 58ca3a94fec0 (bug 1731982)
Backed out changeset 0b28570dea43 (bug 1731982)
Backed out changeset 23524ce67bb9 (bug 1731982)
Backed out changeset d29cc06a65db (bug 1731982)
2021-11-09 09:23:38 +02:00
Tim Huang 439f2f56d3 Bug 1731982 - Part 6: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-11-08 14:30:55 +00:00
Haiyang Xu 35ca020a6b Bug 1722466 - Add an RAII helper class QuotaDatabaseAutoAttacher to ensure database will be detached automatically in scope exit if any error happens before explicitly detach; r=dom-storage-reviewers,janv
This patch add an RAII helper class QuotaDatabaseAutoAttacher, which provides an Attach() and Detach() method, and guarantees that the database will be detached in it's destructor when an instance of this class is out of scope.

Differential Revision: https://phabricator.services.mozilla.com/D128042
2021-11-05 10:39:45 +00:00
Butkovits Atila 47821a8f76 Backed out 11 changesets (bug 1731982, bug 1736401) for causing crashes in mozilla::dom::ClientHandle::Control. a=backout
Backed out changeset 83176c86784c (bug 1736401)
Backed out changeset 4826707af5b3 (bug 1731982)
Backed out changeset a748e43fada0 (bug 1731982)
Backed out changeset 49302f7705a4 (bug 1731982)
Backed out changeset 59a5860fd74d (bug 1731982)
Backed out changeset 1f7ec5f62c7c (bug 1731982)
Backed out changeset 3142414872de (bug 1731982)
Backed out changeset 363ae2df245d (bug 1731982)
Backed out changeset ae319f8182ac (bug 1731982)
Backed out changeset 23edbfc8e84a (bug 1731982)
Backed out changeset 5f35364352f0 (bug 1731982)
2021-10-19 22:23:12 +03:00
Tim Huang 54fa907186 Bug 1731982 - Part 7: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-10-19 06:33:08 +00:00
Cosmin Sabou 49f2f21930 Backed out 10 changesets (bug 1731982) for causing OS X performance test failures and crashes (Bug 1736436). a=backout DONTBUILD
Backed out changeset 48e6f591f699 (bug 1731982)
Backed out changeset 77907884b2fa (bug 1731982)
Backed out changeset a299a2d43ebe (bug 1731982)
Backed out changeset 005801e7cf91 (bug 1731982)
Backed out changeset ef71b02c40cc (bug 1731982)
Backed out changeset a52dd02f2b3f (bug 1731982)
Backed out changeset 50b14ef1eb4a (bug 1731982)
Backed out changeset 80641bdceb6a (bug 1731982)
Backed out changeset ada9e2008ca4 (bug 1731982)
Backed out changeset a208016e9953 (bug 1731982)
2021-10-18 22:18:08 +03:00
Tim Huang 2bbbe3855b Bug 1731982 - Part 7: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-10-18 12:20:33 +00:00
Cristian Tuns dd44cdf4ef Backed out 10 changesets (bug 1731982) for causing hybrid bustages on nsCORSListenerProxy.obj CLOSED TREE
Backed out changeset a248413c22ec (bug 1731982)
Backed out changeset 1bd7de5d93a1 (bug 1731982)
Backed out changeset d028e1ce1313 (bug 1731982)
Backed out changeset 7db7537bbc24 (bug 1731982)
Backed out changeset 28c18d83906d (bug 1731982)
Backed out changeset 6258b4e10406 (bug 1731982)
Backed out changeset 68bf86b1459c (bug 1731982)
Backed out changeset b8990af2fca2 (bug 1731982)
Backed out changeset 153783261021 (bug 1731982)
Backed out changeset bc9c3abbb8f8 (bug 1731982)
2021-10-15 18:12:21 -04:00
Tim Huang ebbb23509f Bug 1731982 - Part 7: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-10-15 20:00:04 +00:00
Cristian Tuns d3df74e295 Backed out 9 changesets (bug 1731982) for causing wpt failures on localStorage. CLOSED TREE
Backed out changeset bbeba8b14a2f (bug 1731982)
Backed out changeset 645cc214c608 (bug 1731982)
Backed out changeset 3a8e2f9c15e8 (bug 1731982)
Backed out changeset 208dd7c57311 (bug 1731982)
Backed out changeset 76a13a728f13 (bug 1731982)
Backed out changeset a6bfce877a86 (bug 1731982)
Backed out changeset 5fc4e33a8232 (bug 1731982)
Backed out changeset 353e3b3e020a (bug 1731982)
Backed out changeset b07167090923 (bug 1731982)
2021-10-13 10:47:25 -04:00
Tim Huang df3c16b98f Bug 1731982 - Part 7: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-10-13 11:18:54 +00:00
Noemi Erli cb0b4097d6 Backed out 9 changesets (bug 1731982) for causing Bp-hybrid bustages CLOSED TREE
Backed out changeset 82bb76c2e531 (bug 1731982)
Backed out changeset 8240ef0e1771 (bug 1731982)
Backed out changeset f46f05792c6a (bug 1731982)
Backed out changeset 449c821bc56e (bug 1731982)
Backed out changeset cb813505b5a9 (bug 1731982)
Backed out changeset 06fad8cd9345 (bug 1731982)
Backed out changeset 4b8cf4756686 (bug 1731982)
Backed out changeset 5468bf77f732 (bug 1731982)
Backed out changeset 7800585e3d6a (bug 1731982)
2021-10-12 23:12:19 +03:00
Tim Huang c76e241df9 Bug 1731982 - Part 7: Use the client's principal to verify client in localStorage. r=asuth
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.

Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.

Differential Revision: https://phabricator.services.mozilla.com/D127840
2021-10-12 18:55:20 +00:00
Jan Varga 5a11502111 Bug 1731546 - Replace existing ToResultGet uses with MOZ_TO_RESULT_GET_TYPED; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125325
2021-10-11 06:00:15 +00:00
Jan Varga 572fb1f823 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 2fd705fb88 Bug 1728267 - Remove implicit ToResult from QM_TRY when no extra argument is passed in dom/localstorage; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125321
2021-09-24 13:08:31 +00:00
Jan Varga eccdb851bb Bug 1728267 - Remove implicit ToResult from QM_WARNONLY_TRY macros; r=dom-storage-reviewers,jstutte,jari
We can use QM_TO_RESULT (instead of MOZ_TO_RESULT) because QM_WARNONLY_TRY
doesn't propagate errors, so no other adjustment is needed.

Differential Revision: https://phabricator.services.mozilla.com/D125314
2021-09-23 10:16:08 +00:00
Kagami Sascha Rosylight bdf127087c Bug 1723050 - Part 17: Replace typedef by using in dom/localstorage/ r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D121315
2021-08-16 17:05:41 +00:00
Gabriele Svelto 559377e821 Bug 1723934 - Remove useless nsExceptionHandler.h inclusions and crash reporter service definitions r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D121708
2021-08-09 20:08:17 +00:00
Jan Varga 226a68d16d Bug 1718197 - Have a way to set QM_TRY context in ExecuteInitialization; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D118808
2021-07-31 16:32:14 +00:00
Jan Varga a418c56853 Bug 1718197 - Simplify access to FirstInitializationAttempt objects in initialization functions; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119389
2021-07-31 16:32:13 +00:00
Jan Varga e22168a74c Bug 1719281 - QM: Execute initializations in ExecuteInitialization() for real; r=dom-storage-reviewers,asuth
ExecuteInitialization now takes a function argument instead of nsresult so
initializations are executed in the context of ExecuteInitialization. This
patch also removes a temporary overload of ExecuteInitialization.

Differential Revision: https://phabricator.services.mozilla.com/D119263
2021-07-31 12:37:36 +00:00
Jan Varga f269c78d92 Bug 1719281 - QM: Add a generic wrapper for running initializations; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119182
2021-07-31 12:37:36 +00:00
Sandor Molnar 01917ee5ce Backed out 2 changesets (bug 1719281) for causing bc failures in FirstInitializationAttempts. CLOSED TREE
Backed out changeset 58b39579def6 (bug 1719281)
Backed out changeset d6801824d47d (bug 1719281)
2021-07-30 21:53:23 +03:00
Jan Varga 107d5083bc Bug 1719281 - QM: Execute initializations in ExecuteInitialization() for real; r=dom-storage-reviewers,asuth
ExecuteInitialization now takes a function argument instead of nsresult so
initializations are executed in the context of ExecuteInitialization. This
patch also removes a temporary overload of ExecuteInitialization.

Differential Revision: https://phabricator.services.mozilla.com/D119263
2021-07-30 17:51:58 +00:00
Jan Varga 3a089efdf2 Bug 1719281 - QM: Add a generic wrapper for running initializations; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119182
2021-07-30 17:51:58 +00:00
Jan Varga ed1318cf0a Bug 1591877 - Forbid creation of PBackgroundLSRequest/PBackgroundLSSimpleRequest actors in the parent process if LSNG is not enabled; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D119710
2021-07-13 11:16:00 +00:00
Jan Varga ffa84fb55a Bug 1717990 - LSNG: Convert some NS_ERROR_FAILURE which should have been NS_ERROR_ABORT; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D118677
2021-06-25 06:27:59 +00:00
Jan Varga 5e3c6d6fc1 Bug 1716570 - LSNG: Add QM_TRY context for PrepareDatastoreOp::DatabaseWork; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D118673
2021-06-25 02:46:13 +00:00
Jan Varga 1bb9cee6b1 Bug 1714284 - LS: Fix building in non-unified builds; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D116684
2021-06-23 14:19:05 +00:00
Jan Varga f4a3bc258f 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 f7d0092e58 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 0859779a45 Bug 1708643 - LS: 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/D115153
2021-05-30 11:08:03 +00:00
Jens Stutte 61d67b9ff0 Bug 1706998: Replace QuotaManager::GetRef().MaybeRecordShutdownStep by static QuotaManager::(Safe)MaybeRecordQuotaClientShutdownStep; r=dom-storage-reviewers,janv
There are some few unsafe uses of MaybeRecordShutdownStep where the QuotaManager singleton may be  not (yet or anymore) alive.
In order to not add many unnecessary null checks, we drop GetRef and MaybeRecordShutdownStep in favor of
QuotaManager::MaybeRecordQuotaClientShutdownStep
QuotaManager::SafeMaybeRecordQuotaClientShutdownStep
with the sole difference that the Safe variant runtime checks the singleton, while the normal one only asserts.

Differential Revision: https://phabricator.services.mozilla.com/D115988
2021-05-28 06:46:04 +00:00
Jan Varga e016ebac70 Bug 1711181 - Add explanatory comments for some special uses of QM_OR_ELSE_WARN; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D115160
2021-05-21 09:30:30 +00:00
Jan Varga 52086b9801 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 cd7cdb6548 Bug 1710646 - LSNG: UpdateUsageFile should flush the stream before closing it; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D114858
2021-05-12 03:02:23 +00:00
Jan Varga 5facda493a Bug 1709067 - LS: Remove module specific QM_TRY macros; r=dom-storage-reviewers,jstutte
Depends on D114082

Differential Revision: https://phabricator.services.mozilla.com/D114083
2021-05-03 19:44:40 +00:00
Jan Varga 604404dd23 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
Jan Varga e981a6fd53 Bug 1703310 - Enable LocalStorage NextGen (LSNG) when "network.cookie.lifetimePolicy" is set to ACCEPT_SESSION (2); r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D112326
2021-04-17 03:20:17 +00:00
Jan Varga 4913acef81 Bug 1701346 - LSNG: Revert QM_OR_ELSE_WARN to ordinary orElse in ExistsAsFile; r=asuth,dom-storage-reviewers,jstutte
Depends on D109991

Differential Revision: https://phabricator.services.mozilla.com/D109992
2021-03-27 13:08:07 +00:00
Simon Giesecke 613e20d136 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
Jan Varga 7d3ef83b0f Bug 1686191 - Have a way to specifically report warnings around QM_TRY; r=asuth,sg,dom-storage-reviewers
This patch:
- adds QM_WARNONLY_TRY/QM_NOTEONLY_TRY macros
- adds QM_WARNONLY_TRY_UNWRAP/QM_NOTEONLY_TRY_UNWRAP macros
- adds QM_OR_ELSE_WARN/QM_OR_ELSE_NOTE sub macros
- replaces non-propagating uses of NS_WARNING with redundant messages by
  QM_WARNONLY_TRY
- replaces uses of QM_TRY with orElse by QM_TRY(QM_OR_ELSE_WARN(...))
- replaces uses of QM_TRY inside an extra lambda with QM_WARNONLY_TRY
- replaces uses of QM_TRY with QM_VOID with QM_WARNONLY_TRY.
- replaces uses of QM_TRY with unwanted warnings with QM_NOTEONLY_TRY
- replaces uses of QM_TRY with additional Maybe wrapping for doing a
  fallback with QM_TRY(QM_OR_ELSE_WARN(...))

Differential Revision: https://phabricator.services.mozilla.com/D108424
2021-03-24 12:27:53 +00:00
Butkovits Atila 9fc0210ad3 Backed out changeset 2a3316bd2409 (bug 1686191) for causing bustages on QuotaCommon.h. CLOSED TREE 2021-03-24 07:12:55 +02:00