Bug 43794

Summary: Some settings are linked to the PageGroup not the Page. Create a new class for those.
Product: WebKit Reporter: Jeremy Orlow <jorlow>
Component: New BugsAssignee: Jeremy Orlow <jorlow>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, apavlov, darin, eric, kenneth, lyon.chen, mjs, ossy, sam, steveblock, tonikitoo, webkit-ews, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch abarth: review+

Jeremy Orlow
Reported 2010-08-10 09:06:33 PDT
Some settings are linked to the PageGroup not the Page. Create a new class for those.
Attachments
Patch (24.60 KB, patch)
2010-08-10 09:20 PDT, Jeremy Orlow
no flags
Patch (23.69 KB, patch)
2010-08-10 09:33 PDT, Jeremy Orlow
no flags
Patch (24.35 KB, patch)
2010-08-11 03:55 PDT, Jeremy Orlow
no flags
Patch (26.55 KB, patch)
2010-08-11 04:37 PDT, Jeremy Orlow
no flags
Patch (26.55 KB, patch)
2010-08-11 06:19 PDT, Jeremy Orlow
no flags
Patch (26.82 KB, patch)
2010-08-11 06:54 PDT, Jeremy Orlow
no flags
Patch (18.37 KB, patch)
2010-08-13 05:32 PDT, Jeremy Orlow
abarth: review+
Jeremy Orlow
Comment 1 2010-08-10 09:20:47 PDT
Jeremy Orlow
Comment 2 2010-08-10 09:24:26 PDT
It's likely this will fail on some of the EWS bots. Will watch them and fix other dependencies similar to the mac port one. Please review assuming these will be fixed before landing. ccing Steve since we discussed this together and mjs/darin/sam/ap in case they disagree that this is a move in the right direction.
Jeremy Orlow
Comment 3 2010-08-10 09:33:26 PDT
Steve Block
Comment 4 2010-08-11 02:43:29 PDT
Comment on attachment 64016 [details] Patch WebCore/page/GroupSettings.cpp:13 + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY Wrong copyright holder WebCore/page/GroupSettings.h:57 + unsigned m_localStorageQuota; I know you're just moving code, but it might be good while you're here to make the units clear in the variable name. WebCore/page/GroupSettings.h:55 + PageGroup* m_pageGroup; Why do we need this? WebCore/page/GroupSettings.h:44 + unsigned localStorageQuota() const { return m_localStorageQuota; } These were previously guarded with ENABLE(DOM_STORAGE). It looks safe, but did you mean to remove the guard? WebCore/page/Settings.h:136 + unsigned sessionStorageQuota() const { return m_sessionStorageQuota; } Ditto about removing guard WebKit/mac/WebView/WebView.mm:690 + _private->page->group().groupSettings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); This probably warrants an comment explaining that this will overwrite the setting for the group if it's already been set by another WebView/Page. You could also add that we might want to expose a group setting in the WebKit API in the future.
Jeremy Orlow
Comment 5 2010-08-11 02:49:52 PDT
(In reply to comment #4) > (From update of attachment 64016 [details]) > WebCore/page/GroupSettings.cpp:13 > + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY > Wrong copyright holder Copied in a copyright form another file that says "APPLE AND ITS CONTRIBUTORS" > WebCore/page/GroupSettings.h:57 > + unsigned m_localStorageQuota; > I know you're just moving code, but it might be good while you're here to make the units clear in the variable name. Good idea. > WebCore/page/GroupSettings.h:55 > + PageGroup* m_pageGroup; > Why do we need this? We don't. > WebCore/page/GroupSettings.h:44 > + unsigned localStorageQuota() const { return m_localStorageQuota; } > These were previously guarded with ENABLE(DOM_STORAGE). It looks safe, but did you mean to remove the guard? Half the stuff was within guards, half wasn't. I didn't see any reason why we needed the guards though, and it added a bunch of code clutter. So I left them out (and took them out of Settings.h). > WebKit/mac/WebView/WebView.mm:690 > + _private->page->group().groupSettings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); > This probably warrants an comment explaining that this will overwrite the setting for the group if it's already been set by another WebView/Page. You could also add that we might want to expose a group setting in the WebKit API in the future. Good point. Future additions to GroupSettings would hopefully get their own abstraction in various WebKit layers.
Jeremy Orlow
Comment 6 2010-08-11 03:55:00 PDT
Early Warning System Bot
Comment 7 2010-08-11 04:06:09 PDT
Steve Block
Comment 8 2010-08-11 04:10:09 PDT
Comment on attachment 64090 [details] Patch WebCore/page/GroupSettings.h:44 + unsigned localStorageQuotaBytes() const { return m_localStorageQuotaBytes; } I guess there are no other call sites of these methods to update?!
Jeremy Orlow
Comment 9 2010-08-11 04:21:03 PDT
Chromium uses it the quota param. Just haven't updated that part yet.
Jeremy Orlow
Comment 10 2010-08-11 04:35:10 PDT
Actually, Chrome access it a different(In reply to comment #9) > Chromium uses it the quota param. Just haven't updated that part yet. Nm, was mixed up. Apparently no one overrides that default! Fixed the QT build in the same way I did the mac one (with the same fixme). WIll upload in a sec.
Jeremy Orlow
Comment 11 2010-08-11 04:37:31 PDT
Early Warning System Bot
Comment 12 2010-08-11 04:51:50 PDT
Jeremy Orlow
Comment 13 2010-08-11 06:19:19 PDT
Early Warning System Bot
Comment 14 2010-08-11 06:32:46 PDT
Jeremy Orlow
Comment 15 2010-08-11 06:54:18 PDT
Jeremy Orlow
Comment 16 2010-08-11 07:16:08 PDT
K...looks like it builds now. Will commit tomorrow morning (BST) if no one else has comments.
Adam Barth
Comment 17 2010-08-11 22:35:28 PDT
Comment on attachment 64108 [details] Patch lgtm. It might be slightly confusing in the future which settings to put where, but I guess we'll sort that out.
Jeremy Orlow
Comment 18 2010-08-12 03:03:43 PDT
WebKit Review Bot
Comment 19 2010-08-12 03:08:32 PDT
http://trac.webkit.org/changeset/65228 might have broken Qt Linux Release minimal
Jeremy Orlow
Comment 20 2010-08-12 03:21:32 PDT
Jeremy Orlow
Comment 21 2010-08-12 04:11:08 PDT
Jeremy Orlow
Comment 22 2010-08-12 04:16:08 PDT
Saw some weird breakage. Reverting while I investigate.
Jeremy Orlow
Comment 23 2010-08-12 04:19:58 PDT
The two main failures: http://build.webkit.org/builders/Qt%20Linux%20Release%20minimal/builds/6852/steps/compile-webkit/logs/stdio and http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20(Tests)/builds/15327/steps/layout-test/logs/stdio I also realized that there's a chance the page group name would be getting set after we're initializing the localStorageDatabasePath. The correct solution might be to not move localStorageDatabasePath and instead just make the GroupSettings be the place for this stuff in the future.
WebKit Review Bot
Comment 24 2010-08-12 04:38:08 PDT
http://trac.webkit.org/changeset/65234 might have broken Qt Linux Release
Csaba Osztrogonác
Comment 25 2010-08-12 04:41:05 PDT
(In reply to comment #24) > http://trac.webkit.org/changeset/65234 might have broken Qt Linux Release Not at all, it was a roll-out patch.
Jeremy Orlow
Comment 26 2010-08-13 05:01:25 PDT
Yeah, I don't see an easy way to handle localStoragePath, but quota should still be able to move over. Will roll another patch that doesn't try to move localStoragePath.
Jeremy Orlow
Comment 27 2010-08-13 05:32:13 PDT
Jeremy Orlow
Comment 28 2010-08-16 03:03:14 PDT
WebKit Review Bot
Comment 29 2010-08-16 03:08:19 PDT
http://trac.webkit.org/changeset/65405 might have broken Qt Linux Release minimal and Qt Linux ARMv5 Release
Lyon Chen
Comment 30 2010-09-24 07:51:16 PDT
Based on http://dev.w3.org/html5/webstorage/#disk-space, the local storage should also have total amount limit and per site limit. Make it per-PageGroup setting will prevent us from enforce per-site quota, also leave it as per-page setting will make it hard to enforce this quota when user open multiple pages for the same site. So maybe we need a LocalStorageTracker like DatabaseTracker? Or combine them together?
Jeremy Orlow
Comment 31 2010-09-27 04:09:06 PDT
(In reply to comment #30) > Based on http://dev.w3.org/html5/webstorage/#disk-space, the local storage should also have total amount limit and per site limit. Make it per-PageGroup setting will prevent us from enforce per-site quota, also leave it as per-page setting will make it hard to enforce this quota when user open multiple pages for the same site. > > So maybe we need a LocalStorageTracker like DatabaseTracker? Or combine them together? Maybe open a bug for making it possible to set different quotas for different origins (cc me if so). You may also want to add a FIXME to this effect (with a link to the bug) into the code so that someone exposing the setting from a WebKit layer would consider making their API compatible with such a change.
Note You need to log in before you can comment on or make changes to this bug.