RESOLVED FIXED 44546
Implement the rest of IDBCursors + make them persistent
https://bugs.webkit.org/show_bug.cgi?id=44546
Summary Implement the rest of IDBCursors + make them persistent
Jeremy Orlow
Reported 2010-08-24 13:00:30 PDT
Implement the rest of IDBCursors + make them persistent
Attachments
Patch (65.07 KB, patch)
2010-08-24 13:08 PDT, Jeremy Orlow
no flags
Patch (65.08 KB, patch)
2010-08-25 07:17 PDT, Jeremy Orlow
no flags
Patch (65.18 KB, patch)
2010-08-27 09:27 PDT, Jeremy Orlow
steveblock: review+
Jeremy Orlow
Comment 1 2010-08-24 13:08:45 PDT
Jeremy Orlow
Comment 2 2010-08-24 13:09:31 PDT
Don't worry, the bulk of the size of this patch is just a test.
Andrei Popescu
Comment 3 2010-08-25 04:28:21 PDT
Looks good, couple of comments: > static String cursorWhereFragment(IDBKey::Type type, bool lowerBound, String equality) equality isn't always equality. Maybe call it condition? > "? " + equality + " keyString AND keyDate IS NULL AND keyNumber IS NULL AND "; Hmm, a tuple cannot simultaneously have values for more than one key type, can it? Given this, isn't it sufficient to just match the appropriate column here and not worry about the rest being NULL?
Jeremy Orlow
Comment 4 2010-08-25 04:32:52 PDT
(In reply to comment #3) > Looks good, couple of comments: > > > static String cursorWhereFragment(IDBKey::Type type, bool lowerBound, String equality) > > equality isn't always equality. Maybe call it condition? Will do. > > "? " + equality + " keyString AND keyDate IS NULL AND keyNumber IS NULL AND "; > > Hmm, a tuple cannot simultaneously have values for more than one key type, can it? Given this, isn't it sufficient to just match the appropriate column here and not worry about the rest being NULL? I guess so. Steve can you take a look? (Or scan for style and rubber stamp based on Andrei's review since I think it's safe to say he's an expert on this code, even though he's not an official reviewer yet.)
Jeremy Orlow
Comment 5 2010-08-25 07:17:31 PDT
Andrei Popescu
Comment 6 2010-08-25 08:49:03 PDT
LGTM, nice work.
Steve Block
Comment 7 2010-08-27 04:01:44 PDT
Comment on attachment 65415 [details] Patch WebCore/storage/IDBObjectStoreBackendImpl.cpp:269 + static String cursorWhereFragment(IDBKey::Type type, bool lowerBound, String comparisonOperator) this would be easier to follow, both at call site and impl, if it were split into two methods - 'cursorWhereFragmentLowerBound' and 'cursorWhereFragmentUppperBound'. I don't think the current use of a bool saves us any code and it makes it harder to follow. WebCore/storage/IDBObjectStoreBackendImpl.cpp:299 + void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> callbacks) Why is the direction passed in as an unsigned short?
Jeremy Orlow
Comment 8 2010-08-27 08:51:58 PDT
(In reply to comment #7) > (From update of attachment 65415 [details]) > WebCore/storage/IDBObjectStoreBackendImpl.cpp:269 > + static String cursorWhereFragment(IDBKey::Type type, bool lowerBound, String comparisonOperator) > this would be easier to follow, both at call site and impl, if it were split into two methods - 'cursorWhereFragmentLowerBound' and 'cursorWhereFragmentUppperBound'. I don't think the current use of a bool saves us any code and it makes it harder to follow. Good thought! Done. > WebCore/storage/IDBObjectStoreBackendImpl.cpp:299 > + void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> callbacks) > Why is the direction passed in as an unsigned short? Because that's what's in the IDL? "IDBRequest openCursor (in optional IDBKeyRange range, in optional unsigned short direction) raises (IDBDatabaseException);"
Jeremy Orlow
Comment 9 2010-08-27 09:27:54 PDT
Steve Block
Comment 10 2010-08-27 09:31:02 PDT
Comment on attachment 65722 [details] Patch r=me
Jeremy Orlow
Comment 11 2010-08-31 03:46:30 PDT
WebKit Review Bot
Comment 12 2010-08-31 04:24:13 PDT
http://trac.webkit.org/changeset/66473 might have broken Chromium Mac Release
Note You need to log in before you can comment on or make changes to this bug.