WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
47245
IDBDatabase and IDBObjectStore metadata is not recovered correctly when the setVersion transactions aborts.
https://bugs.webkit.org/show_bug.cgi?id=47245
Summary
IDBDatabase and IDBObjectStore metadata is not recovered correctly when the s...
Andrei Popescu
Reported
2010-10-05 20:56:05 PDT
IDBDatabase and IDBObjectStore metadata is not recovered correctly when the setVersion transactions aborts.
Attachments
Patch
(29.36 KB, patch)
2010-10-05 21:04 PDT
,
Andrei Popescu
no flags
Details
Formatted Diff
Diff
Patch
(42.12 KB, patch)
2010-10-06 15:16 PDT
,
Andrei Popescu
jorlow
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Andrei Popescu
Comment 1
2010-10-05 21:04:03 PDT
Created
attachment 69883
[details]
Patch
Jeremy Orlow
Comment 2
2010-10-05 22:50:14 PDT
Comment on
attachment 69883
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=69883&action=review
Looks pretty good!
> LayoutTests/storage/indexeddb/objectstore-basics.html:73 > +function createIndex() {
{ on next line
> LayoutTests/storage/indexeddb/resources/shared.js:86 > + verifyAbortEvent(event);
Verify complete event.
> WebCore/storage/IDBDatabaseBackendImpl.cpp:193 > + createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreFromMap, database, objectStore))) {
This should add it, right? Can you add testing for that?
> WebCore/storage/IDBDatabaseBackendImpl.cpp:256 > + database->m_objectStores.remove(objectStore->name());
What does remove do if it doesn't exist? If it doesn't assert, maybe add one manually?
> WebCore/storage/IDBDatabaseBackendImpl.cpp:261 > + database->m_objectStores.set(objectStore->name(), objectStore);
similarly here
> WebCore/storage/IDBObjectStoreBackendImpl.cpp:414 > + objectStore->m_indexes.remove(index->name());
and here
> WebCore/storage/IDBObjectStoreBackendImpl.cpp:419 > + objectStore->m_indexes.set(index->name(), index);
and here
> WebCore/storage/IDBTransactionBackendImpl.cpp:70 > + m_abortTaskQueue.prepend(abortTask);
Is this expensive? If so, maybe you should process the abort task queue in reverse? And maybe have a layout test that adds removes adds removes and then aborts? Also maybe add a layout test that double adds then aborts...and double removes then aborts?
> WebCore/storage/IDBTransactionBackendImpl.h:50 > + virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task> task, PassOwnPtr<ScriptExecutionContext::Task> abortTaskn);
abortTask minus the n
Andrei Popescu
Comment 3
2010-10-06 15:09:24 PDT
Thanks for the review! (In reply to
comment #2
)
> (From update of
attachment 69883
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=69883&action=review
> > Looks pretty good! > > > LayoutTests/storage/indexeddb/objectstore-basics.html:73 > > +function createIndex() { > > { on next line >
Fixed.
> > LayoutTests/storage/indexeddb/resources/shared.js:86 > > + verifyAbortEvent(event); > > Verify complete event.
> Fixed,
> > WebCore/storage/IDBDatabaseBackendImpl.cpp:193 > > + createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreFromMap, database, objectStore))) { > > This should add it, right? Can you add testing for that?
> Fixed.
> > WebCore/storage/IDBDatabaseBackendImpl.cpp:256 > > + database->m_objectStores.remove(objectStore->name()); > > What does remove do if it doesn't exist? If it doesn't assert, maybe add one manually?
> Added asserts.
> > > WebCore/storage/IDBTransactionBackendImpl.cpp:70 > > + m_abortTaskQueue.prepend(abortTask); > > Is this expensive? If so, maybe you should process the abort task queue in reverse?
> It's not expensive.
> And maybe have a layout test that adds removes adds removes and then aborts? > > Also maybe add a layout test that double adds then aborts...and double removes then aborts? >
Added.
> > WebCore/storage/IDBTransactionBackendImpl.h:50 > > + virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task> task, PassOwnPtr<ScriptExecutionContext::Task> abortTaskn); > > abortTask minus the n
Fixed.
Andrei Popescu
Comment 4
2010-10-06 15:16:56 PDT
Created
attachment 69997
[details]
Patch
Jeremy Orlow
Comment 5
2010-10-06 15:31:04 PDT
Comment on
attachment 69997
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=69997&action=review
r=me
> WebCore/storage/IDBDatabase.cpp:62 > + if (!objectStore || !m_setVersionTransaction)
Do this before you call the backend function!!
> WebCore/storage/IDBDatabaseBackendImpl.cpp:143 > + createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreFromMap, database, objectStore)))
{}
> WebCore/storage/IDBDatabaseBackendImpl.cpp:217 > + createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version)))
use {}
> WebCore/storage/IDBObjectStoreBackendImpl.cpp:279 > + createCallbackTask(&IDBObjectStoreBackendImpl::removeIndexFromMap, objectStore, index)))
use {}s
Andrei Popescu
Comment 6
2010-10-06 15:52:48 PDT
Committed
r69247
: <
http://trac.webkit.org/changeset/69247
>
WebKit Review Bot
Comment 7
2010-10-06 16:55:47 PDT
http://trac.webkit.org/changeset/69247
might have broken Chromium Win Release
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