RESOLVED FIXED 99636
IndexedDB: Destroy leveldb directory if unknown schema is detected
https://bugs.webkit.org/show_bug.cgi?id=99636
Summary IndexedDB: Destroy leveldb directory if unknown schema is detected
David Grogan
Reported 2012-10-17 13:55:59 PDT
IndexedDB: Destroy leveldb directory if unknown schema is detected
Attachments
Patch (2.97 KB, patch)
2012-10-17 13:59 PDT, David Grogan
no flags
Patch (3.12 KB, patch)
2012-10-17 14:02 PDT, David Grogan
no flags
Patch (3.09 KB, patch)
2012-10-17 14:25 PDT, David Grogan
no flags
David Grogan
Comment 1 2012-10-17 13:59:31 PDT
David Grogan
Comment 2 2012-10-17 14:02:32 PDT
David Grogan
Comment 3 2012-10-17 14:04:13 PDT
jsbell/alecflett, could you take a look at this? The webcore patch is small and simple; the test in chromium is huge and messy.
Joshua Bell
Comment 4 2012-10-17 14:14:39 PDT
Comment on attachment 169257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=169257&action=review overall lgtm, w/ nits > Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp:149 > +static const int64_t latestSchemaVersion = 1; static qualifier not necessary for consts. > Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp:150 > +static bool isSchemaOnDiskUnknown(LevelDBDatabase* db) Is "OnDisk" necessary? We'll only use it in the on-disk path, but I don't think it is needed in the function name. Also, I think readability would be improved if the semantics were flipped, i.e. true = known, false = unknown. So maybe isSchemaKnown() ?
David Grogan
Comment 5 2012-10-17 14:23:44 PDT
Comment on attachment 169257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=169257&action=review >> Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp:149 >> +static const int64_t latestSchemaVersion = 1; > > static qualifier not necessary for consts. Removed. >> Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp:150 >> +static bool isSchemaOnDiskUnknown(LevelDBDatabase* db) > > Is "OnDisk" necessary? We'll only use it in the on-disk path, but I don't think it is needed in the function name. > > Also, I think readability would be improved if the semantics were flipped, i.e. true = known, false = unknown. So maybe isSchemaKnown() ? Changed.
David Grogan
Comment 6 2012-10-17 14:25:46 PDT
David Grogan
Comment 7 2012-10-17 14:27:04 PDT
Tony, could you review this?
Tony Chang
Comment 8 2012-10-17 14:38:09 PDT
Comment on attachment 169260 [details] Patch Is it possible to write a test in webkit_unit_tests for this?
David Grogan
Comment 9 2012-10-17 16:22:35 PDT
(In reply to comment #8) > (From update of attachment 169260 [details]) > Is it possible to write a test in webkit_unit_tests for this? It would be possible, but even more work than the content_shell test.
WebKit Review Bot
Comment 10 2012-10-17 17:02:29 PDT
Comment on attachment 169260 [details] Patch Clearing flags on attachment: 169260 Committed r131672: <http://trac.webkit.org/changeset/131672>
WebKit Review Bot
Comment 11 2012-10-17 17:02:34 PDT
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.