RESOLVED FIXED 90713
Consider closing unused localStorage database after a timeout.
https://bugs.webkit.org/show_bug.cgi?id=90713
Summary Consider closing unused localStorage database after a timeout.
Yongjun Zhang
Reported 2012-07-06 16:48:34 PDT
We should consider closing the underlying sqlite database if there is no active document referencing it. We can do this after a timeout to avoid closing and opening the same database too often, e.g., when user is doing back/forward navigation.
Attachments
close unused sqlite db after 300 seconds. (19.63 KB, patch)
2012-07-06 17:30 PDT, Yongjun Zhang
gyuyoung.kim: commit-queue-
Fix build and style issues. (21.50 KB, patch)
2012-07-06 22:00 PDT, Yongjun Zhang
no flags
Fix more style issues. (21.53 KB, patch)
2012-07-06 22:12 PDT, Yongjun Zhang
beidson: review-
Addressing review comments. (21.50 KB, patch)
2012-07-09 12:12 PDT, Yongjun Zhang
beidson: review+
webkit.review.bot: commit-queue-
Reviewed patch for commit. (21.53 KB, patch)
2012-07-09 17:05 PDT, Yongjun Zhang
no flags
Yongjun Zhang
Comment 1 2012-07-06 17:30:07 PDT
Created attachment 151124 [details] close unused sqlite db after 300 seconds.
WebKit Review Bot
Comment 2 2012-07-06 17:33:48 PDT
Attachment 151124 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1 Source/WebCore/storage/StorageAreaImpl.cpp:277: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gyuyoung Kim
Comment 3 2012-07-06 17:36:38 PDT
Comment on attachment 151124 [details] close unused sqlite db after 300 seconds. Attachment 151124 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/13156263
WebKit Review Bot
Comment 4 2012-07-06 17:41:38 PDT
Comment on attachment 151124 [details] close unused sqlite db after 300 seconds. Attachment 151124 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13151498
Build Bot
Comment 5 2012-07-06 17:55:26 PDT
Comment on attachment 151124 [details] close unused sqlite db after 300 seconds. Attachment 151124 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/13157247
Yongjun Zhang
Comment 6 2012-07-06 22:00:08 PDT
Created attachment 151131 [details] Fix build and style issues.
WebKit Review Bot
Comment 7 2012-07-06 22:04:35 PDT
Attachment 151131 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1 Tools/ChangeLog:3: Line contains tab character. [whitespace/tab] [5] Tools/ChangeLog:4: Line contains tab character. [whitespace/tab] [5] Tools/ChangeLog:6: Line contains tab character. [whitespace/tab] [5] Tools/ChangeLog:7: Line contains tab character. [whitespace/tab] [5] Tools/ChangeLog:9: Line contains tab character. [whitespace/tab] [5] Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp:1489: Tab found; better to use spaces [whitespace/tab] [1] Source/WebCore/storage/StorageAreaImpl.cpp:279: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/WebCore/storage/StorageArea.h:59: Missing space inside { }. [whitespace/braces] [5] Source/WebCore/storage/StorageArea.h:60: Missing space inside { }. [whitespace/braces] [5] Total errors found: 9 in 23 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yongjun Zhang
Comment 8 2012-07-06 22:12:48 PDT
Created attachment 151132 [details] Fix more style issues.
Simon Fraser (smfr)
Comment 9 2012-07-09 10:11:33 PDT
Comment on attachment 151132 [details] Fix more style issues. View in context: https://bugs.webkit.org/attachment.cgi?id=151132&action=review > Source/WebCore/storage/StorageAreaImpl.cpp:277 > + --m_accessCount; This should assert that it doesn't go negative.
Brady Eidson
Comment 10 2012-07-09 10:34:47 PDT
Comment on attachment 151132 [details] Fix more style issues. View in context: https://bugs.webkit.org/attachment.cgi?id=151132&action=review Let's go one more pass > Source/WebCore/storage/StorageTracker.cpp:51 > +// If there is no document referecing a storage database, close the underlying database > +// after it has been idle for s_StorageDatabaseIdleInterval seconds. > +static const double StorageDatabaseIdleInterval = 300; typo "referecing" s_StorageDatabaseIdleInterval should be m_StorageDatabaseIdleInterval? And StorageDatabaseIdleInterval should be "DefaultStorageDatabaseIdleInterval"
Yongjun Zhang
Comment 11 2012-07-09 12:12:07 PDT
Created attachment 151293 [details] Addressing review comments.
WebKit Review Bot
Comment 12 2012-07-09 16:09:58 PDT
Comment on attachment 151293 [details] Addressing review comments. Rejecting attachment 151293 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/13165455
Yongjun Zhang
Comment 13 2012-07-09 17:05:50 PDT
Created attachment 151359 [details] Reviewed patch for commit.
WebKit Review Bot
Comment 14 2012-07-09 18:03:55 PDT
Comment on attachment 151359 [details] Reviewed patch for commit. Clearing flags on attachment: 151359 Committed r122174: <http://trac.webkit.org/changeset/122174>
WebKit Review Bot
Comment 15 2012-07-09 18:04:01 PDT
All reviewed patches have been landed. Closing bug.
Ryosuke Niwa
Comment 16 2012-07-09 18:35:25 PDT
Jer Noble
Comment 17 2012-07-19 12:47:53 PDT
This patch added no support for testRunner.setStorageDatabaseIdleInterval() on WK2. Thus, this new test is failing on all WK2 ports.
Note You need to log in before you can comment on or make changes to this bug.