[Webkit-unassigned] [Bug 40301] DOM storage should only create databases when needed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 8 10:30:59 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40301





--- Comment #3 from hans at chromium.org  2010-06-08 10:30:59 PST ---
(In reply to comment #2)
> (From update of attachment 58140 [details])
> WebCore/storage/StorageAreaSync.cpp:306
>  +      if (!m_database.isOpen())
> Is it safe to do this?  What happens if it fails the first 2 times (the HD is full or something) but later starts succeeding.  Please verify it'll do the right thing.
It's not safe in that if it first fails to open the database, and later starts succeeding, it will have dropped some sync items and the database contents might not correctly represent the state of the storage. Changing so that if it fails to open the database once, it will not retry.

> 
> I'd lean towards a m_initialized flag.
> 
> But is any of this needed?  Isn't the initial import guaranteed to run first?
> 
Yes, but the initial import no longer always opens the database; that's why it's needed.

> WebCore/storage/StorageAreaSync.cpp:202
>  +  void StorageAreaSync::openDatabase(bool create)
> Create an enum instead of a bool for create and don't create.  It makes code easier to read.
Done. Suggestions for better naming welcome.

> 
> WebCore/ChangeLog:12
>  +          Tested by visiting e.g. http://people.w3.org/mike/localstorage.html and verifying that no file is created in ~/Library/Safari/LocalStorage until something is stored.
> Create a manual-test in WebCore/manual-tests
Done.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list