Changeset 145441 in webkit
- Timestamp:
- Mar 11, 2013 5:16:50 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r145435 r145441 1 2013-03-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r145435. 4 http://trac.webkit.org/changeset/145435 5 https://bugs.webkit.org/show_bug.cgi?id=112082 6 7 Still does not compile (Requested by jamesr on #webkit). 8 9 * Modules/indexeddb/IDBBackingStore.cpp: 10 (WebCore::IDBBackingStore::getObjectStores): 11 (WebCore::IDBBackingStore::createObjectStore): 12 (WebCore::IDBBackingStore::deleteObjectStore): 13 (WebCore::IDBBackingStore::getRecord): 14 (WebCore::IDBBackingStore::putRecord): 15 (WebCore::IDBBackingStore::clearObjectStore): 16 (WebCore::IDBBackingStore::deleteRecord): 17 (WebCore::IDBBackingStore::getKeyGeneratorCurrentNumber): 18 (WebCore::IDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber): 19 (WebCore::IDBBackingStore::keyExistsInObjectStore): 20 (WebCore::IDBBackingStore::getIndexes): 21 (WebCore::IDBBackingStore::createIndex): 22 (WebCore::IDBBackingStore::deleteIndex): 23 (WebCore::IDBBackingStore::putIndexDataForRecord): 24 (WebCore::IDBBackingStore::findKeyInIndex): 25 (WebCore::IDBBackingStore::getPrimaryKeyViaIndex): 26 (WebCore::IDBBackingStore::keyExistsInIndex): 27 (WebCore::indexCursorOptions): 28 * Modules/indexeddb/IDBBackingStore.h: 29 (IDBBackingStore): 30 * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: 31 (WebCore::DeleteIndexOperation::create): 32 (WebCore::DeleteIndexOperation::DeleteIndexOperation): 33 (DeleteIndexOperation): 34 (WebCore::IDBDatabaseBackendImpl::openInternal): 35 (WebCore::IDBDatabaseBackendImpl::deleteIndex): 36 (WebCore::DeleteIndexOperation::perform): 37 (WebCore::DeleteRangeOperation::perform): 38 (WebCore::ClearOperation::perform): 39 * Modules/indexeddb/IDBLevelDBCoding.cpp: 40 (WebCore::IDBLevelDBCoding::KeyPrefix::KeyPrefix): 41 (WebCore::IDBLevelDBCoding::KeyPrefix::encode): 42 (WebCore::IDBLevelDBCoding::SchemaVersionKey::encode): 43 (WebCore::IDBLevelDBCoding::MaxDatabaseIdKey::encode): 44 (WebCore::IDBLevelDBCoding::DataVersionKey::encode): 45 (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::encode): 46 (WebCore::IDBLevelDBCoding::DatabaseNameKey::encode): 47 (WebCore::IDBLevelDBCoding::DatabaseMetaDataKey::encode): 48 (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::encode): 49 (WebCore::IDBLevelDBCoding::IndexMetaDataKey::encode): 50 (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::encode): 51 (WebCore::IDBLevelDBCoding::IndexFreeListKey::encode): 52 (WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::encode): 53 (WebCore::IDBLevelDBCoding::IndexNamesKey::encode): 54 (WebCore::IDBLevelDBCoding::ObjectStoreDataKey::encode): 55 (WebCore::IDBLevelDBCoding::ExistsEntryKey::encode): 56 * Modules/indexeddb/IDBLevelDBCoding.h: 57 (IDBLevelDBCoding): 58 (KeyPrefix): 59 * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: 60 (WebCore::IDBObjectStoreBackendImpl::IndexWriter::writeIndexKeys): 61 1 62 2013-03-11 Alec Flett <alecflett@chromium.org> 2 63 -
trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp
r145435 r145441 637 637 638 638 // FIXME: This should do some error handling rather than plowing ahead when bad data is encountered. 639 boolIDBBackingStore::getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap* objectStores)639 void IDBBackingStore::getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap* objectStores) 640 640 { 641 641 IDB_TRACE("IDBBackingStore::getObjectStores"); 642 if (!KeyPrefix::isValidDatabaseId(databaseId))643 return false;644 642 const Vector<char> startKey = ObjectStoreMetaDataKey::encode(databaseId, 1, 0); 645 643 const Vector<char> stopKey = ObjectStoreMetaDataKey::encodeMaxKey(databaseId); … … 727 725 728 726 IDBObjectStoreMetadata metadata(objectStoreName, objectStoreId, keyPath, autoIncrement, maxIndexId); 729 if (!getIndexes(databaseId, objectStoreId, &metadata.indexes)) 730 return false; 727 getIndexes(databaseId, objectStoreId, &metadata.indexes); 731 728 objectStores->set(objectStoreId, metadata); 732 729 } 733 return true;734 730 } 735 731 … … 755 751 { 756 752 IDB_TRACE("IDBBackingStore::createObjectStore"); 757 if (!KeyPrefix::validIds(databaseId, objectStoreId))758 return false;759 753 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 760 754 if (!setMaxObjectStoreId(levelDBTransaction, databaseId, objectStoreId)) … … 786 780 { 787 781 IDB_TRACE("IDBBackingStore::deleteObjectStore"); 788 if (!KeyPrefix::validIds(databaseId, objectStoreId))789 return false;790 782 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 791 783 … … 809 801 deleteRange(levelDBTransaction, IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0), IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId)); 810 802 811 return clearObjectStore(transaction, databaseId, objectStoreId); 803 clearObjectStore(transaction, databaseId, objectStoreId); 804 return true; 812 805 } 813 806 … … 815 808 { 816 809 IDB_TRACE("IDBBackingStore::getRecord"); 817 if (!KeyPrefix::validIds(databaseId, objectStoreId))818 return false;819 810 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 820 811 … … 873 864 { 874 865 IDB_TRACE("IDBBackingStore::putRecord"); 875 if (!KeyPrefix::validIds(databaseId, objectStoreId))876 return false;877 866 ASSERT(key.isValid()); 878 879 867 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 880 868 int64_t version = -1; … … 900 888 } 901 889 902 boolIDBBackingStore::clearObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)890 void IDBBackingStore::clearObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId) 903 891 { 904 892 IDB_TRACE("IDBBackingStore::clearObjectStore"); 905 if (!KeyPrefix::validIds(databaseId, objectStoreId))906 return false;907 893 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 908 const Vector<char> startKey = KeyPrefix(databaseId, objectStoreId ).encode();909 const Vector<char> stopKey = KeyPrefix(databaseId, objectStoreId + 1 ).encode();894 const Vector<char> startKey = KeyPrefix(databaseId, objectStoreId, 0).encode(); 895 const Vector<char> stopKey = KeyPrefix(databaseId, objectStoreId + 1, 0).encode(); 910 896 911 897 deleteRange(levelDBTransaction, startKey, stopKey); 912 return true; 913 } 914 915 bool IDBBackingStore::deleteRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier& recordIdentifier) 898 } 899 900 void IDBBackingStore::deleteRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier& recordIdentifier) 916 901 { 917 902 IDB_TRACE("IDBBackingStore::deleteRecord"); 918 if (!KeyPrefix::validIds(databaseId, objectStoreId))919 return false;920 903 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 921 904 … … 925 908 const Vector<char> existsEntryKey = ExistsEntryKey::encode(databaseId, objectStoreId, recordIdentifier.primaryKey()); 926 909 levelDBTransaction->remove(existsEntryKey); 927 return true;928 910 } 929 911 … … 931 913 bool IDBBackingStore::getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t& keyGeneratorCurrentNumber) 932 914 { 933 if (!KeyPrefix::validIds(databaseId, objectStoreId))934 return false;935 915 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 936 916 … … 981 961 bool IDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) 982 962 { 983 if (!KeyPrefix::validIds(databaseId, objectStoreId))984 return false;985 963 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 986 964 … … 1002 980 { 1003 981 IDB_TRACE("IDBBackingStore::keyExistsInObjectStore"); 1004 if (!KeyPrefix::validIds(databaseId, objectStoreId))1005 return false;1006 982 found = false; 1007 983 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); … … 1042 1018 1043 1019 // FIXME: This should do some error handling rather than plowing ahead when bad data is encountered. 1044 boolIDBBackingStore::getIndexes(int64_t databaseId, int64_t objectStoreId, IDBObjectStoreMetadata::IndexMap* indexes)1020 void IDBBackingStore::getIndexes(int64_t databaseId, int64_t objectStoreId, IDBObjectStoreMetadata::IndexMap* indexes) 1045 1021 { 1046 1022 IDB_TRACE("IDBBackingStore::getIndexes"); 1047 if (!KeyPrefix::validIds(databaseId, objectStoreId))1048 return false;1049 1023 const Vector<char> startKey = IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0); 1050 1024 const Vector<char> stopKey = IndexMetaDataKey::encode(databaseId, objectStoreId + 1, 0, 0); … … 1095 1069 indexes->set(indexId, IDBIndexMetadata(indexName, indexId, keyPath, indexUnique, indexMultiEntry)); 1096 1070 } 1097 return true;1098 1071 } 1099 1072 … … 1123 1096 { 1124 1097 IDB_TRACE("IDBBackingStore::createIndex"); 1125 if (!KeyPrefix::validIds(databaseId, objectStoreId, indexId))1126 return false;1127 1098 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 1128 1099 if (!setMaxIndexId(levelDBTransaction, databaseId, objectStoreId, indexId)) … … 1141 1112 } 1142 1113 1143 boolIDBBackingStore::deleteIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId)1114 void IDBBackingStore::deleteIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId) 1144 1115 { 1145 1116 IDB_TRACE("IDBBackingStore::deleteIndex"); 1146 if (!KeyPrefix::validIds(databaseId, objectStoreId, indexId))1147 return false;1148 1117 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); 1149 1118 … … 1155 1124 const Vector<char> indexDataEnd = IndexDataKey::encodeMaxKey(databaseId, objectStoreId, indexId); 1156 1125 deleteRange(levelDBTransaction, indexDataStart, indexDataEnd); 1157 return true; 1158 } 1159 1160 bool IDBBackingStore::putIndexDataForRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const RecordIdentifier& recordIdentifier) 1126 } 1127 1128 void IDBBackingStore::putIndexDataForRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const RecordIdentifier& recordIdentifier) 1161 1129 { 1162 1130 IDB_TRACE("IDBBackingStore::putIndexDataForRecord"); 1163 1131 ASSERT(key.isValid()); 1164 if (!KeyPrefix::validIds(databaseId, objectStoreId, indexId)) 1165 return false; 1132 ASSERT(indexId >= MinimumIndexId); 1166 1133 1167 1134 LevelDBTransaction* levelDBTransaction = IDBBackingStore::Transaction::levelDBTransactionFrom(transaction); … … 1173 1140 1174 1141 levelDBTransaction->put(indexDataKey, data); 1175 return true;1176 1142 } 1177 1143 … … 1224 1190 { 1225 1191 IDB_TRACE("IDBBackingStore::findKeyInIndex"); 1226 ASSERT(KeyPrefix::validIds(databaseId, objectStoreId, indexId));1227 1228 1192 ASSERT(foundEncodedPrimaryKey.isEmpty()); 1229 1193 found = false; … … 1266 1230 { 1267 1231 IDB_TRACE("IDBBackingStore::getPrimaryKeyViaIndex"); 1268 if (!KeyPrefix::validIds(databaseId, objectStoreId, indexId))1269 return false;1270 1232 1271 1233 bool found = false; … … 1287 1249 { 1288 1250 IDB_TRACE("IDBBackingStore::keyExistsInIndex"); 1289 if (!KeyPrefix::validIds(databaseId, objectStoreId, indexId))1290 return false;1291 1251 1292 1252 exists = false; … … 1803 1763 { 1804 1764 ASSERT(transaction); 1805 if (!KeyPrefix::validIds(databaseId, objectStoreId, indexId))1806 return false;1807 1808 1765 bool lowerBound = range && range->lower(); 1809 1766 bool upperBound = range && range->upper(); -
trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
r145435 r145441 69 69 virtual bool deleteDatabase(const String& name); 70 70 71 bool getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap*) WARN_UNUSED_RETURN;71 void getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap*); 72 72 virtual bool createObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement); 73 73 virtual bool deleteObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId) WARN_UNUSED_RETURN; … … 90 90 virtual bool getRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, Vector<char>& record) WARN_UNUSED_RETURN; 91 91 virtual bool putRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, PassRefPtr<SharedBuffer> value, RecordIdentifier*) WARN_UNUSED_RETURN; 92 virtual bool clearObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId) WARN_UNUSED_RETURN;93 virtual bool deleteRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier&) WARN_UNUSED_RETURN;92 virtual void clearObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId); 93 virtual void deleteRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier&); 94 94 virtual bool getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t& currentNumber) WARN_UNUSED_RETURN; 95 95 virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent) WARN_UNUSED_RETURN; 96 96 virtual bool keyExistsInObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier, bool& found) WARN_UNUSED_RETURN; 97 97 98 virtual bool createIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) WARN_UNUSED_RETURN;99 virtual bool deleteIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) WARN_UNUSED_RETURN;100 virtual bool putIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier&) WARN_UNUSED_RETURN;98 virtual bool createIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry); 99 virtual void deleteIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId); 100 virtual void putIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier&); 101 101 virtual bool getPrimaryKeyViaIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& primaryKey) WARN_UNUSED_RETURN; 102 102 virtual bool keyExistsInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey, bool& exists) WARN_UNUSED_RETURN; … … 179 179 private: 180 180 bool findKeyInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, Vector<char>& foundEncodedPrimaryKey, bool& found); 181 bool getIndexes(int64_t databaseId, int64_t objectStoreId, IDBObjectStoreMetadata::IndexMap*) WARN_UNUSED_RETURN;181 void getIndexes(int64_t databaseId, int64_t objectStoreId, IDBObjectStoreMetadata::IndexMap*); 182 182 183 183 String m_identifier; -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
r145435 r145441 180 180 class DeleteIndexOperation : public IDBTransactionBackendImpl::Operation { 181 181 public: 182 static PassOwnPtr<IDBTransactionBackendImpl::Operation> create(PassRefPtr<IDBBackingStore> backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)183 { 184 return adoptPtr(new DeleteIndexOperation(backingStore, objectStoreId, index Metadata));185 } 186 virtual void perform(IDBTransactionBackendImpl*); 187 private: 188 DeleteIndexOperation(PassRefPtr<IDBBackingStore> backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)182 static PassOwnPtr<IDBTransactionBackendImpl::Operation> create(PassRefPtr<IDBBackingStore> backingStore, int64_t objectStoreId, int64_t indexId) 183 { 184 return adoptPtr(new DeleteIndexOperation(backingStore, objectStoreId, indexId)); 185 } 186 virtual void perform(IDBTransactionBackendImpl*); 187 private: 188 DeleteIndexOperation(PassRefPtr<IDBBackingStore> backingStore, int64_t objectStoreId, int64_t indexId) 189 189 : m_backingStore(backingStore) 190 190 , m_objectStoreId(objectStoreId) 191 , m_index Metadata(indexMetadata)191 , m_indexId(indexId) 192 192 { 193 193 } … … 195 195 const RefPtr<IDBBackingStore> m_backingStore; 196 196 const int64_t m_objectStoreId; 197 const IDBIndexMetadata m_indexMetadata;197 const int64_t m_indexId; 198 198 }; 199 199 … … 535 535 if (!ok) 536 536 return false; 537 if (success) 538 return m_backingStore->getObjectStores(m_metadata.id, &m_metadata.objectStores); 539 537 if (success) { 538 m_backingStore->getObjectStores(m_metadata.id, &m_metadata.objectStores); 539 return true; 540 } 540 541 return m_backingStore->createIDBDatabaseMetaData(m_metadata.name, m_metadata.version, m_metadata.intVersion, m_metadata.id); 541 542 } … … 640 641 const IDBIndexMetadata& indexMetadata = objectStore.indexes.get(indexId); 641 642 642 transaction->scheduleTask(DeleteIndexOperation::create(m_backingStore, objectStoreId, index Metadata), DeleteIndexAbortOperation::create(this, objectStoreId, indexMetadata));643 transaction->scheduleTask(DeleteIndexOperation::create(m_backingStore, objectStoreId, indexId), DeleteIndexAbortOperation::create(this, objectStoreId, indexMetadata)); 643 644 644 645 removeIndex(objectStoreId, indexId); … … 648 649 { 649 650 IDB_TRACE("DeleteIndexOperation"); 650 bool ok = m_backingStore->deleteIndex(transaction->backingStoreTransaction(), transaction->database()->id(), m_objectStoreId, m_indexMetadata.id); 651 if (!ok) { 652 RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UnknownError, String::format("Internal error deleting index '%s'.", m_indexMetadata.name.utf8().data())); 653 transaction->abort(error); 654 } 651 m_backingStore->deleteIndex(transaction->backingStoreTransaction(), transaction->database()->id(), m_objectStoreId, m_indexId); 655 652 } 656 653 … … 1027 1024 if (backingStoreCursor) { 1028 1025 do { 1029 if (!m_backingStore->deleteRecord(transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, backingStoreCursor->recordIdentifier())) { 1030 m_callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Error deleting data in range")); 1031 return; 1032 } 1026 m_backingStore->deleteRecord(transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, backingStoreCursor->recordIdentifier()); 1033 1027 } while (backingStoreCursor->continueFunction(0)); 1034 1028 } … … 1051 1045 { 1052 1046 IDB_TRACE("ObjectStoreClearOperation"); 1053 if (!m_backingStore->clearObjectStore(transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId)) { 1054 m_callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Error clearing object store")); 1055 return; 1056 } 1047 m_backingStore->clearObjectStore(transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId); 1057 1048 m_callbacks->onSuccess(); 1058 1049 } -
trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp
r145435 r145441 974 974 } 975 975 976 KeyPrefix::KeyPrefix(int64_t databaseId)977 : m_databaseId(databaseId)978 , m_objectStoreId(0)979 , m_indexId(0)980 {981 ASSERT(KeyPrefix::isValidDatabaseId(databaseId));982 }983 984 KeyPrefix::KeyPrefix(int64_t databaseId, int64_t objectStoreId)985 : m_databaseId(databaseId)986 , m_objectStoreId(objectStoreId)987 , m_indexId(0)988 {989 ASSERT(KeyPrefix::isValidDatabaseId(databaseId));990 ASSERT(KeyPrefix::isValidObjectStoreId(objectStoreId));991 }992 993 976 KeyPrefix::KeyPrefix(int64_t databaseId, int64_t objectStoreId, int64_t indexId) 994 977 : m_databaseId(databaseId) … … 996 979 , m_indexId(indexId) 997 980 { 998 ASSERT(KeyPrefix::isValidDatabaseId(databaseId));999 ASSERT(KeyPrefix::isValidObjectStoreId(objectStoreId));1000 ASSERT(KeyPrefix::isValidIndexId(indexId));1001 }1002 1003 KeyPrefix::KeyPrefix(Type type, int64_t databaseId, int64_t objectStoreId, int64_t indexId)1004 : m_databaseId(databaseId)1005 , m_objectStoreId(objectStoreId)1006 , m_indexId(indexId)1007 {1008 ASSERT(type == InvalidType);1009 ASSERT(KeyPrefix::isValidDatabaseId(databaseId));1010 ASSERT(KeyPrefix::isValidObjectStoreId(objectStoreId));1011 }1012 1013 1014 KeyPrefix KeyPrefix::createWithSpecialIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId)1015 {1016 ASSERT(KeyPrefix::isValidDatabaseId(databaseId));1017 ASSERT(KeyPrefix::isValidObjectStoreId(objectStoreId));1018 ASSERT(indexId);1019 return KeyPrefix(InvalidType, databaseId, objectStoreId, indexId);1020 }1021 1022 1023 bool KeyPrefix::isValidDatabaseId(int64_t databaseId)1024 {1025 return (databaseId > 0) && (databaseId < KeyPrefix::kMaxDatabaseId);1026 }1027 1028 bool KeyPrefix::isValidObjectStoreId(int64_t objectStoreId)1029 {1030 return (objectStoreId > 0) && (objectStoreId < KeyPrefix::kMaxObjectStoreId);1031 }1032 1033 bool KeyPrefix::isValidIndexId(int64_t indexId)1034 {1035 return (indexId >= MinimumIndexId) && (indexId < KeyPrefix::kMaxIndexId);1036 981 } 1037 982 … … 1060 1005 } 1061 1006 1062 Vector<char> KeyPrefix::encodeEmpty()1063 {1064 const Vector<char, 4> result(4, 0);1065 ASSERT(encodeInternal(0, 0, 0) == Vector<char>(4, 0));1066 return result;1067 }1068 1069 1007 Vector<char> KeyPrefix::encode() const 1070 1008 { … … 1072 1010 ASSERT(m_objectStoreId != InvalidId); 1073 1011 ASSERT(m_indexId != InvalidId); 1074 return encodeInternal(m_databaseId, m_objectStoreId, m_indexId); 1075 } 1076 1077 Vector<char> KeyPrefix::encodeInternal(int64_t databaseId, int64_t objectStoreId, int64_t indexId) 1078 { 1079 Vector<char> databaseIdString = encodeIntSafely(databaseId, kMaxDatabaseId); 1080 Vector<char> objectStoreIdString = encodeIntSafely(objectStoreId, kMaxObjectStoreId); 1081 Vector<char> indexIdString = encodeIntSafely(indexId, kMaxIndexId); 1082 1083 ASSERT(databaseIdString.size() <= kMaxDatabaseIdSizeBytes); 1084 ASSERT(objectStoreIdString.size() <= kMaxObjectStoreIdSizeBytes); 1085 ASSERT(indexIdString.size() <= kMaxIndexIdSizeBytes); 1086 1087 unsigned char firstByte = (databaseIdString.size() - 1) << (kMaxObjectStoreIdSizeBits + kMaxIndexIdSizeBits) | (objectStoreIdString.size() - 1) << kMaxIndexIdSizeBits | (indexIdString.size() - 1); 1088 COMPILE_ASSERT(kMaxDatabaseIdSizeBits + kMaxObjectStoreIdSizeBits + kMaxIndexIdSizeBits == sizeof(firstByte) * 8, CANT_ENCODE_IDS); 1012 1013 Vector<char> databaseIdString = encodeInt(m_databaseId); 1014 Vector<char> objectStoreIdString = encodeInt(m_objectStoreId); 1015 Vector<char> indexIdString = encodeInt(m_indexId); 1016 1017 ASSERT(databaseIdString.size() <= 8); 1018 ASSERT(objectStoreIdString.size() <= 8); 1019 ASSERT(indexIdString.size() <= 4); 1020 1021 1022 unsigned char firstByte = (databaseIdString.size() - 1) << 5 | (objectStoreIdString.size() - 1) << 2 | (indexIdString.size() - 1); 1089 1023 Vector<char, DefaultInlineBufferSize> ret; 1090 1024 ret.append(firstByte); … … 1135 1069 Vector<char> SchemaVersionKey::encode() 1136 1070 { 1137 Vector<char> ret = KeyPrefix::encodeEmpty(); 1071 KeyPrefix prefix(0, 0, 0); 1072 Vector<char> ret = prefix.encode(); 1138 1073 ret.append(encodeByte(SchemaVersionTypeByte)); 1139 1074 return ret; … … 1142 1077 Vector<char> MaxDatabaseIdKey::encode() 1143 1078 { 1144 Vector<char> ret = KeyPrefix::encodeEmpty(); 1079 KeyPrefix prefix(0, 0, 0); 1080 Vector<char> ret = prefix.encode(); 1145 1081 ret.append(encodeByte(MaxDatabaseIdTypeByte)); 1146 1082 return ret; … … 1149 1085 Vector<char> DataVersionKey::encode() 1150 1086 { 1151 Vector<char> ret = KeyPrefix::encodeEmpty(); 1087 KeyPrefix prefix(0, 0, 0); 1088 Vector<char> ret = prefix.encode(); 1152 1089 ret.append(encodeByte(DataVersionTypeByte)); 1153 1090 return ret; … … 1180 1117 Vector<char> DatabaseFreeListKey::encode(int64_t databaseId) 1181 1118 { 1182 Vector<char> ret = KeyPrefix::encodeEmpty(); 1119 KeyPrefix prefix(0, 0, 0); 1120 Vector<char> ret = prefix.encode(); 1183 1121 ret.append(encodeByte(DatabaseFreeListTypeByte)); 1184 1122 ret.append(encodeVarInt(databaseId)); … … 1227 1165 Vector<char> DatabaseNameKey::encode(const String& origin, const String& databaseName) 1228 1166 { 1229 Vector<char> ret = KeyPrefix::encodeEmpty(); 1167 KeyPrefix prefix(0, 0, 0); 1168 Vector<char> ret = prefix.encode(); 1230 1169 ret.append(encodeByte(DatabaseNameTypeByte)); 1231 1170 ret.append(encodeStringWithLength(origin)); … … 1254 1193 Vector<char> DatabaseMetaDataKey::encode(int64_t databaseId, MetaDataType metaDataType) 1255 1194 { 1256 KeyPrefix prefix(databaseId );1195 KeyPrefix prefix(databaseId, 0, 0); 1257 1196 Vector<char> ret = prefix.encode(); 1258 1197 ret.append(encodeByte(metaDataType)); … … 1293 1232 Vector<char> ObjectStoreMetaDataKey::encode(int64_t databaseId, int64_t objectStoreId, unsigned char metaDataType) 1294 1233 { 1295 KeyPrefix prefix(databaseId );1234 KeyPrefix prefix(databaseId, 0, 0); 1296 1235 Vector<char> ret = prefix.encode(); 1297 1236 ret.append(encodeByte(ObjectStoreMetaDataTypeByte)); … … 1368 1307 Vector<char> IndexMetaDataKey::encode(int64_t databaseId, int64_t objectStoreId, int64_t indexId, unsigned char metaDataType) 1369 1308 { 1370 KeyPrefix prefix(databaseId );1309 KeyPrefix prefix(databaseId, 0, 0); 1371 1310 Vector<char> ret = prefix.encode(); 1372 1311 ret.append(encodeByte(IndexMetaDataTypeByte)); … … 1431 1370 Vector<char> ObjectStoreFreeListKey::encode(int64_t databaseId, int64_t objectStoreId) 1432 1371 { 1433 KeyPrefix prefix(databaseId );1372 KeyPrefix prefix(databaseId, 0, 0); 1434 1373 Vector<char> ret = prefix.encode(); 1435 1374 ret.append(encodeByte(ObjectStoreFreeListTypeByte)); … … 1488 1427 Vector<char> IndexFreeListKey::encode(int64_t databaseId, int64_t objectStoreId, int64_t indexId) 1489 1428 { 1490 KeyPrefix prefix(databaseId );1429 KeyPrefix prefix(databaseId, 0, 0); 1491 1430 Vector<char> ret = prefix.encode(); 1492 1431 ret.append(encodeByte(IndexFreeListTypeByte)); … … 1544 1483 Vector<char> ObjectStoreNamesKey::encode(int64_t databaseId, const String& objectStoreName) 1545 1484 { 1546 KeyPrefix prefix(databaseId );1485 KeyPrefix prefix(databaseId, 0, 0); 1547 1486 Vector<char> ret = prefix.encode(); 1548 1487 ret.append(encodeByte(ObjectStoreNamesTypeByte)); … … 1587 1526 Vector<char> IndexNamesKey::encode(int64_t databaseId, int64_t objectStoreId, const String& indexName) 1588 1527 { 1589 KeyPrefix prefix(databaseId );1528 KeyPrefix prefix(databaseId, 0, 0); 1590 1529 Vector<char> ret = prefix.encode(); 1591 1530 ret.append(encodeByte(IndexNamesKeyTypeByte)); … … 1619 1558 Vector<char> ObjectStoreDataKey::encode(int64_t databaseId, int64_t objectStoreId, const Vector<char> encodedUserKey) 1620 1559 { 1621 KeyPrefix prefix( KeyPrefix::createWithSpecialIndex(databaseId, objectStoreId, SpecialIndexNumber));1560 KeyPrefix prefix(databaseId, objectStoreId, SpecialIndexNumber); 1622 1561 Vector<char> ret = prefix.encode(); 1623 1562 ret.append(encodedUserKey); … … 1661 1600 Vector<char> ExistsEntryKey::encode(int64_t databaseId, int64_t objectStoreId, const Vector<char>& encodedKey) 1662 1601 { 1663 KeyPrefix prefix( KeyPrefix::createWithSpecialIndex(databaseId, objectStoreId, SpecialIndexNumber));1602 KeyPrefix prefix(databaseId, objectStoreId, SpecialIndexNumber); 1664 1603 Vector<char> ret = prefix.encode(); 1665 1604 ret.append(encodedKey); -
trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.h
r145435 r145441 55 55 bool decodeBool(const char* begin, const char* end); 56 56 Vector<char> encodeInt(int64_t); 57 inline Vector<char> encodeIntSafely(int64_t nParam, size_t max)58 {59 ASSERT(static_cast<size_t>(nParam) <= max);60 return encodeInt(nParam);61 }62 57 int64_t decodeInt(const char* begin, const char* end); 63 58 Vector<char> encodeVarInt(int64_t); … … 83 78 public: 84 79 KeyPrefix(); 85 explicit KeyPrefix(int64_t databaseId);86 KeyPrefix(int64_t databaseId, int64_t objectStoreId);87 80 KeyPrefix(int64_t databaseId, int64_t objectStoreId, int64_t indexId); 88 static KeyPrefix createWithSpecialIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId);89 81 90 82 static const char* decode(const char* start, const char* limit, KeyPrefix* result); 91 83 Vector<char> encode() const; 92 static Vector<char> encodeEmpty();93 84 int compare(const KeyPrefix& other) const; 94 85 … … 102 93 }; 103 94 104 static const size_t kMaxDatabaseIdSizeBits = 3;105 static const size_t kMaxObjectStoreIdSizeBits = 3;106 static const size_t kMaxIndexIdSizeBits = 2;107 108 static const size_t kMaxDatabaseIdSizeBytes = 1ULL << kMaxDatabaseIdSizeBits; // 8109 static const size_t kMaxObjectStoreIdSizeBytes = 1ULL << kMaxObjectStoreIdSizeBits; // 8110 static const size_t kMaxIndexIdSizeBytes = 1ULL << kMaxIndexIdSizeBits; // 4111 112 static const size_t kMaxDatabaseIdBits = kMaxDatabaseIdSizeBytes * 8 - 1; // 63113 static const size_t kMaxObjectStoreIdBits = kMaxObjectStoreIdSizeBytes * 8 - 1; // 63114 static const size_t kMaxIndexIdBits = kMaxIndexIdSizeBytes * 8 - 1; // 31115 116 static const int64_t kMaxDatabaseId = (1ULL << kMaxDatabaseIdBits) - 1; // max signed int64_t117 static const int64_t kMaxObjectStoreId = (1ULL << kMaxObjectStoreIdBits) - 1; // max signed int64_t118 static const int64_t kMaxIndexId = (1ULL << kMaxIndexIdBits) - 1; // max signed int32_t119 120 static bool isValidDatabaseId(int64_t databaseId);121 static bool isValidObjectStoreId(int64_t indexId);122 static bool isValidIndexId(int64_t indexId);123 static bool validIds(int64_t databaseId, int64_t objectStoreId, int64_t indexId)124 {125 return isValidDatabaseId(databaseId) && isValidObjectStoreId(objectStoreId) && isValidIndexId(indexId);126 }127 static bool validIds(int64_t databaseId, int64_t objectStoreId)128 {129 return isValidDatabaseId(databaseId) && isValidObjectStoreId(objectStoreId);130 }131 132 95 Type type() const; 133 96 … … 137 100 138 101 static const int64_t InvalidId = -1; 139 140 private:141 static Vector<char> encodeInternal(int64_t databaseId, int64_t objectStoreId, int64_t indexId);142 // Special constructor for createWithSpecialIndex()143 KeyPrefix(Type, int64_t databaseId, int64_t objectStoreId, int64_t indexId);144 102 }; 145 103 -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
r145435 r145441 65 65 int64_t indexId = m_indexMetadata.id; 66 66 for (size_t i = 0; i < m_indexKeys.size(); ++i) { 67 bool ok = backingStore.putIndexDataForRecord(transaction, databaseId, objectStoreId, indexId, *(m_indexKeys)[i].get(), recordIdentifier); 68 // This should have already been verified as a valid write during verifyIndexKeys. 69 ASSERT_UNUSED(ok, ok); 67 backingStore.putIndexDataForRecord(transaction, databaseId, objectStoreId, indexId, *(m_indexKeys)[i].get(), recordIdentifier); 70 68 } 71 69 } -
trunk/Source/WebKit/chromium/ChangeLog
r145435 r145441 1 2013-03-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r145435. 4 http://trac.webkit.org/changeset/145435 5 https://bugs.webkit.org/show_bug.cgi?id=112082 6 7 Still does not compile (Requested by jamesr on #webkit). 8 9 * tests/IDBBackingStoreTest.cpp: 10 (WebCore::IDBBackingStoreTest::SetUp): 11 (IDBBackingStoreTest): 12 (WebCore::TEST_F): 13 * tests/IDBFakeBackingStore.h: 14 * tests/IDBLevelDBCodingTest.cpp: 15 (IDBLevelDBCoding): 16 (IDBLevelDBCoding::TEST): 17 1 18 2013-03-11 Alec Flett <alecflett@chromium.org> 2 19 -
trunk/Source/WebKit/chromium/tests/IDBBackingStoreTest.cpp
r145435 r145441 29 29 30 30 #include "IDBFactoryBackendImpl.h" 31 #include "IDBLevelDBCoding.h"32 31 #include "SharedBuffer.h" 33 32 … … 38 37 39 38 using namespace WebCore; 40 using IDBLevelDBCoding::KeyPrefix;41 39 42 40 namespace { … … 56 54 const char rawValue1[] = "value1"; 57 55 const char rawValue2[] = "value2"; 58 const char rawValue3[] = "value3";59 56 m_value1.append(rawValue1, sizeof(rawValue1)); 60 57 m_value2.append(rawValue2, sizeof(rawValue2)); 61 m_value3.append(rawValue3, sizeof(rawValue3));62 58 m_key1 = IDBKey::createNumber(99); 63 59 m_key2 = IDBKey::createString("key2"); 64 m_key3 = IDBKey::createString("key3");65 60 } 66 61 … … 71 66 RefPtr<IDBKey> m_key1; 72 67 RefPtr<IDBKey> m_key2; 73 RefPtr<IDBKey> m_key3;74 68 Vector<char> m_value1; 75 69 Vector<char> m_value2; 76 Vector<char> m_value3;77 70 }; 78 71 … … 104 97 const int64_t highDatabaseId = 1ULL << 35; 105 98 const int64_t highObjectStoreId = 1ULL << 39; 106 // indexIds are capped at 32 bits for storage purposes.107 const int64_t highIndexId = 1ULL << 29;108 109 const int64_t invalidHighIndexId = 1ULL << 37;110 111 const RefPtr<IDBKey> indexKey = m_key2;112 Vector<char> indexKeyRaw = IDBLevelDBCoding::encodeIDBKey(*indexKey);113 99 { 114 100 IDBBackingStore::Transaction transaction1(m_backingStore.get()); … … 117 103 bool ok = m_backingStore->putRecord(&transaction1, highDatabaseId, highObjectStoreId, *m_key1.get(), SharedBuffer::create(m_value1.data(), m_value1.size()), &record); 118 104 EXPECT_TRUE(ok); 119 120 ok = m_backingStore->putIndexDataForRecord(&transaction1, highDatabaseId, highObjectStoreId, invalidHighIndexId, *indexKey, record);121 EXPECT_FALSE(ok);122 123 ok = m_backingStore->putIndexDataForRecord(&transaction1, highDatabaseId, highObjectStoreId, highIndexId, *indexKey, record);124 EXPECT_TRUE(ok);125 126 105 ok = transaction1.commit(); 127 106 EXPECT_TRUE(ok); … … 134 113 bool ok = m_backingStore->getRecord(&transaction2, highDatabaseId, highObjectStoreId, *m_key1.get(), resultValue); 135 114 EXPECT_TRUE(ok); 115 ok = transaction2.commit(); 116 EXPECT_TRUE(ok); 136 117 EXPECT_EQ(m_value1, resultValue); 137 138 RefPtr<IDBKey> newPrimaryKey; 139 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction2, highDatabaseId, highObjectStoreId, invalidHighIndexId, *indexKey, newPrimaryKey); 140 EXPECT_FALSE(ok); 141 142 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction2, highDatabaseId, highObjectStoreId, highIndexId, *indexKey, newPrimaryKey); 143 EXPECT_TRUE(ok); 144 EXPECT_TRUE(newPrimaryKey->isEqual(m_key1.get())); 145 146 ok = transaction2.commit(); 147 EXPECT_TRUE(ok); 148 } 149 } 150 151 // Make sure that other invalid ids do not crash. 152 TEST_F(IDBBackingStoreTest, InvalidIds) 153 { 154 // valid ids for use when testing invalid ids 155 const int64_t databaseId = 1; 156 const int64_t objectStoreId = 1; 157 const int64_t indexId = IDBLevelDBCoding::MinimumIndexId; 158 const int64_t invalidLowIndexId = 19; // indexIds must be > IDBLevelDBCoding::MinimumIndexId 159 160 const RefPtr<SharedBuffer> value = SharedBuffer::create(m_value1.data(), m_value1.size()); 161 Vector<char> resultValue; 162 163 IDBBackingStore::Transaction transaction1(m_backingStore.get()); 164 transaction1.begin(); 165 166 IDBBackingStore::RecordIdentifier record; 167 bool ok = m_backingStore->putRecord(&transaction1, databaseId, KeyPrefix::InvalidId, *m_key1.get(), value, &record); 168 EXPECT_FALSE(ok); 169 ok = m_backingStore->putRecord(&transaction1, databaseId, 0, *m_key1.get(), value, &record); 170 EXPECT_FALSE(ok); 171 ok = m_backingStore->putRecord(&transaction1, KeyPrefix::InvalidId, objectStoreId, *m_key1.get(), value, &record); 172 EXPECT_FALSE(ok); 173 ok = m_backingStore->putRecord(&transaction1, 0, objectStoreId, *m_key1.get(), value, &record); 174 EXPECT_FALSE(ok); 175 176 ok = m_backingStore->getRecord(&transaction1, databaseId, KeyPrefix::InvalidId, *m_key1.get(), resultValue); 177 EXPECT_FALSE(ok); 178 ok = m_backingStore->getRecord(&transaction1, databaseId, 0, *m_key1.get(), resultValue); 179 EXPECT_FALSE(ok); 180 ok = m_backingStore->getRecord(&transaction1, KeyPrefix::InvalidId, objectStoreId, *m_key1.get(), resultValue); 181 EXPECT_FALSE(ok); 182 ok = m_backingStore->getRecord(&transaction1, 0, objectStoreId, *m_key1.get(), resultValue); 183 EXPECT_FALSE(ok); 184 185 RefPtr<IDBKey> newPrimaryKey; 186 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction1, databaseId, objectStoreId, KeyPrefix::InvalidId, *m_key1, newPrimaryKey); 187 EXPECT_FALSE(ok); 188 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction1, databaseId, objectStoreId, invalidLowIndexId, *m_key1, newPrimaryKey); 189 EXPECT_FALSE(ok); 190 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction1, databaseId, objectStoreId, 0, *m_key1, newPrimaryKey); 191 EXPECT_FALSE(ok); 192 193 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction1, KeyPrefix::InvalidId, objectStoreId, indexId, *m_key1, newPrimaryKey); 194 EXPECT_FALSE(ok); 195 ok = m_backingStore->getPrimaryKeyViaIndex(&transaction1, databaseId, KeyPrefix::InvalidId, indexId, *m_key1, newPrimaryKey); 196 EXPECT_FALSE(ok); 118 } 197 119 } 198 120 … … 245 167 EXPECT_EQ(databaseId, database.id); 246 168 247 ok = m_backingStore->getObjectStores(database.id, &database.objectStores); 248 EXPECT_TRUE(ok); 169 m_backingStore->getObjectStores(database.id, &database.objectStores); 249 170 250 171 EXPECT_EQ(1, database.objectStores.size()); -
trunk/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
r145435 r145441 42 42 virtual bool createObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE { return false; }; 43 43 44 virtual bool clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { return false;}45 virtual bool deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier&) OVERRIDE { return false;}44 virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { } 45 virtual void deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier&) OVERRIDE { } 46 46 virtual bool getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t& currentNumber) OVERRIDE { return true; } 47 47 virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return true; } … … 49 49 50 50 virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) OVERRIDE { return false; }; 51 virtual bool deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { return false;}52 virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier&) OVERRIDE { return false;}51 virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { } 52 virtual void putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier&) OVERRIDE { } 53 53 54 54 virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection) OVERRIDE { return PassRefPtr<Cursor>(); } -
trunk/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp
r145435 r145441 102 102 } 103 103 } 104 104 105 105 TEST(IDBLevelDBCodingTest, EncodeBool) 106 106 { … … 712 712 keys.append(IndexDataKey::encode(1, 1, 31, minIDBKey(), minIDBKey(), 0)); 713 713 keys.append(IndexDataKey::encode(1, 2, 30, minIDBKey(), minIDBKey(), 0)); 714 keys.append(IndexDataKey::encodeMaxKey(1, 2, INT32_MAX - 1));714 keys.append(IndexDataKey::encodeMaxKey(1, 2, INT32_MAX)); 715 715 716 716 for (size_t i = 0; i < keys.size(); ++i) {
Note: See TracChangeset
for help on using the changeset viewer.