Bug 107582

Summary: IndexedDB: IDBKeyRange::isOnlyKey() does pointer equality comparison
Product: WebKit Reporter: Joshua Bell <jsbell>
Component: WebCore Misc.Assignee: Joshua Bell <jsbell>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, dgrogan, michael, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Joshua Bell 2013-01-22 13:30:56 PST
To simplify the backend API, various methods that can take a key-or-keyrange just accept a keyrange, and we map a script call with just a key to IDBKeyRange::only(key). On the back end, optimized paths can check keyrange->isOnlyKey()

IDBKeyRange::isOnlyKey() does pointer equality comparison, so if there are IPC hijinks between the front- and back-end (e.g. in multiprocess ports) that don't pass along this flag, the equality comparison would fail and the unoptimized path would be used.

It looks like the only caller is in GetOperation::perform() in IDBDatabaseBackendImpl.cpp

A trivial fix would be to replace the equality test with: !m_lower->compare(m_upper)
Comment 1 Joshua Bell 2013-01-30 14:25:40 PST
Created attachment 185573 [details]
Patch
Comment 2 Joshua Bell 2013-01-30 14:26:02 PST
alecflett@ - can you take a look?
Comment 3 Alec Flett 2013-01-30 14:28:57 PST
nice. lgtm
Comment 4 Joshua Bell 2013-01-30 14:33:53 PST
tony@ - r?
Comment 5 WebKit Review Bot 2013-01-30 15:32:07 PST
Comment on attachment 185573 [details]
Patch

Rejecting attachment 185573 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=gce-cq-04', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 185573, '--port=chromium-xvfb']" exit_code: 2 cwd: /mnt/git/webkit-commit-queue

Last 500 characters of output:
t/git/webkit-commit-queue/Source/WebKit/chromium/v8 --revision 13482 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
53>At revision 13482.

________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'

________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
Updating webkit projects from gyp files...

Full output: http://queues.webkit.org/results/16183937
Comment 6 Joshua Bell 2013-01-30 15:34:33 PST
Comment on attachment 185573 [details]
Patch

"Merge conflict during commit: Conflict at '/trunk/Source/WebCore/ChangeLog' at /usr/lib/git-core/git-svn line 570"

Just giving it another try.
Comment 7 WebKit Review Bot 2013-01-30 16:27:13 PST
Comment on attachment 185573 [details]
Patch

Clearing flags on attachment: 185573

Committed r141338: <http://trac.webkit.org/changeset/141338>
Comment 8 WebKit Review Bot 2013-01-30 16:27:16 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Joshua Bell 2013-02-01 10:04:35 PST
And for the record, this graph shows the associated perf boost pretty well:

http://build.chromium.org/f/chromium/perf/chromium-rel-win7-dual/idb_perf/report.html?history=150&rev=180143&graph=testReadCache_50_true