RESOLVED FIXED187564
IndexedDB: database file of subframe cannot be removed
https://bugs.webkit.org/show_bug.cgi?id=187564
Summary IndexedDB: database file of subframe cannot be removed
Sihui Liu
Reported 2018-07-11 14:41:55 PDT
Steps to reproduce: 1. Visit a website(e.g. google.com) with subframe that loads content from another domain(e.g. ads.com) and uses IndexedDB. 2. Call removeDataOfTypes function to remove IndexedDB. IndexedDB files at PathToIndexedDB/https_google.com_0/https_ads.com_0/DBName/ are not deleted; files at PathToIndexedDB/https_google.com_0/DBName/ are deleted.
Attachments
Patch (9.87 KB, patch)
2018-07-11 15:57 PDT, Sihui Liu
no flags
Patch (15.38 KB, patch)
2018-07-11 20:52 PDT, Sihui Liu
no flags
Sihui Liu
Comment 1 2018-07-11 15:47:21 PDT
Sihui Liu
Comment 2 2018-07-11 15:57:29 PDT
Ryosuke Niwa
Comment 3 2018-07-11 17:43:56 PDT
Comment on attachment 344784 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=344784&action=review > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:1018 > + 935786CD20F6A2910000CDFC /* IndexedDB.sqlite3 in Copy Resources */, > + 935786CE20F6A2A10000CDFC /* IndexedDB.sqlite3-shm in Copy Resources */, > + 935786CC20F6A2700000CDFC /* IndexedDB.sqlite3-wal in Copy Resources */, Looks like your patch is missing these files.
Sihui Liu
Comment 4 2018-07-11 20:52:33 PDT
Sihui Liu
Comment 5 2018-07-11 20:53:22 PDT
(In reply to Ryosuke Niwa from comment #3) > Comment on attachment 344784 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=344784&action=review > > > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:1018 > > + 935786CD20F6A2910000CDFC /* IndexedDB.sqlite3 in Copy Resources */, > > + 935786CE20F6A2A10000CDFC /* IndexedDB.sqlite3-shm in Copy Resources */, > > + 935786CC20F6A2700000CDFC /* IndexedDB.sqlite3-wal in Copy Resources */, > > Looks like your patch is missing these files. Wops! Fixed.
youenn fablet
Comment 6 2018-07-12 10:22:57 PDT
Comment on attachment 344819 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=344819&action=review > Source/WebCore/ChangeLog:10 > + IDBServer should delete database files recursively to make sure all files are removed. LGTM. Let's say that we have the following IDB databases: IDB1: top level frame origin A with subframe origin A IDB2: top level frame origin A with subframe origin B IDB3: top level frame origin B with subframe origin A. IDB4: top level frame origin B with subframe origin C. When user asks to delete all databases from origin A, we should probably delete IDB1, IDB2 and IDB3. Before the patch, it seems we were deleting IDB1. After the patch, we are also deleting IDB2. Is that right? What about IDB3?
Sihui Liu
Comment 7 2018-07-12 11:42:31 PDT
(In reply to youenn fablet from comment #6) > Comment on attachment 344819 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=344819&action=review > > > Source/WebCore/ChangeLog:10 > > + IDBServer should delete database files recursively to make sure all files are removed. > > LGTM. > > Let's say that we have the following IDB databases: > IDB1: top level frame origin A with subframe origin A > IDB2: top level frame origin A with subframe origin B > IDB3: top level frame origin B with subframe origin A. > IDB4: top level frame origin B with subframe origin C. > > When user asks to delete all databases from origin A, we should probably > delete IDB1, IDB2 and IDB3. > > Before the patch, it seems we were deleting IDB1. > After the patch, we are also deleting IDB2. > Is that right? What about IDB3? Correct! IDB3 won't get deleted. We classify the IndexedDB data record by their top level domain.
WebKit Commit Bot
Comment 8 2018-07-12 12:14:39 PDT
Comment on attachment 344819 [details] Patch Clearing flags on attachment: 344819 Committed r233777: <https://trac.webkit.org/changeset/233777>
WebKit Commit Bot
Comment 9 2018-07-12 12:14:40 PDT
All reviewed patches have been landed. Closing bug.
youenn fablet
Comment 10 2018-07-12 14:19:04 PDT
> > Let's say that we have the following IDB databases: > > IDB1: top level frame origin A with subframe origin A > > IDB2: top level frame origin A with subframe origin B > > IDB3: top level frame origin B with subframe origin A. > > IDB4: top level frame origin B with subframe origin C. > > > > When user asks to delete all databases from origin A, we should probably > > delete IDB1, IDB2 and IDB3. > > > > Before the patch, it seems we were deleting IDB1. > > After the patch, we are also deleting IDB2. > > Is that right? What about IDB3? > > Correct! > > IDB3 won't get deleted. We classify the IndexedDB data record by their top > level domain. We should probably file a bug and find a fix to delete IDB3 as well. I believe we are already doing this clean-up for Cache API and Service Worker registrations.
Sihui Liu
Comment 11 2018-07-12 17:43:32 PDT
(In reply to youenn fablet from comment #10) > > > Let's say that we have the following IDB databases: > > > IDB1: top level frame origin A with subframe origin A > > > IDB2: top level frame origin A with subframe origin B > > > IDB3: top level frame origin B with subframe origin A. > > > IDB4: top level frame origin B with subframe origin C. > > > > > > When user asks to delete all databases from origin A, we should probably > > > delete IDB1, IDB2 and IDB3. > > > > > > Before the patch, it seems we were deleting IDB1. > > > After the patch, we are also deleting IDB2. > > > Is that right? What about IDB3? > > > > Correct! > > > > IDB3 won't get deleted. We classify the IndexedDB data record by their top > > level domain. > > We should probably file a bug and find a fix to delete IDB3 as well. > I believe we are already doing this clean-up for Cache API and Service > Worker registrations. Sure. Created a new bug for tracking: https://bugs.webkit.org/show_bug.cgi?id=187631.
Brent Fulgham
Comment 12 2022-02-12 21:27:22 PST
*** Bug 188164 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.