Description:
There are a ton of moving parts in this code which lends itself to being out of sync at the time of these failures. Navigation, frame addition and frame removal all trigger a series of separate events that change the main security origin, remove unused origins and add new origins.
The failure is occurs when ClearStorageView._securityOrigin has a mismatch of what origins are in the DOMStorageModel._storages map at the time the user clears the site data.
Issue:
- DomStorageModel.clearForOrigin does not protect against the case where _storages[key] is undefined
Changes:
- Adding !storage check to clearForOrigin
- we return early because there is no storage to clear and thus a noop is expected
- also if we resume execution, the following code will attempt to remove the missing storage (will result in no-op) then re-add it (will add a storage that wasn't there previously).
Notes:
- We don't need to worry about the mismatch in the fix since SecurityOriginManager.updateSecurityOrigins will eventually resync the available origins and their storages.
Bug: 1084631
Change-Id: I7bb1abe9182e83239d63478a1c6b68feb7d6451e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2208720
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
By using the script in crrev.com/c/devtools/devtools-frontend/+/1942289
we can prune all globals that are not actually global. Most of these are
internal private variables that are now module-scoped. Some variables
were also completely unused, which ESLint nicely reported.
Change-Id: I43689ac7544ad1239acc7d0eeec4dcd563d7fea9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942290
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.
This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.
Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
This reverts commit fd3d8cadb7971e2934bd98130335d789398ac139.
Reason for revert: http/tests/devtools/indexeddb/live-update-indexeddb-content.js is flaky.
Findit suspects this CL to be the reason for the recent test flakiness. See the bug for more information.
Bug: 979503
Original change's description:
> [DevTools] Await clearing methods in ClearStorageView
>
> Part 1 of adding garbage collection after clearing is done.
>
> Change-Id: I7022c1d6d0d3c8cfabce7f57ba5f689c135b6395
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669175
> Reviewed-by: Erik Luo <luoe@chromium.org>
> Commit-Queue: Harley Li <hhli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#673083}
TBR=luoe@chromium.org,hhli@chromium.org
Change-Id: I5849695b3e5d2c3646303c2f49a801ffbc3ee15f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679704
Reviewed-by: Sergey Poromov <poromov@chromium.org>
Commit-Queue: Sergey Poromov <poromov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#673265}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5a63d041f4c585eaa540963686cc894a342e5de9
- Collect DOM storages from all targets.
- Instantiate InspectorDOMStorage agent for local roots, make
it work with InspectedFrames.
- Add a test which dumps storage security origins.
- Do some origin checks on the frontend to avoid listing
"opaque" security origins which do not support storage.
- Check storage capabilities on the backend to avoid
crasing renderer later.
Bug: 850978, 844377
Change-Id: Ib4e2b444473638d896eb716fb7d9c587f5560335
Reviewed-on: https://chromium-review.googlesource.com/1096283
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#567024}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1600a1f6c38cc1e3e56d6ad5b48ca88f01ea8ab2