Changeset 138670 in webkit
- Timestamp:
- Jan 2, 2013, 3:55:40 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r138668 r138670 1 2013-01-02 David Grogan <dgrogan@chromium.org> 2 3 IndexedDB: Surface a few more leveldb errors. 4 https://bugs.webkit.org/show_bug.cgi?id=105670 5 6 Reviewed by Tony Chang. 7 8 Two calls to old LevelDBTransaction::get slipped through the cracks. 9 10 * Modules/indexeddb/IDBBackingStore.cpp: 11 (WebCore::IndexKeyCursorImpl::loadCurrentRow): 12 (WebCore::IndexCursorImpl::loadCurrentRow): 13 Make these two functions use safeGet instead of get. 14 15 * platform/leveldb/LevelDBTransaction.cpp: 16 * platform/leveldb/LevelDBTransaction.h: 17 Remove get now that it is unused. 18 1 19 2013-01-02 Bem Jones-Bey <bjonesbe@adobe.com> 2 20 -
trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp
r138072 r138670 1557 1557 1558 1558 Vector<char> result; 1559 if (!m_transaction->get(primaryLevelDBKey, result)) { 1559 bool found = false; 1560 bool ok = m_transaction->safeGet(primaryLevelDBKey, result, found); 1561 if (!ok) { 1562 INTERNAL_READ_ERROR(LoadCurrentRow); 1563 return false; 1564 } 1565 if (!found) { 1560 1566 m_transaction->remove(m_iterator->key()); 1561 1567 return false; … … 1642 1648 1643 1649 Vector<char> result; 1644 if (!m_transaction->get(m_primaryLevelDBKey, result)) { 1650 bool found = false; 1651 bool ok = m_transaction->safeGet(m_primaryLevelDBKey, result, found); 1652 if (!ok) { 1653 INTERNAL_READ_ERROR(LoadCurrentRow); 1654 return false; 1655 } 1656 if (!found) { 1645 1657 m_transaction->remove(m_iterator->key()); 1646 1658 return false; -
trunk/Source/WebCore/platform/leveldb/LevelDBTransaction.cpp
r136194 r138670 131 131 } 132 132 133 bool LevelDBTransaction::get(const LevelDBSlice& key, Vector<char>& value)134 {135 bool found = false;136 bool ok = safeGet(key, value, found);137 if (!ok) {138 ASSERT(!found);139 ASSERT_NOT_REACHED();140 }141 return ok && found;142 }143 144 133 bool LevelDBTransaction::commit() 145 134 { -
trunk/Source/WebCore/platform/leveldb/LevelDBTransaction.h
r136194 r138670 55 55 void put(const LevelDBSlice& key, const Vector<char>& value); 56 56 void remove(const LevelDBSlice& key); 57 // FIXME: Rename safeGet to get. 57 58 bool safeGet(const LevelDBSlice& key, Vector<char>& value, bool& found); 58 // FIXME: Convert all callers of get to safeGet then remove get.59 bool get(const LevelDBSlice& key, Vector<char>& value);60 59 bool commit(); 61 60 void rollback(); -
trunk/Source/WebKit/chromium/tests/LevelDBTest.cpp
r136194 r138670 129 129 EXPECT_TRUE(success); 130 130 131 success = transaction->get(key, gotValue); 132 EXPECT_TRUE(success); 131 bool found = false; 132 success = transaction->safeGet(key, gotValue, found); 133 EXPECT_TRUE(success); 134 EXPECT_TRUE(found); 133 135 EXPECT_EQ(comparator.compare(gotValue, oldValue), 0); 134 136 135 boolfound = false;137 found = false; 136 138 success = leveldb->safeGet(key, gotValue, found); 137 139 EXPECT_TRUE(success); … … 149 151 EXPECT_EQ(comparator.compare(gotValue, addedValue), 0); 150 152 151 success = transaction->get(addedKey, gotValue); 152 EXPECT_FALSE(success); 153 success = transaction->safeGet(addedKey, gotValue, found); 154 EXPECT_TRUE(success); 155 EXPECT_FALSE(found); 153 156 } 154 157
Note:
See TracChangeset
for help on using the changeset viewer.