| Summary: | IDB: storage/indexeddb/create-index-with-integer-keys.html fails | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||||
| Component: | WebKit2 | Assignee: | Brady Eidson <beidson> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | alecflett, commit-queue, ggaren, jsbell, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Brady Eidson
2014-02-06 10:24:08 PST
Populating an index if it is created after an object store already has records is what "IndexPopulator" is about. That mechanism is still nuts, though. We're going to do this way better. Have this working in a sane manner with a little JSC in the DatabaseProcess. Working out a kink in the patch (the test still has one wrong result) then I'll post for review. Created attachment 223428 [details]
Patch v1 - Figure out the index keys to write in the DatabaseProcess as part of the createIndex operation itself.
Created attachment 223429 [details]
Patch v2 - Fix style
Comment on attachment 223429 [details] Patch v2 - Fix style View in context: https://bugs.webkit.org/attachment.cgi?id=223429&action=review r=me > Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp:208 > + for (auto i : keyDatas) This should be "auto&" to avoid an apparent copy. > Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp:209 > + keys.append(i.maybeCreateIDBKey()); Let's null check before append to avoid a nullptr dereference later. > Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp:329 > + indexKeys.append(i.maybeCreateIDBKey()); Let's null check before append to avoid a nullptr dereference later. > Source/WebCore/bindings/js/IDBBindingUtilities.cpp:355 > + if (!indexKey->isValid()) > + return; Maybe we should check isValid in both cases -- maybe up at the top, by the nullptr check? It seems that an array key can be invalid, so I guess we should check it. > Source/WebCore/bindings/js/IDBBindingUtilities.cpp:363 > + for (auto i : indexKey->array()) auto&? > Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:646 > + for (auto indexKey : indexKeys) { auto&? > Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:117 > + OwnPtr<JSC::JSGlobalObject> m_globalObject; Please use JSC::Strong. It's like OwnPtr, but for GC instead of malloc. Otherwise, crash-o. |