Summary: | Modern IDB: Close UniqueIDBDatabases once they become unused | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||||||
Component: | WebCore Misc. | Assignee: | Brady Eidson <beidson> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | achristensen, alecflett, commit-queue, jsbell | ||||||||
Priority: | P2 | ||||||||||
Version: | Safari 9 | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 149117 | ||||||||||
Attachments: |
|
Description
Brady Eidson
2016-03-02 10:54:49 PST
Created attachment 272674 [details]
Patch v1
Attachment 272674 [details] did not pass style-queue:
ERROR: Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:601: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4]
Total errors found: 1 in 16 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 272675 [details]
Patch v1 with more style
Comment on attachment 272675 [details] Patch v1 with more style View in context: https://bugs.webkit.org/attachment.cgi?id=272675&action=review Please add a test that opens too many databases and hits the expected error. > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1137 > + // Assuming it is not ephemeral, the server should now close it to free up resources. Why do we only close non-ephemeral databases? Shouldn't a memory backing store just not do anything when it closes? I think this is unnecessary complexity. (In reply to comment #4) > Comment on attachment 272675 [details] > Patch v1 with more style > > View in context: > https://bugs.webkit.org/attachment.cgi?id=272675&action=review > > Please add a test that opens too many databases and hits the expected error. > > > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1137 > > + // Assuming it is not ephemeral, the server should now close it to free up resources. > > Why do we only close non-ephemeral databases? Shouldn't a memory backing > store just not do anything when it closes? I think this is unnecessary > complexity. As discussed in person, opening, then closing, then reopening a database in private browsing needs to work - you need to get back to the same in-memory data. The only reason we can close *persistent* databases is because we can get them back from disk. Created attachment 272689 [details]
Patch for landing
(Alex said r+ in person, didn't twiddle the review bit here in the bug) https://bugs.webkit.org/show_bug.cgi?id=154706 was caused by this bug. Comment on attachment 272689 [details] Patch for landing Clearing flags on attachment: 272689 Committed r197474: <http://trac.webkit.org/changeset/197474> |