RESOLVED FIXED 75751
IndexedDB: Make WebIDBDatabase::close() idempotent
https://bugs.webkit.org/show_bug.cgi?id=75751
Summary IndexedDB: Make WebIDBDatabase::close() idempotent
Joshua Bell
Reported 2012-01-06 15:19:25 PST
IndexedDB: Make WebIDBDatabase::close() idempotent
Attachments
Patch (1.51 KB, patch)
2012-01-06 15:22 PST, Joshua Bell
no flags
Patch (1.51 KB, patch)
2012-01-06 17:53 PST, Joshua Bell
no flags
Patch (5.21 KB, patch)
2012-01-09 11:25 PST, Joshua Bell
no flags
Joshua Bell
Comment 1 2012-01-06 15:22:12 PST
Joshua Bell
Comment 2 2012-01-06 15:23:59 PST
The simplest/cleanest fix for http://code.google.com/p/chromium/issues/detail?id=80111 requires that chromium's implementation of WebIDBDatabase::close() be idempotent. This is one way to achieve that, which keeps the assertion behavior when called directly (i.e. non-Chromium builds) That said, I'm not positive that this is the best approach.
David Grogan
Comment 3 2012-01-06 17:12:49 PST
Comment on attachment 121508 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=121508&action=review LGTM > Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp:106 > ASSERT(m_databaseCallbacks); You can delete this line now.
Joshua Bell
Comment 4 2012-01-06 17:53:03 PST
Joshua Bell
Comment 5 2012-01-09 10:30:29 PST
tony@ - r? cq?
Tony Chang
Comment 6 2012-01-09 10:40:12 PST
Comment on attachment 121527 [details] Patch Nit: Should we have a layout test that calls close() twice? The assert should be hit in a debug build without this change.
Joshua Bell
Comment 7 2012-01-09 11:13:45 PST
(In reply to comment #6) > (From update of attachment 121527 [details]) > Nit: Should we have a layout test that calls close() twice? The assert should be hit in a debug build without this change. The IDBDatabase object has an internal m_closePending flag which makes a script's call to db.close() exit early if called twice. If that wasn't present, then in the Chromium port the call would eventually make it into WebIDBDatabase::close() and we'd hit this assert. All that said, we didn't appear to have a layout test that called close() twice, so I've added that to database-basics, but it passes both with and without this patch.
Joshua Bell
Comment 8 2012-01-09 11:25:11 PST
WebKit Review Bot
Comment 9 2012-01-09 13:08:46 PST
Comment on attachment 121700 [details] Patch Clearing flags on attachment: 121700 Committed r104481: <http://trac.webkit.org/changeset/104481>
WebKit Review Bot
Comment 10 2012-01-09 13:08:50 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.