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

375 Коммитов

Автор SHA1 Сообщение Дата
Jan Varga 1af2efb302 Bug 1731977 - Add MOZ_TO_RESULT_INVOKE_TYPED for invoking plain functions; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126329
2021-11-30 05:05:53 +00:00
Jan Varga ff4cf60eb4 Bug 1731962 - Move ToResultGet from QuotaCommon.h to ResultExtensions.h; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126326
2021-11-30 05:05:51 +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
Jan Varga 367fa7927a Bug 1731804 - Allow ToResult(const QMResult& aValue) and ToResult(QMResult&& aValue) to return other nsresult like error types; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126272
2021-11-12 07:58:47 +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 b75d89f7dc Bug 1728267 - Fix compilation when QM_ERROR_STACKS_ENABLED is not defined; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D126589
2021-09-30 11:14:58 +00:00
Mike Hommey 70b2676ce8 Bug 1733034 - Fix linux bustage. CLOSED TREE 2021-09-30 04:26:22 +03:00
Mike Hommey ceabf5781e Bug 1733034 - Ignore unreachable-code-loop-increment in TestFlatten. r=dom-workers-and-storage-reviewers,janv
dom/quota/test/gtest/TestFlatten.cpp:18:3: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]
  for (const auto& item : Flatten<int>(nsTArray<int>{})) {
  ^~~
dom/quota/test/gtest/TestFlatten.cpp:26:3: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]
  for (const auto& item : Flatten<int>(nsTArray<CopyableTArray<int>>{})) {
  ^~~
dom/quota/test/gtest/TestFlatten.cpp:34:3: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]
  for (const auto& item :
  ^~~

clang figures out that the loop is not going to execute, which is the
whole point of the test.

Differential Revision: https://phabricator.services.mozilla.com/D126874
2021-09-29 21:44:52 +00:00
Jan Varga d512bd65af Bug 1728267 - Remove implicit ToResult from QM_TRY when no extra argument is passed in dom/quota; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125317
2021-09-24 13:08:29 +00:00
Jan Varga b4ef3d074a Bug 1728267 - Remove implicit ToResult from QM_TRY when one extra argument is passed; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125316
2021-09-23 10:16:09 +00:00
Jan Varga 4cc9bf1d18 Bug 1728267 - Remove implicit ToResult from QM_TRY when two extra arguments are passed; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125315
2021-09-23 10:16:09 +00:00
Jan Varga 1c3defcc5b Bug 1728267 - Fix TestQMResult.cpp to start with the current last stack id instead of using a hard coded constant; r=dom-storage-reviewers,jstutte
This is needed especially when QMResult is used in some global initialization
like InitializeQuotaManager.

Differential Revision: https://phabricator.services.mozilla.com/D125313
2021-09-23 05:27:37 +00:00
Jan Varga c7dda8bf82 Bug 1728267 - Remove implicit ToResult from QM_TRY_RETURN; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125312
2021-09-23 04:06:11 +00:00
criss 7f1d028a6f Bug 1722668 - Fix lint failure r=fix 2021-09-22 23:27:34 +03:00
Jan Varga 6e2ea3fb58 Bug 1722668 - Add test_unsetLastAccessTime.js for the case when quota information is cached; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D125169
2021-09-22 19:08:33 +00:00
Jan Varga a294b48418 Bug 1722668 - Implement nsIQuotaManagerService::getFullOriginMetadata; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D125168
2021-09-22 19:08:33 +00:00
Jan Varga 7d0fd78cda Bug 1722668 - Speed up temporary storage initialization by archiving unaccessed origin directories; r=jari
This patch introduces a new notion of unaccessed origins. An origin is
considered as unaccessed if its age is older than a threshold (controlled by a
new preference, currently set to 13 months). Unaccessed origins are collected
during quota info loading.
When quota info loading is finished we check if it took a long time (controlled
by a new preference, currently set to 21s) and eventually archive unaccessed
origins which should speed up temporary storage initialization in a new
session.
Archiving consits of creating a new directory (archive) under storage/archives/0
directory (the name is based on the current date) and moving unaccessed origin
directories to the archive.
Once the patch lands, we will be monitoring QM_QUOTA_INFO_LOAD_TIME_V0
telemetry (quota info load time) and eventually lower down the preference for
long quota info load time.
If there are no issues, the archiving will be replaced with a hard removal of
unaccessed origins and also of the archives which were created in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D123049
2021-09-04 21:54:53 +00:00
Jan Varga d78c89f78e Bug 1722668 - Implement a workaround for the case when GetLastModifiedTime returns INT64_MIN; r=jari
Differential Revision: https://phabricator.services.mozilla.com/D123613
2021-09-04 21:54:52 +00:00
Csoregi Natalia 03b44ad93d Backed out 3 changesets (bug 1722668) for failures on test_unsetLastAccessTime.js. CLOSED TREE
Backed out changeset db05822c64ff (bug 1722668)
Backed out changeset c9f100cb3f86 (bug 1722668)
Backed out changeset a7179b67eb1a (bug 1722668)
2021-09-05 00:22:49 +03:00
Jan Varga 127496a5fe Bug 1722668 - Speed up temporary storage initialization by archiving unaccessed origin directories; r=jari
This patch introduces a new notion of unaccessed origins. An origin is
considered as unaccessed if its age is older than a threshold (controlled by a
new preference, currently set to 13 months). Unaccessed origins are collected
during quota info loading.
When quota info loading is finished we check if it took a long time (controlled
by a new preference, currently set to 21s) and eventually archive unaccessed
origins which should speed up temporary storage initialization in a new
session.
Archiving consits of creating a new directory (archive) under storage/archives/0
directory (the name is based on the current date) and moving unaccessed origin
directories to the archive.
Once the patch lands, we will be monitoring QM_QUOTA_INFO_LOAD_TIME_V0
telemetry (quota info load time) and eventually lower down the preference for
long quota info load time.
If there are no issues, the archiving will be replaced with a hard removal of
unaccessed origins and also of the archives which were created in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D123049
2021-09-04 20:10:13 +00:00
Jan Varga 2f260cc9c0 Bug 1722668 - Implement a workaround for the case when GetLastModifiedTime returns INT64_MIN; r=jari
Differential Revision: https://phabricator.services.mozilla.com/D123613
2021-09-04 20:10:12 +00:00
Jan Varga d017e0a42a Bug 1724897 - QM: Introduce QM_TO_RESULT sub-macro; r=jari
Differential Revision: https://phabricator.services.mozilla.com/D122208
2021-08-10 13:59:05 +00:00
Jan Varga 4ad6f0533e Bug 1724895 - QM: Introduce type alias for Result<Ok, QMResult>; r=jari
This patch introduces a new type alias OkOrErr for Result<Ok, QMResult> and also converts some existing occurencies of Result<Ok, QMResult> to OkOrErr.

Differential Revision: https://phabricator.services.mozilla.com/D122206
2021-08-10 13:59:04 +00:00
Jan Varga e9546b5acd Bug 1621920 - Convert IDB client to use the new macro for warning about unknown stuff in .files directory and add handling of unknown directories in .files directory; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119586
2021-08-03 10:46:28 +00:00
Luca Greco e723364e2c Bug 1720487 - Ensure QuotaManager does not evict PERSISTENT_TYPE_DEFAULT data associated to a WebExtension origin. r=dom-storage-reviewers,asuth
This patch introduce an additional check inside the Helper::GetInactiveOriginInfos static method
used internally by CollectOriginsForEviction to ensure that QuotaManager will not select an
extension origin as an inactive origin to evict non persisted data from.

The rationale is that unlike websites (which may more likely using the locally stored data
as a local cache, but still able to retrieve the same data again from the server side),
extensions do not have a remote counterpart and so evicting their data would result
into potential data loss for the users.

Besides that, the browser extensions (unlike websites) are explicitly installed and uninstalled by
the user and all the data associated to the extension will be completely removed when the
extension is uninstalled.

Differential Revision: https://phabricator.services.mozilla.com/D120470
2021-07-21 19:27:45 +00:00
Jan Varga 28f6cf6f67 Bug 1718190 - QM: Move ScopedLogExtraInfo into own h/cpp files; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D118807
2021-06-25 10:21:27 +00:00
Jan Varga daa6cfff06 Bug 1713820 - Rename QM_ENABLE_SCOPED_LOG_EXTRA_INFO to QM_SCOPED_LOG_EXTRA_INFO_ENABLED; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D117135
2021-06-08 16:27:30 +00:00
Jan Varga 2b16e677f8 Bug 1713820 - Move QM_ERROR_STACKS_ENABLED definition to Config.h; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D117133
2021-06-08 16:27:29 +00:00
Jan Varga 5977b6fdeb Bug 1708643 - Add generic predicate and fallback functions for QM_OR_ELSE_(WARN|NOTE|LOG)_IF; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D114935
2021-05-30 06:37:28 +00:00
Jan Varga 08cbb7600c Bug 1708643 - Add QM_OR_ELSE_WARN_IF/QM_OR_ELSE_NOTE_IF/QM_OR_ELSE_LOG_IF macros; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D114844
2021-05-30 06:37:27 +00:00
Jan Varga 7d1d36d350 Bug 1708643 - Rename orElseFunc argument to fallback in QM_OR_ELSE_REPORT definition; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D114843
2021-05-29 05:05:39 +00:00
Jan Varga 1afda44bfb Bug 1709352 - Support error stacks only in EARLY_BETA_OR_EARLIER) || DEBUG builds; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D114736
2021-05-25 09:06:11 +00:00
Jan Varga c06f56c861 Bug 1709352 - Allow QMResult errors to use existing stack id and to increase the frame id during error propagation; r=dom-storage-reviewers,asuth,glandium
Differential Revision: https://phabricator.services.mozilla.com/D114243
2021-05-25 07:28:20 +00:00
Jan Varga 01123f15c4 Bug 1709352 - Add ToResult function for QMResult; r=dom-storage-reviewers,jstutte,asuth
Differential Revision: https://phabricator.services.mozilla.com/D114242
2021-05-25 07:28:19 +00:00
Jan Varga 3f78809e7b Bug 1709352 - Introduce QMResult; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D114241
2021-05-25 07:28:19 +00:00
Jan Varga d213540b73 Bug 1702422 - Add missing include to create_db.js in groupMismatch_profile.zip; r=dom-storage-reviewers,asuth
This patch also fixes the unset "accessed" flag in the origin table in
storage.sqlite.

