Commit Graph

1200 Commits

Author SHA1 Message Date
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
9cb7caeba4 Bug 1698871 - Use SafeRefPtr for mMappedBlobs. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D109365
2021-03-24 13:21:50 +00:00
Jan Varga
c1bf74632e 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
0f02bd2182 Backed out changeset 2a3316bd2409 (bug 1686191) for causing bustages on QuotaCommon.h. CLOSED TREE 2021-03-24 07:12:55 +02:00
Jan Varga
2c51bce65c 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
299b0c92be Bug 708901 - Migrate to nsTHashSet in dom/indexedDB. r=dom-storage-reviewers,janv
Depends on D108595

Differential Revision: https://phabricator.services.mozilla.com/D108596
2021-03-23 10:36:33 +00:00
Simon Giesecke
f0ac4a689a Bug 1698871 - Use SafeRefPtr with FullIndexMetadata/FullObjectStoreMetadata. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D108659
2021-03-22 15:18:36 +00:00
smolnar
2378cad06d Backed out 2 changesets (bug 1698871) backed out for causing mochitest and xpc failures in SafeRefPtr. CLOSED TREE
Backed out changeset 1c617ab7df90 (bug 1698871)
Backed out changeset c3605f06194b (bug 1698871)
2021-03-22 16:40:12 +02:00
Simon Giesecke
569cfd2723 Bug 1698871 - Use SafeRefPtr with FullIndexMetadata/FullObjectStoreMetadata. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D108659
2021-03-22 13:23:42 +00:00
Tom Tung
6265aa38c6 Bug 1500116 - Allow mActorDestroyed to be set to true more than one time; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D108918
2021-03-18 18:45:43 +00:00
Jan Varga
44b083b2f6 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
Simon Giesecke
bcbb7c2a1a Bug 1687001 - Resolve races on auto increment ids by a mutex. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D103031
2021-03-11 19:13:39 +00:00
Simon Giesecke
c7a36b5d58 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
8601e06bf2 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
25ff578766 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
Alexandru Michis
3a719c0db4 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
4a7a47bf30 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
b88c560d8d 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
f1f7a1a27b 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
Jan Varga
84413fc6f9 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
85a9467a37 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
ea332690d4 Bug 1696134 - Fix suppression of error in SetDefaultPragmas. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D107045
2021-03-03 11:50:29 +00:00
Simon Giesecke
c3c8237844 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in dom/indexedDB. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D106092
2021-03-01 09:59:32 +00:00
Simon Giesecke
7c2f4b7743 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
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
2634de766d Bug 1691913 - Rename nsClassHashtable::LookupOrAdd to GetOrInsertNew. r=xpcom-reviewers,nika
It should be called "Get" rather than "Lookup" because it returns
UserDataType. "Add" is called "Insert" in the other methods.

Differential Revision: https://phabricator.services.mozilla.com/D105470
2021-02-22 12:07:47 +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
Gerald Squelart
f25e1c0093 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

Differential Revision: https://phabricator.services.mozilla.com/D104588
2021-02-16 04:44:19 +00:00
Simon Giesecke
efa1fdf04c Bug 1691894 - Remove nsClassHashtable::LookupForAddFromFactory and use GetOrInsertWith instead. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104851
2021-02-15 16:37:51 +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
cdb66ab7a9 Bug 1691894 - Remove nsClassHashtable::LookupForAddFromFactory and use GetOrInsertWith instead. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104851
2021-02-15 10:04:46 +00: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
Jan Varga
417fd9bd4f Bug 1686031 - Fold QuotaInfo into OriginMetadata and rename QuotaInfo.h to OriginMetadata.h; r=dom-storage-reviewers,sg
Existing uses of OriginMetadata (with only mGroup and mOrigin) have been
adapted and they now always initialize mSuffix to an empty string.
Following patches will change it to real suffix if there's any.

Differential Revision: https://phabricator.services.mozilla.com/D104971
2021-02-12 21:43:42 +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
Jan Varga
532a52efb4 Bug 1690025 - Move DirectoryLock class to a separate file; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104154
2021-02-09 10:42:22 +00:00
Butkovits Atila
83658f3247 Backed out 3 changesets (bug 1690025) for causing failure on Client.h. CLOSED TREE
Backed out changeset 5d5e90d31294 (bug 1690025)
Backed out changeset d2b39aebfad2 (bug 1690025)
Backed out changeset 2684aad61a6b (bug 1690025)
2021-02-09 10:12:28 +02:00
Jan Varga
2a4749624a Bug 1690025 - Move DirectoryLock class to a separate file; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104154
2021-02-09 06:52:57 +00:00
Simon Giesecke
786ed76113 Bug 1687321 - Use GetDirEntryKind instead of IsDirectory when iterating over directory entries in dom/indexedDB. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D103764
2021-02-08 14:14:13 +00:00
Simon Giesecke
bea7c84c8a Bug 1690291 - Handle NS_ERROR_STORAGE_IOERR when opening a database like NS_ERROR_FILE_CORRUPTED. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D103898
2021-02-04 11:43:22 +00:00
Jan Varga
1c79f5169a Bug 1689293 - Introduce DirectoryLock::Acquire; r=sg
Quota clients instead of doing:
RefPtr<DirectoryLock> pendingDirectoryLock = qm->OpenDirectory(..., listener);

now do:
RefPtr<DirectoryLock> directoryLock = qm->CreateDirectoryLock(...);
directoryLock->Acquire(listener);

Differential Revision: https://phabricator.services.mozilla.com/D103279
2021-02-02 08:20:18 +00:00
Simon Giesecke
198d190269 Bug 1682536 - Use NotNull with FileInfoEntry. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D99783
2021-02-01 10:46:44 +00:00
Simon Giesecke
d0c92a9886 Bug 1682536 - Use NotNull with FileInfo. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D99781
2021-02-01 10:46:37 +00:00
Simon Giesecke
2f6a6efb1e Bug 1686749 - Let CreateFile*Stream functions propagate all errors. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D101779
2021-01-28 11:12:19 +00:00
Simon Giesecke
934f6d8c19 Bug 1685111 - Extract CachingDatabaseConnection base class from indexedDB's DatabaseConnection. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D100922
2021-01-26 09:19:44 +00:00
Simon Giesecke
a0420422ac Bug 1687256 - Do not fail FileManager::GetUsage if some file was removed from the directory while iterating. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D102206
2021-01-21 14:39:31 +00:00
Simon Giesecke
e5bac7a683 Bug 1679541 - Change GetDirectoryMetadata2 to return mozilla::Result. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D98076
2021-01-11 15:06:13 +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