Changeset 141338 in webkit
- Timestamp:
- Jan 30, 2013 4:25:37 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141336 r141338 1 2013-01-30 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: IDBKeyRange::isOnlyKey() does pointer equality comparison 4 https://bugs.webkit.org/show_bug.cgi?id=107582 5 6 Reviewed by Tony Chang. 7 8 Per the bug title, IDBKeyRange::isOnlyKey() was testing the upper/lower pointers to 9 determine if this was a "trivial" range, which can be used to fast-path lookups. This 10 is insufficient in multi-process ports where range values may be thrown across the wire. 11 This is addressed by using the existing key equality tests. 12 13 In addition, the bounds type check incorrectly checked m_lowerType == LowerBoundOpen, which 14 meant the function could never return true (since upper == lower implies closed bounds). 15 Therefore, the fast-path case wasn't used even in single-process ports (e.g. DRT). The 16 slow-path case contructed a backing store cursor over the range, and exited early if the 17 cursor yielded nothing. The fast-path case doesn't need to create a cursor, so needs to 18 deal with lookup misses. This revealed two similar (but trivial) lurking bugs in the 19 fast-path. 20 21 No new behavior; covered by tests such as: storage/indexeddb/get-keyrange.html 22 23 * Modules/indexeddb/IDBBackingStore.cpp: 24 (WebCore::IDBBackingStore::getRecord): Handle backing store read miss case. 25 * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: 26 (WebCore::GetOperation::perform): Handle backing store read miss case. 27 * Modules/indexeddb/IDBKeyRange.cpp: 28 (WebCore::IDBKeyRange::isOnlyKey): Compare keys by value, not pointer, correct 29 type checks, add assertions. 30 * Modules/indexeddb/IDBKeyRange.h: 31 (IDBKeyRange): Move implementation to CPP file. 32 1 33 2013-01-30 Joe Mason <jmason@rim.com> 2 34 -
trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp
r139289 r141338 791 791 return false; 792 792 } 793 if (!found) 794 return true; 793 795 794 796 int64_t version; -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
r141332 r141338 756 756 return; 757 757 } 758 if (!primaryKey) { 759 m_callbacks->onSuccess(); 760 return; 761 } 758 762 if (m_cursorType == IDBCursorBackendInterface::KeyOnly) { 759 763 // Index Value Retrieval Operation -
trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp
r140457 r141338 131 131 } 132 132 133 bool IDBKeyRange::isOnlyKey() const 134 { 135 if (m_lowerType != LowerBoundClosed || m_upperType != UpperBoundClosed) 136 return false; 137 138 ASSERT(m_lower); 139 ASSERT(m_upper); 140 return m_lower->isEqual(m_upper.get()); 141 } 142 133 143 } // namespace WebCore 134 144 -
trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h
r140457 r141338 78 78 static PassRefPtr<IDBKeyRange> bound(ScriptExecutionContext*, const ScriptValue& lower, const ScriptValue& upper, bool lowerOpen, bool upperOpen, ExceptionCode&); 79 79 80 bool isOnlyKey() 81 { 82 return m_lower == m_upper && m_lowerType == LowerBoundOpen && m_upperType == UpperBoundClosed; 83 } 80 bool isOnlyKey() const; 84 81 85 82 private:
Note: See TracChangeset
for help on using the changeset viewer.