[Webkit-unassigned] [Bug 40767] DOM storage should delete databases when they are empty.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 21 01:27:31 PDT 2010


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





--- Comment #7 from hans at chromium.org  2010-06-21 01:27:31 PST ---
(In reply to comment #6)
> (From update of attachment 59081 [details])
> Looks good to me....2 double-checking type questions tho...
> 
> 
> WebCore/storage/StorageAreaSync.cpp:421
>  +          m_database.close();
> Are we super extra ultra sure that there's no way the database can be used after it's closed?  I almost wondr if we should make it an OwnPtr and null it out here so that if we do try to use it later we crash.
Pretty sure at least. The DeleteEmptyDatabase task is scheduled in scheduleFinalSync(), which is called by StorageAreaImpl::close() which is called by StorageNamespaceImpl::close() which is called by StorageNamespaceImpl's destructor. In effect, StorageAreaImpl should be destructed after deleteEmptyDatabases().

Anyway, the member functions in StorageAreaImpl that use m_database all check for it to be open first, so I don't really see any danger here.

> 
> WebCore/storage/StorageAreaSync.cpp:403
>  +      if (!m_database.isOpen())
> When can this happen?  Only if it was never opened or something?
Exactly. Since http://trac.webkit.org/changeset/61023, if there was no previous database file, no new database file is created (thus no db opened) unless something needs to be written to it.

-- 
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