New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 876659 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

WebSQL and IndexedDB don't support deletion in incognito mode

Project Member Reported by dullweber@chromium.org, Aug 22

Issue description

Chrome Version: 68.0.3440.84
OS: Linux

What steps will reproduce the problem?
(1) Visit a page that creates websql and indexeddb data in incognito mode
(I finally wrote a testing tool for these purposes: https://rawgit.com/xchrdw/862c013b03edfa4ac43d44424f1bbeff/raw/886ed56b42f6b96b6d66986d4879521263457062/site_data_tester.html)
(2) Go to devtools > application > Clear Storage and delete all data
(3) Reload the page

What is the expected result?
All data should be gone

What happens instead?
IndexedDB and WebSQL don't get deleted.
This probably also affects ClearSiteData and is the cause of a Guestmode bug:  868870 

 
Description: Show this description
Owner: dullweber@chromium.org
Status: Assigned (was: Untriaged)
I'm working on a fix for the Indexed DB part of this.
Cc: dullweber@chromium.org
Owner: jsb...@chromium.org
Then I will assign the bug to you. Thanks!
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bb6fa188ef526f4c90db68a889715cc1624874f4

commit bb6fa188ef526f4c90db68a889715cc1624874f4
Author: Joshua Bell <jsbell@chromium.org>
Date: Wed Oct 10 23:38:47 2018

Support deletion of Indexed DB backing stores in Incognito mode.

In Incognito sessions, Indexed DB backing stores are held in-memory.
They normally last as long as the session, but if explicitly deleted
the backing stores should be freed. This was not happening due to
incorrect early-exits and explicit references.

Bug:  876659 
Change-Id: I0f252e6eaab1d6687b5515400ddefd91b18bc94d
Reviewed-on: https://chromium-review.googlesource.com/c/1272123
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598572}
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/indexed_db_browsertest.cc
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/indexed_db_context_impl.cc
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/indexed_db_factory.h
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/indexed_db_factory_impl.cc
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/indexed_db_factory_impl.h
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/indexed_db_factory_unittest.cc
[modify] https://crrev.com/bb6fa188ef526f4c90db68a889715cc1624874f4/content/browser/indexed_db/mock_indexed_db_factory.h

Cc: ew...@chromium.org sabineb@chromium.org droger@chromium.org jlebel@chromium.org tangltom@chromium.org pwnall@chromium.org mek@chromium.org msarda@chromium.org bsazonov@chromium.org bauerb@chromium.org
 Issue 868870  has been merged into this issue.
At least part of the WebSQL issue looks like a bug in DatabaseTracker::DeleteOrigin where the path for incognito databases is not constructed correctly per the logic in DatabaseTracker::GetOriginDirectory
For tracking purposes, https://chromium-review.googlesource.com/c/chromium/src/+/1277698 fixes the DeleteOrigin problem. 

However, the problem still reproduces per the repro steps!
It's probably that incognito vfs handles get held for the lifetime of the DatabaseTracker in incognito_file_handles_, so if we attempt to re-open the database we'll end up using the same handle. 

We'll need to drop the handles associated with a database being deleted.
Yep, that does it. Added it to the CL above. Needs tests, though.
I tested it. It seems to be working, thanks.
Status: Started (was: Assigned)
Components: -Privacy Privacy>Incognito
Project Member

Comment 14 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9ece768c6d43c7559bd637d45df6e18fac8a9f23

commit 9ece768c6d43c7559bd637d45df6e18fac8a9f23
Author: Joshua Bell <jsbell@chromium.org>
Date: Wed Oct 17 15:17:42 2018

Browsing Data: Add Incognito deletion tests

Add test variants to ensure that various storage types are deleted
via the browsing data remover code in Incognito sessions.

Bug:  876659 
Change-Id: Iad59adf8e7b07e2261257f2fbbfb43b3e31c5851
Reviewed-on: https://chromium-review.googlesource.com/c/1285071
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600395}
[modify] https://crrev.com/9ece768c6d43c7559bd637d45df6e18fac8a9f23/chrome/browser/browsing_data/browsing_data_database_helper.cc
[modify] https://crrev.com/9ece768c6d43c7559bd637d45df6e18fac8a9f23/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bb833a07a0e8d1ca8222c697d55867ca301eb2a6

commit bb833a07a0e8d1ca8222c697d55867ca301eb2a6
Author: Joshua Bell <jsbell@chromium.org>
Date: Wed Oct 17 22:11:27 2018

WebSQL: Support deletion backing stores in Incognito mode.

Chrome's WebSQL implementation handles incognito mode by creating
delete-on-exit directories (see crbug.com/779689). When an particular
origin is getting deleted (e.g. via devtools) an origin-specific
directory needs to get deleted. The logic to compute the directory
path differs for incognito and non-incognito sessions, and there was a
logic mismatch between the creation and deletion code.

Additionally, the actual database files are marked "delete on close"
and this necessitated holding onto file handles for the lifetime
of the tracker to handle open/close/re-open. But when the origin is
deleted, these handles need to be dropped.

Refactor so a single method is used to compute the directory path in
all cases, and drop handles when the origin is deleted.

Bug: 779689,  876659 
Change-Id: Idaf53ff407246c4dc3f66cdd84d2d4075b969d8e
Reviewed-on: https://chromium-review.googlesource.com/c/1277698
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600574}
[modify] https://crrev.com/bb833a07a0e8d1ca8222c697d55867ca301eb2a6/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc
[modify] https://crrev.com/bb833a07a0e8d1ca8222c697d55867ca301eb2a6/storage/browser/database/database_tracker.cc
[modify] https://crrev.com/bb833a07a0e8d1ca8222c697d55867ca301eb2a6/storage/browser/database/database_tracker.h
[modify] https://crrev.com/bb833a07a0e8d1ca8222c697d55867ca301eb2a6/storage/browser/database/database_tracker_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment