WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
75469
Clear localStorage before making assumption about its contents
https://bugs.webkit.org/show_bug.cgi?id=75469
Summary
Clear localStorage before making assumption about its contents
jochen
Reported
2012-01-03 05:32:56 PST
Clear localStorage before making assumption about its contents
Attachments
Patch
(1.25 KB, patch)
2012-01-03 05:34 PST
,
jochen
no flags
Details
Formatted Diff
Diff
Patch
(1.39 KB, patch)
2012-01-03 11:31 PST
,
jochen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
jochen
Comment 1
2012-01-03 05:34:12 PST
Created
attachment 120937
[details]
Patch
jochen
Comment 2
2012-01-03 05:36:42 PST
This test fails flakily on our bots when there are already other entries in localStorage Adam, can you please have a look?
Daniel Bates
Comment 3
2012-01-03 10:50:17 PST
Comment on
attachment 120937
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=120937&action=review
> LayoutTests/platform/chromium/permissionclient/storage-permission.html:21 > + localStorage.clear();
Is this necessary? Can we reuse/simplify the logic in clearLocalStorage.js (*)? By line 3 of LayoutTests/platform/chromium/permissionclient/storage-permission.html, <
http://trac.webkit.org/browser/trunk/LayoutTests/platform/chromium/permissionclient/storage-permission.html?rev=87597#L3
>, we reference this script using the relative URL: resources/clearLocalStorage.js. However this script isn't included because it doesn't exist in directory LayoutTests/platform/chromium/permissionclient/resources. Instead, it exists in directory LayoutTests/storage/domstorage/localstorage/resources. (*) I'm unclear how the decision was made to clear localStorage using the approach taken in <
http://trac.webkit.org/browser/trunk/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js?rev=31908
> as opposed to calling localStorage.clear().
jochen
Comment 4
2012-01-03 10:56:36 PST
(In reply to
comment #3
)
> (From update of
attachment 120937
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=120937&action=review
> > > LayoutTests/platform/chromium/permissionclient/storage-permission.html:21 > > + localStorage.clear(); > > Is this necessary? Can we reuse/simplify the logic in clearLocalStorage.js (*)? By line 3 of LayoutTests/platform/chromium/permissionclient/storage-permission.html, <
http://trac.webkit.org/browser/trunk/LayoutTests/platform/chromium/permissionclient/storage-permission.html?rev=87597#L3
>, we reference this script using the relative URL: resources/clearLocalStorage.js. However this script isn't included because it doesn't exist in directory LayoutTests/platform/chromium/permissionclient/resources. Instead, it exists in directory LayoutTests/storage/domstorage/localstorage/resources.
Ouch, seems I forgot to copy this over...
> > (*) I'm unclear how the decision was made to clear localStorage using the approach taken in <
http://trac.webkit.org/browser/trunk/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js?rev=31908
> as opposed to calling localStorage.clear().
I have no idea either. I think localStorage.clear() is preferable.
jochen
Comment 5
2012-01-03 11:31:49 PST
Created
attachment 120971
[details]
Patch
Daniel Bates
Comment 6
2012-01-03 11:36:07 PST
Comment on
attachment 120971
[details]
Patch Can you elaborate on why we can't use the script clearLocalStorage.js?
jochen
Comment 7
2012-01-03 11:47:19 PST
(In reply to
comment #6
)
> (From update of
attachment 120971
[details]
) > Can you elaborate on why we can't use the script clearLocalStorage.js?
We can, but I don't see the benefit. clearLocalStorage seems to stem from before localStorage.clear() was implemented:
http://trac.webkit.org/browser/trunk/WebCore/storage/Storage.idl?rev=31908
I'm preparing a separate CL that removes clearLocalStorage and replaces it with localStorage.clear() wdyt?
Daniel Bates
Comment 8
2012-01-03 11:52:46 PST
(In reply to
comment #7
)
> I'm preparing a separate CL that removes clearLocalStorage and replaces it with localStorage.clear() wdyt?
Sounds good.
WebKit Review Bot
Comment 9
2012-01-03 17:11:11 PST
Comment on
attachment 120971
[details]
Patch Clearing flags on attachment: 120971 Committed
r103991
: <
http://trac.webkit.org/changeset/103991
>
WebKit Review Bot
Comment 10
2012-01-03 17:11:16 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug