Closed Bug 1931513 Opened 24 days ago Closed 2 days ago

QM: Eliminate the need to do conversion from PrincipalMetadata to PrincipalInfo

Categories

(Core :: Storage: Quota Manager, defect, P1)

defect

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 2 open bugs)

Details

Attachments

(8 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

In theory, PrincipalMetadataToPrincipalInfo may occasionally return a different PrincipalInfo than the one originally used to create PrincipalMetadata. While we could add some diagnostic assertions to help identify and eventually address any inconsistencies, it would be safer to avoid this conversion entirely.

PrincipalMetadataToPrincipalInfo is currently called in QuotaManager::OpenClientDirectory:
https://searchfox.org/mozilla-central/rev/81ac0fe96e1bd6020408c2ae7eae6e5b5114d1db/dom/quota/ActorsParent.cpp#5383

If PrincipalMetadata data is not consistent with PrincipalInfo data (especially the origin string), then the tracking of initialized origins on PBackground thread and QM I/O thread will not be consistent as well.

Summary: QM: Eliminate the need. to do convesion from PrincipalMetadata to PrincipalInfo → QM: Eliminate the need to do convesion from PrincipalMetadata to PrincipalInfo
Summary: QM: Eliminate the need to do convesion from PrincipalMetadata to PrincipalInfo → QM: Eliminate the need to do conversion from PrincipalMetadata to PrincipalInfo

This is not strictly required to get rid of PrincipalMetadataToPrincipalInfo,
but it's better for consistency and readability.

The persistence type should be PERSISTENCE_TYPE_PERSISTENT.

This is a preparation patch for next patches which change many methods to take
OriginMetadata instead of PersistenceType and PrincipalInfo.

Attachment #9438847 - Attachment description: Bug 1931513 - Fix InitializePersistentOrigin_FinishedWithScheduledShutdown test to use correct OriginMetadata; r=#dom-storage → Bug 1931513 - QM: Fix InitializePersistentOrigin_FinishedWithScheduledShutdown test to use correct OriginMetadata; r=#dom-storage

This is not strictly required to get rid of PrincipalMetadataToPrincipalInfo,
but it's better for consistency and readability.

Blocks: 1875995
Depends on: 1932101
Blocks: 1929840
No longer blocks: 1875995
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fbd1c6ba8b63 QM: Fix InitializePersistentOrigin_FinishedWithScheduledShutdown test to use correct OriginMetadata; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/bb7b05353b62 QM: Change origin initialization related methods to take PrincipalMetadata instead of PrincipalInfo; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/1156ce469927 QM: Change also PersistentOriginInitialized and TemporaryOriginInitialize to take PrincipalMetadata instead of PrincipalInfo; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/233c750b54af QM: Change persistent origin initialization related methods to take OriginMetadata instead of PrincipalMetadata; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/a3f1433213fe QM: Change temporary origin initialization related methods to take OriginMetadata instead of PersistenceType and PrincipalMetadata; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/14394c582d84 QM: Change group initialization related methods to take PrincipalMetadata instead of PrincipalInfo; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/1713e621c7e8 QM: Change also TemporaryGroupInitialized to take PrincipalMetadata instead of PrincipalInfo; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/8900a352dd36 QM: Remove PrincipalMetadataToPrincipalInfo method; r=dom-storage-reviewers,jari
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: