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

1103 Коммитов

Автор SHA1 Сообщение Дата
Jens Stutte 9f7b34c24e Bug 1700915: Python scripts that fetch and analyze QM_TRY errors. r=dom-storage-reviewers,janv
These scripts are not shipped with Firefox but serve to analyze the
telemetry data sent by the QM_TRY family of macros.

Differential Revision: https://phabricator.services.mozilla.com/D110277
2021-04-08 10:01:36 +00:00
Jan Varga 1c19e643ec Bug 1701346 - QM: Revert QM_OR_ELSE_WARN to ordinary orElse in EnsureDirectory; r=jstutte
Differential Revision: https://phabricator.services.mozilla.com/D109987
2021-03-26 22:55:18 +00:00
p1nk 6c8c619e92 Bug 1687318 - Changed unscoped enum FileFlag to scoped enum class. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D109462
2021-03-25 09:18:04 +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
Jan Varga 6edcf204fd 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 04:40:10 +00:00
Simon Giesecke 1730e59e4a Bug 708901 - Migrate to nsTHashSet in dom/quota. r=dom-storage-reviewers,janv
Depends on D108599

Differential Revision: https://phabricator.services.mozilla.com/D108600
2021-03-23 10:36:35 +00:00
Jan Varga c546aae9a0 Bug 1697115 - Rationalize QuotaManager::ResetUsageForClient arguments; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107616
2021-03-17 06:56:39 +00:00
Jan Varga b59182de8d Bug 1697115 - Rationalize QuotaManager::DecreaseUsageForClient arguments; r=dom-storage-reviewers,sg
Note that the method DecreaseUsageForOrigin has been renamed to
DecreaseUsageForClient.

Differential Revision: https://phabricator.services.mozilla.com/D107615
2021-03-17 06:56:39 +00:00
Jan Varga de33fe2cf6 Bug 1697115 - Rationalize QuotaManager::NoteOriginDirectoryCreated arguments and return type; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107614
2021-03-17 06:56:39 +00:00
Jan Varga ebce7d3ac8 Bug 1697115 - Rationalize QuotaManager::EnsureQuotaForOrigin arguments; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107612
2021-03-17 06:56:38 +00:00
Jan Varga d45596dcf0 Bug 1697115 - Rationalize QuotaManager::InitQuotaForOrigin arguments; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107611
2021-03-17 06:56:38 +00:00
Jan Varga 8a8706b797 Bug 1697115 - Use FullOriginMetadata instead of OriginMetadata in QuotaManager::LoadQuota::LoadQuotaFromCache; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107610
2021-03-17 06:56:38 +00:00
Jan Varga 83de9af404 Bug 1697115 - Rename mTimestamp to mLastAccessTime in FullOriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107609
2021-03-17 06:56:37 +00:00
Simon Giesecke d2bc5eec44 Bug 1686191 - Add support for warnings integrated with QM_TRY. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D102770
2021-03-12 15:07:57 +00:00
Simon Giesecke fbf7a1dad4 Bug 1686191 - Remove module argument from LogError. r=dom-workers-and-storage-reviewers,janv
The module argument in LogError is redundant: the module information can
already be determined from the source file path. Indeed, reporting the module
separately in the telemetry events seems unnecessary. Instead, the relative
path is now reported. This is what the analysis of the telemetry data did
reconstruct anyway.

As a consequence, it's no longer necessary to define module-specific
HandleError functions, and therefore it's also unnecessary to define
module-specific TRY macros. These are retained as simple aliases for now,
but can be removed in a later patch entirely.

This also avoids misuses of a TRY macros in the wrong module, which were
happening a few times before, resulting in confusing output or telemetry
events.

Since Bug 1686191 will add some more TRY macro variants that warn, so
simplifying the module-specific aspects will simplify that task. Furthermore,
this is in preparation of moving the TRY macro extensions to MFBT.

Differential Revision: https://phabricator.services.mozilla.com/D102767
2021-03-12 15:01:21 +00:00
Simon Giesecke 7d2448b7d5 Bug 1641178 - Add NSSCipherStrategy. r=dom-workers-and-storage-reviewers,jcj,janv
Differential Revision: https://phabricator.services.mozilla.com/D73290
2021-03-12 09:31:57 +00:00
Jan Varga 1cc0ba995e Bug 1686031 - Rename OriginMetadata.h to CommonMetadata.h; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107608
2021-03-11 05:53:17 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Jan Varga 28b36c6c8c Bug 1686031 - Rename GetDirectoryMetadataWithOriginMetadata2 to LoadFullOriginMetadata and GetDirectoryMetadataWithOriginMetadata2WithRestore to LoadFullOriginMetadataWithRestore; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107607
2021-03-10 08:34:53 +00:00
Jan Varga 591e53a104 Bug 1686031 - Replace GetDirectoryResultWithOriginMetadata with FullOriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107605
2021-03-10 08:34:52 +00:00
Jan Varga 69da5d658a Bug 1695906 - Use NotNull for StorageOperationsBase::OriginProps::mDirectory; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106908
2021-03-10 08:34:52 +00:00
Jan Varga c6a31f1fb9 Bug 1686031 - Fix storage upgrades and restoration of the metadata file to use proper persistence type internally; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106907
2021-03-10 05:53:03 +00:00
Alexandru Michis 06f97bce8a Backed out 4 changesets (bug 1695906, bug 1686031) for causing bustages in ActorsParent.cpp
CLOSED TREE

Backed out changeset 43a39c491548 (bug 1686031)
Backed out changeset 9be2fd0b5b6a (bug 1686031)
Backed out changeset f483f50d292a (bug 1695906)
Backed out changeset 470d617d7673 (bug 1686031)
2021-03-09 23:06:01 +02:00
Jan Varga c9519afc4d Bug 1686031 - Rename GetDirectoryMetadataWithOriginMetadata2 to LoadFullOriginMetadata and GetDirectoryMetadataWithOriginMetadata2WithRestore to LoadFullOriginMetadataWithRestore; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107607
2021-03-09 19:02:00 +00:00
Jan Varga ad621c19e4 Bug 1686031 - Replace GetDirectoryResultWithOriginMetadata with FullOriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107605
2021-03-09 19:02:00 +00:00
Jan Varga 2317919b08 Bug 1695906 - Use NotNull for StorageOperationsBase::OriginProps::mDirectory; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106908
2021-03-09 19:01:59 +00:00
Jan Varga e6de9b6ac0 Bug 1686031 - Fix storage upgrades and restoration of the metadata file to use proper persistence type internally; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106907
2021-03-09 19:01:59 +00:00
Jan Varga 778be94ce4 Bug 1686031 - Fix GetDirectoryMetadataWithOriginMetadata2 and GetDirectoryMetadataWithOriginMetadata2WithRestore to return proper persistence type; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106906
2021-03-05 04:48:38 +00:00
Emilio Cobos Álvarez 451f185db7 Bug 1695084 - Update persistent storage permission prompt. r=mconley,flod
Differential Revision: https://phabricator.services.mozilla.com/D107058
2021-03-04 21:59:23 +00:00
Jan Varga 8762bb7413 Bug 1695903 - QM: Add PersistenceTypeFromFile method; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106904
2021-03-04 21:05:57 +00:00
Jan Varga 52647a0d1e Bug 1686031 - Add mPersistenceType to OriginMetadata; r=dom-storage-reviewers,sg
The existing members of OriginMetadata have been extracted to a parent struct
called PrincipalMetadata. Methods like GetOriginUsage,
GetInfoFromValidatedPrincipalInfo, GetInfoFromPrincipal and GetInfoForChrome
have been changed to take/return PrincipalMetadata instead of OriginMetadata.
Having the persistence type doesn't make sense in those methods because the
origin is not tied to a specific persistence type in context of the methods.

Some places temporarily pass PERSISTENCE_TYPE_INVALID and will be fixed in
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D106400
2021-03-04 18:03:02 +00:00
Jan Varga 660e003ceb Bug 1686031 - Introduce OriginInfo::FlattenToOriginMetadata and make use of it; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106399
2021-03-04 11:07:42 +00:00
Jan Varga c5b628e755 Bug 1686031 - Move mGroup from GroupInfo to GroupInfoPair; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106398
2021-03-04 11:07:41 +00:00
Jan Varga c54ff069dd Bug 1686031 - Change SaveCacheVersion, CreateCacheTables and UpgradeCacheFrom1To2 to take a reference instead of a raw pointer; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106397
2021-03-04 11:07:41 +00:00
Jan Varga 2b03774f6e Bug 1686031 - Construct OriginMetadata with real suffix in DirectoryLockImpl::OriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106396
2021-03-04 11:07:40 +00:00
Jan Varga 14ecf7a1dc Bug 1686031 - Construct OriginMetadata with real suffix in PersistedOp::DoDirectoryWork; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106395
2021-03-04 11:07:40 +00:00
Jan Varga 2f5300328f Bug 1686031 - Construct OriginMetadata with real suffix in GetOriginUsageOp::DoDirectoryWork; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106394
2021-03-04 11:07:40 +00:00
Jan Varga 37dd4a946c Bug 1686031 - Add suffix to OriginInfoPair and quota info cache; r=dom-storage-reviewers,sg
This fixes the two spots where we were always passing an empty suffix to
OriginMetadata.

Differential Revision: https://phabricator.services.mozilla.com/D106131
2021-03-04 11:07:39 +00:00
Simon Giesecke 31f5386fe5 Bug 1686191 - Added a comment on the sequence number. r=dom-workers-and-storage-reviewers,janv DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D102768
2021-03-04 09:13:21 +00:00
Jan Varga eeb8cf2781 Bug 1695883 - Add explicit fallible mozStorageTransaction::Start method for starting the transaction; r=dom-storage-reviewers,sg
The new method is mandatory because mozStorageTransaction constructor no longer
starts the transaction. It must be started explicitely.

All consumers have been adjusted, but only dom/quota, dom/indexedDB, dom/cache,
dom/localstorage and dom/storage handle the error. Other components like
netwerk/cache, netwerk/cookie and toolkit/components currently only warn on
failure to start a transaction. Bug 1696129, 1696130 and 1696133 have been
filed for proper handling of transaction start failures in those components.

Differential Revision: https://phabricator.services.mozilla.com/D106893
2021-03-04 04:38:06 +00:00
Simon Giesecke 8985106d89 Bug 1694365 - Invalidate QM cache after cleaning up temporary storage. r=janv,dom-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106130
2021-03-02 16:01:07 +00:00
Simon Giesecke 5441c4cbcf Bug 1693530 - Add nsBaseHashtable::TryLookupOrInsertWith variant that accepts a functor returning a mozilla::Result. r=janv,xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D105634
2021-03-02 09:02:19 +00:00
Simon Giesecke a791a2f409 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in dom/quota. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D106090
2021-03-01 09:59:32 +00:00
Simon Giesecke f951a8d943 Bug 1694935 - Clear an origin if initializing it failed due to database corruption. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D106589
2021-02-26 12:21:14 +00:00
Simon Giesecke 0b443059fd Bug 1693306 - Simplify some uses of LookupOrInsertWith by GetOrInsertNew. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D105479
2021-02-26 09:22:54 +00:00
Simon Giesecke 9af107a839 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 4f75368dcb 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
Butkovits Atila 22e752e996 Backed out changeset 8f7c25b71590 (bug 1641178) for causing GTest failures. CLOSED TREE 2021-02-24 18:14:23 +02:00
Simon Giesecke e09b49aa3d Bug 1641178 - Add NSSCipherStrategy. r=dom-workers-and-storage-reviewers,jcj,janv
Differential Revision: https://phabricator.services.mozilla.com/D73290
2021-02-24 13:18:24 +00:00