Differential Revision: https://phabricator.services.mozilla.com/D113491
2021-04-28 07:33:53 +00:00
Jan Varga c9b2e50517 Bug 1702422 - Add missing include to create_db.js in removedOrigin_profile.zip; r=dom-storage-reviewers,asuth
An empty buffer was stored in SimpleDB because of the missing include.

Differential Revision: https://phabricator.services.mozilla.com/D113490
2021-04-28 07:33:53 +00:00
Jan Varga a43be2a21f Bug 1702422 - Report failed LoadQuotaFromCache as a warning (instead of an error); r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D113370
2021-04-27 07:12:23 +00:00
Jan Varga 4bd1418875 Bug 1702422 - Move tests intended for quota info caching into a standalone directory; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D113369
2021-04-27 07:12:22 +00:00
Jan Varga 4d52706661 Bug 1702415 - Fix relative path calculation of exported source files (like QuotaCommon.h); r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D112999
2021-04-23 13:59:42 +00:00
Jan Varga 3323c1e8c3 Bug 1702415 - Replace aSourceFile with aSourceFilePath; r=dom-storage-reviewers,jstutte,asuth
This patch adjusts other similar names as well:
MakeRelativeSourceFileName -> MakeSourceFileRelativePath
relativeSourceFile -> sourceFileRelativePath
thisFileRelativeSourceFileName -> thisSourceFileRelativePath

Differential Revision: https://phabricator.services.mozilla.com/D113076
2021-04-23 12:02:58 +00:00
imoraru c3a79c6d69 Backed out 3 changesets (bug 1702415) for causing quota related build bustages. CLOSED TREE
Backed out changeset d10768c1b3ae (bug 1702415)
Backed out changeset e00a02611cd4 (bug 1702415)
Backed out changeset 2d54750b9f34 (bug 1702415)
2021-04-23 13:27:42 +03:00
Jan Varga a10db98510 Bug 1702415 - Fix relative path calculation of exported source files (like QuotaCommon.h); r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D112999
2021-04-23 09:56:30 +00:00
Jan Varga c831b279f3 Bug 1702415 - Replace aSourceFile with aSourceFilePath; r=dom-storage-reviewers,jstutte,asuth
This patch adjusts other similar names as well:
MakeRelativeSourceFileName -> MakeSourceFileRelativePath
relativeSourceFile -> sourceFileRelativePath
thisFileRelativeSourceFileName -> thisSourceFileRelativePath

Differential Revision: https://phabricator.services.mozilla.com/D113076
2021-04-23 09:56:29 +00:00
Tom Tung 1631cf13b6 Bug 1647316 - Update expected file layout for test_originMismatch since the padding file will be removed if the caches.sqlite doesn't exist after initializing; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D109639
2021-04-16 01:09:11 +00:00
Tom Tung c994e030b2 Bug 1647316 - Revert the change for test_initTemporaryStorage.js since we have test_originInit.js; r=dom-workers-and-storage-reviewers,janv
Depends on D80823

Differential Revision: https://phabricator.services.mozilla.com/D80824
2021-04-16 01:09:09 +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 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