RESOLVED FIXED 100426
IndexedDB: switch frontend to use int64_t-based references
https://bugs.webkit.org/show_bug.cgi?id=100426
Summary IndexedDB: switch frontend to use int64_t-based references
Alec Flett
Reported 2012-10-25 15:18:38 PDT
This is the followup to bug 100425, which cleans up the frontend code to use int64_t-based objectStore/index references, and removes backend support for String-based references.
Attachments
Patch (60.20 KB, patch)
2012-11-02 14:22 PDT, Alec Flett
no flags
Patch (82.94 KB, patch)
2012-11-05 17:17 PST, Alec Flett
no flags
Patch (58.27 KB, patch)
2012-11-08 11:41 PST, Alec Flett
no flags
Patch for landing (62.98 KB, patch)
2012-11-08 21:29 PST, Alec Flett
no flags
Patch for landing (63.48 KB, patch)
2012-11-09 10:58 PST, Alec Flett
no flags
Alec Flett
Comment 1 2012-10-26 14:21:06 PDT
From the patch in bug 100425, jsbell sez: > Make sure to include a test with 100426 that tests put-record/delete-index/create-index-with-same-name-different-keypath
Alec Flett
Comment 2 2012-11-02 14:22:56 PDT
Joshua Bell
Comment 3 2012-11-02 14:39:56 PDT
Comment on attachment 172134 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172134&action=review Initial pass lgtm > Source/WebCore/Modules/indexeddb/IDBMetadata.h:81 > for (IndexMap::const_iterator it = indexes.begin(); it != indexes.end(); ++it) { Maybe add a FIXME: Add a HashMap of name->id if this is ever a performance concern. (Realistically, no-one is going to call these particular methods in a performance-critical loop.) > Source/WebCore/inspector/Inspector.json:1302 > + { "name": "objectStoreId", "type": "number", "description": "Object store name." }, Update description. Also, "number" or "integer"? > Source/WebCore/inspector/Inspector.json:1303 > + { "name": "indexId", "type": "number", "description": "Index name, empty string for object store data requests." }, Update description. > Source/WebCore/inspector/InspectorIndexedDBAgent.h:63 > + virtual void requestData(ErrorString*, const String& frameId, const String& databaseName, double objectStoreId, double indexId, int skipCount, int pageSize, const RefPtr<InspectorObject>* keyRange, PassRefPtr<RequestDataCallback>); I'm guessing "number" above maps to "double" here. I guess the question is which is worse: ids > 2^53 getting corrupted due to precision loss, or ids > 2^31 being truncated. I'd still lean towards "integer" and make these ints, and perhaps there a place to wedge in an early return if the id is > 2^31? Or at least a FIXME?
Alec Flett
Comment 4 2012-11-02 15:04:57 PDT
There's more code removal coming, (some of the scaffolding from the previous patch) and the inspector tests are still broken. But thanks for the first pass. I think at least with doubles, we should be able to test if the value is > 2^53, rather than integers which will arrive pre-truncated. I'll poke around and see if there's a place to return early.
Alec Flett
Comment 5 2012-11-05 17:17:48 PST
Alec Flett
Comment 6 2012-11-05 17:18:19 PST
ok, this patch is ready for jsbell/dgrogan to take a look.
David Grogan
Comment 7 2012-11-07 13:50:25 PST
Comment on attachment 172448 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172448&action=review LGTM > Source/WebCore/Modules/indexeddb/IDBDatabase.cpp:360 > +int64_t IDBDatabase::findObjectStoreId(const String& name) const This moved from IDBMetaData so that IDBTransaction could use it too? > Source/WebCore/Modules/indexeddb/IDBDatabase.h:106 > + nit blank line > Source/WebCore/inspector/Inspector.json:-1299 > - { "name": "objectStoreName", "type": "string", "description": "Object store name." }, What does this affect? What view will now see an id instead of a name?
Alec Flett
Comment 8 2012-11-08 11:41:27 PST
Alec Flett
Comment 9 2012-11-08 11:43:19 PST
ok, final version ready to go. tony@ - r? 95% code removal 5% minor API code migration..
Alec Flett
Comment 10 2012-11-08 11:43:44 PST
Comment on attachment 172448 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172448&action=review >> Source/WebCore/Modules/indexeddb/IDBDatabase.cpp:360 >> +int64_t IDBDatabase::findObjectStoreId(const String& name) const > > This moved from IDBMetaData so that IDBTransaction could use it too? more that I put it on IDBMetadata temporarily for use during the transition, but now only IDBDatabase uses it - I wanted to bring IDBMetadata back to being pure structs after the refactor was over. >> Source/WebCore/inspector/Inspector.json:-1299 >> - { "name": "objectStoreName", "type": "string", "description": "Object store name." }, > > What does this affect? What view will now see an id instead of a name? I'm nuking the inspector stuff since vsevik switched the inspector over in a better way
WebKit Review Bot
Comment 11 2012-11-08 17:36:34 PST
Comment on attachment 173082 [details] Patch Clearing flags on attachment: 173082 Committed r133984: <http://trac.webkit.org/changeset/133984>
WebKit Review Bot
Comment 12 2012-11-08 17:36:38 PST
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 13 2012-11-08 18:37:27 PST
Re-opened since this is blocked by bug 101684
Alec Flett
Comment 14 2012-11-08 21:29:17 PST
Created attachment 173198 [details] Patch for landing
WebKit Review Bot
Comment 15 2012-11-08 22:27:33 PST
Comment on attachment 173198 [details] Patch for landing Clearing flags on attachment: 173198 Committed r134010: <http://trac.webkit.org/changeset/134010>
WebKit Review Bot
Comment 16 2012-11-08 22:27:37 PST
All reviewed patches have been landed. Closing bug.
noel gordon
Comment 17 2012-11-08 23:32:44 PST
Broke the window build, it seems. 18>------ Build started: Project: webkit_unit_tests, Configuration: Release Win32 ------ 18> IDBAbortOnCorruptTest.cpp 18> IDBDatabaseBackendTest.cpp 18> IDBRequestTest.cpp 18>E:\google-windows-1\chromium-win-release\build\Source\WTF\wtf/PassRefPtr.h(53): error C2027: use of undefined type 'WebCore::DOMStringList' 18> e:\google-windows-1\chromium-win-release\build\source\webcore\modules\indexeddb\IDBCallbacks.h(43) : see declaration of 'WebCore::DOMStringList' 18> E:\google-windows-1\chromium-win-release\build\Source\WTF\wtf/PassRefPtr.h(68) : see reference to function template instantiation 'void WTF::derefIfNotNull<T>(T *)' being compiled 18> with 18> [ 18> T=WebCore::DOMStringList 18> ] 18> E:\google-windows-1\chromium-win-release\build\Source\WTF\wtf/PassRefPtr.h(68) : while compiling class template member function 'WTF::PassRefPtr<T>::~PassRefPtr(void)' 18> with 18> [ 18> T=WebCore::DOMStringList 18> ] 18> tests\IDBAbortOnCorruptTest.cpp(55) : see reference to class template instantiation 'WTF::PassRefPtr<T>' being compiled 18> with 18> [ 18> T=WebCore::DOMStringList 18> ] 18>E:\google-windows-1\chromium-win-release\build\Source\WTF\wtf/PassRefPtr.h(53): error C2227: left of '->deref' must point to class/struct/union/generic type 16> TestWebKitAPI.vcxproj -> ..\..\..\Source\WebKit\chromium\build\Release\\TestWebKitAPI.exe 17> DumpRenderTree.vcxproj -> ..\..\..\Source\WebKit\chromium\build\Release\\DumpRenderTree.exe ========== Build: 17 succeeded, 1 failed, 144 up-to-date, 0 skipped ==========
WebKit Review Bot
Comment 18 2012-11-08 23:36:26 PST
Re-opened since this is blocked by bug 101716
Alec Flett
Comment 19 2012-11-09 10:58:28 PST
Created attachment 173337 [details] Patch for landing
WebKit Review Bot
Comment 20 2012-11-09 11:55:37 PST
Comment on attachment 173337 [details] Patch for landing Clearing flags on attachment: 173337 Committed r134095: <http://trac.webkit.org/changeset/134095>
WebKit Review Bot
Comment 21 2012-11-09 11:55:41 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.