WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-101488-20121107104907.patch (text/plain), 33.42 KB, created by
Alec Flett
on 2012-11-07 10:50:56 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alec Flett
Created:
2012-11-07 10:50:56 PST
Size:
33.42 KB
patch
obsolete
>Subversion Revision: 133650 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9cd715ea3acb5e965f47eded698ab8575b8f4355..a4a53eb6c947c7b10f25e6a9cb1ddc93cff86935 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,48 @@ > 2012-11-07 Alec Flett <alecflett@chromium.org> > >+ IndexedDB: Rename methods and remove dead code from IDBBackingStore >+ https://bugs.webkit.org/show_bug.cgi?id=101488 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In preparation for merging IDBBackingStore and IDBLevelDBBackingStore: >+ >+ 1) rename ObjectStoreRecordIdentifier to RecordIdentifier >+ 2) remove IDBBackingStore::forEachRecord and friends >+ 3) remove IDBBackingStore::Cursor::close, since it was an empty method. >+ >+ No new tests as this is purely code cleanup. >+ >+ * Modules/indexeddb/IDBBackingStore.cpp: >+ (WebCore::IDBLevelDBBackingStore::getRecord): >+ (WebCore): >+ (WebCore::IDBLevelDBBackingStore::putRecord): >+ (WebCore::IDBLevelDBBackingStore::createInvalidRecordIdentifier): >+ (WebCore::IDBLevelDBBackingStore::deleteRecord): >+ (WebCore::IDBLevelDBBackingStore::keyExistsInObjectStore): >+ (WebCore::IDBLevelDBBackingStore::putIndexDataForRecord): >+ (WebCore::IDBLevelDBBackingStore::deleteIndexDataForRecord): >+ * Modules/indexeddb/IDBBackingStore.h: >+ (WebCore::IDBBackingStore::RecordIdentifier::~RecordIdentifier): >+ (IDBBackingStore): >+ * Modules/indexeddb/IDBCursorBackendImpl.cpp: >+ (WebCore::IDBCursorBackendImpl::close): >+ * Modules/indexeddb/IDBIndexBackendImpl.cpp: >+ (WebCore::IDBIndexBackendImpl::countInternal): >+ (WebCore::IDBIndexBackendImpl::getInternal): >+ (WebCore::IDBIndexBackendImpl::getKeyInternal): >+ * Modules/indexeddb/IDBLevelDBBackingStore.h: >+ (IDBLevelDBBackingStore): >+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: >+ (WebCore::IDBObjectStoreBackendImpl::getInternal): >+ (WebCore): >+ (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): >+ (WebCore::IDBObjectStoreBackendImpl::putInternal): >+ (WebCore::IDBObjectStoreBackendImpl::deleteInternal): >+ (WebCore::IDBObjectStoreBackendImpl::countInternal): >+ >+2012-11-07 Alec Flett <alecflett@chromium.org> >+ > IndexedDB: Prepare for IDBBackingStore merge by renaming IDBLevelDBBackingStore.cpp > https://bugs.webkit.org/show_bug.cgi?id=101486 > >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 2cbe66589043c2bc757f7005de5477ba4778fbc8..a8fad9218c36765b6154cea65d3e4e115e9fd1a0 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,14 @@ >+2012-11-07 Alec Flett <alecflett@chromium.org> >+ >+ IndexedDB: Rename methods and remove dead code from IDBBackingStore >+ https://bugs.webkit.org/show_bug.cgi?id=101488 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update IDBFakeBackingStore to reflect method changes in IDBBackingStore. >+ >+ * tests/IDBFakeBackingStore.h: >+ > 2012-11-06 Peter Beverloo <peter@chromium.org> > > [Chromium] Enable the JavaScript i18n API for Android >diff --git a/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp >index 6fd119939f1521383eef00ec5ecaf8ae7c2276b1..6b5a62a076e1faf5ce41832787a73a419edcbc44 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp >@@ -706,9 +706,9 @@ void IDBLevelDBBackingStore::deleteObjectStore(IDBBackingStore::Transaction* tra > clearObjectStore(transaction, databaseId, objectStoreId); > } > >-String IDBLevelDBBackingStore::getObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key) >+String IDBLevelDBBackingStore::getRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key) > { >- IDB_TRACE("IDBLevelDBBackingStore::getObjectStoreRecord"); >+ IDB_TRACE("IDBLevelDBBackingStore::getRecord"); > LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction); > > const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key); >@@ -729,7 +729,7 @@ String IDBLevelDBBackingStore::getObjectStoreRecord(IDBBackingStore::Transaction > } > > namespace { >-class LevelDBRecordIdentifier : public IDBBackingStore::ObjectStoreRecordIdentifier { >+class LevelDBRecordIdentifier : public IDBBackingStore::RecordIdentifier { > public: > static PassRefPtr<LevelDBRecordIdentifier> create(const Vector<char>& primaryKey, int64_t version) { return adoptRef(new LevelDBRecordIdentifier(primaryKey, version)); } > static PassRefPtr<LevelDBRecordIdentifier> create() { return adoptRef(new LevelDBRecordIdentifier()); } >@@ -768,9 +768,9 @@ static int64_t getNewVersionNumber(LevelDBTransaction* transaction, int64_t data > return version; > } > >-bool IDBLevelDBBackingStore::putObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, ObjectStoreRecordIdentifier* recordIdentifier) >+bool IDBLevelDBBackingStore::putRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, RecordIdentifier* recordIdentifier) > { >- IDB_TRACE("IDBLevelDBBackingStore::putObjectStoreRecord"); >+ IDB_TRACE("IDBLevelDBBackingStore::putRecord"); > ASSERT(key.isValid()); > LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction); > int64_t version = getNewVersionNumber(levelDBTransaction, databaseId, objectStoreId); >@@ -807,14 +807,14 @@ void IDBLevelDBBackingStore::clearObjectStore(IDBBackingStore::Transaction* tran > deleteRange(levelDBTransaction, startKey, stopKey); > } > >-PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> IDBLevelDBBackingStore::createInvalidRecordIdentifier() >+PassRefPtr<IDBBackingStore::RecordIdentifier> IDBLevelDBBackingStore::createInvalidRecordIdentifier() > { > return LevelDBRecordIdentifier::create(); > } > >-void IDBLevelDBBackingStore::deleteObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier* recordIdentifier) >+void IDBLevelDBBackingStore::deleteRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier* recordIdentifier) > { >- IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStoreRecord"); >+ IDB_TRACE("IDBLevelDBBackingStore::deleteRecord"); > LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction); > const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier); > >@@ -887,7 +887,7 @@ bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStor > return true; > } > >-bool IDBLevelDBBackingStore::keyExistsInObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, ObjectStoreRecordIdentifier* foundRecordIdentifier) >+bool IDBLevelDBBackingStore::keyExistsInObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, RecordIdentifier* foundRecordIdentifier) > { > IDB_TRACE("IDBLevelDBBackingStore::keyExistsInObjectStore"); > LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction); >@@ -907,39 +907,6 @@ bool IDBLevelDBBackingStore::keyExistsInObjectStore(IDBBackingStore::Transaction > return true; > } > >-bool IDBLevelDBBackingStore::forEachObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback& callback) >-{ >- LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction); >- const Vector<char> startKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, minIDBKey()); >- const Vector<char> stopKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, maxIDBKey()); >- >- OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator(); >- for (it->seek(startKey); it->isValid() && compareKeys(it->key(), stopKey) < 0; it->next()) { >- const char* p = it->key().begin(); >- const char* limit = it->key().end(); >- ObjectStoreDataKey dataKey; >- p = ObjectStoreDataKey::decode(p, limit, &dataKey); >- ASSERT(p); >- >- RefPtr<IDBKey> primaryKey = dataKey.userKey(); >- >- int64_t version; >- const char* q = decodeVarInt(it->value().begin(), it->value().end(), version); >- if (!q) { >- InternalError(IDBLevelDBBackingStoreReadError); >- return false; >- } >- >- RefPtr<LevelDBRecordIdentifier> ri = LevelDBRecordIdentifier::create(encodeIDBKey(*primaryKey), version); >- String idbValue = decodeString(q, it->value().end()); >- >- if (!callback.callback(ri.get(), idbValue)) >- return false; >- } >- >- return true; >-} >- > static bool checkIndexAndMetaDataKey(const LevelDBIterator* it, const Vector<char>& stopKey, int64_t indexId, unsigned char metaDataType) > { > if (!it->isValid() || compareKeys(it->key(), stopKey) >= 0) >@@ -1091,7 +1058,7 @@ void IDBLevelDBBackingStore::deleteIndex(IDBBackingStore::Transaction* transacti > } > } > >-bool IDBLevelDBBackingStore::putIndexDataForRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const ObjectStoreRecordIdentifier* recordIdentifier) >+bool IDBLevelDBBackingStore::putIndexDataForRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const RecordIdentifier* recordIdentifier) > { > IDB_TRACE("IDBLevelDBBackingStore::putIndexDataForRecord"); > ASSERT(key.isValid()); >@@ -1136,7 +1103,7 @@ static bool findGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction, cons > return true; > } > >-bool IDBLevelDBBackingStore::deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t, int64_t, int64_t, const ObjectStoreRecordIdentifier*) >+bool IDBLevelDBBackingStore::deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t, int64_t, int64_t, const RecordIdentifier*) > { > // FIXME: This isn't needed since we invalidate index data via the version number mechanism. > return true; >@@ -1233,8 +1200,7 @@ public: > virtual PassRefPtr<IDBKey> key() { return m_currentKey; } > virtual PassRefPtr<IDBKey> primaryKey() { return m_currentKey; } > virtual String value() = 0; >- virtual PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> objectStoreRecordIdentifier() = 0; >- virtual void close() { } >+ virtual PassRefPtr<IDBBackingStore::RecordIdentifier> objectStoreRecordIdentifier() = 0; > > virtual bool loadCurrentRow() = 0; > bool firstSeek(); >@@ -1425,7 +1391,7 @@ public: > > // CursorImplCommon > virtual String value() { ASSERT_NOT_REACHED(); return String(); } >- virtual PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> objectStoreRecordIdentifier() OVERRIDE >+ virtual PassRefPtr<IDBBackingStore::RecordIdentifier> objectStoreRecordIdentifier() OVERRIDE > { > return m_identifier; > } >@@ -1486,7 +1452,7 @@ public: > > // CursorImplCommon > virtual String value() { return m_currentValue; } >- virtual PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> objectStoreRecordIdentifier() OVERRIDE >+ virtual PassRefPtr<IDBBackingStore::RecordIdentifier> objectStoreRecordIdentifier() OVERRIDE > { > return m_identifier; > } >@@ -1552,7 +1518,7 @@ public: > // CursorImplCommon > virtual String value() { ASSERT_NOT_REACHED(); return String(); } > virtual PassRefPtr<IDBKey> primaryKey() { return m_primaryKey; } >- virtual PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> objectStoreRecordIdentifier() { ASSERT_NOT_REACHED(); return 0; } >+ virtual PassRefPtr<IDBBackingStore::RecordIdentifier> objectStoreRecordIdentifier() { ASSERT_NOT_REACHED(); return 0; } > virtual bool loadCurrentRow(); > > private: >@@ -1631,7 +1597,7 @@ public: > // CursorImplCommon > virtual String value() { return m_value; } > virtual PassRefPtr<IDBKey> primaryKey() { return m_primaryKey; } >- virtual PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> objectStoreRecordIdentifier() { ASSERT_NOT_REACHED(); return 0; } >+ virtual PassRefPtr<IDBBackingStore::RecordIdentifier> objectStoreRecordIdentifier() { ASSERT_NOT_REACHED(); return 0; } > bool loadCurrentRow(); > > private: >diff --git a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h >index bfc3876a34fd7b358cfd7db0c962e998843bbcb6..3c9451cc074c20e6f217c49487a3d8352f2702ad 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h >+++ b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h >@@ -61,33 +61,26 @@ public: > virtual bool createObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) = 0; > virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0; > >- class ObjectStoreRecordIdentifier : public RefCounted<ObjectStoreRecordIdentifier> { >+ class RecordIdentifier : public RefCounted<RecordIdentifier> { > public: > virtual bool isValid() const = 0; >- virtual ~ObjectStoreRecordIdentifier() {} >+ virtual ~RecordIdentifier() { } > }; >- virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() = 0; >+ virtual PassRefPtr<RecordIdentifier> createInvalidRecordIdentifier() = 0; > >- virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0; >- virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) = 0; >+ virtual String getRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0; >+ virtual bool putRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, RecordIdentifier*) = 0; > virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0; >- virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) = 0; >+ virtual void deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier*) = 0; > virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0; > virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) = 0; >- virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) = 0; >- >- class ObjectStoreRecordCallback { >- public: >- virtual bool callback(const ObjectStoreRecordIdentifier*, const String& value) = 0; >- virtual ~ObjectStoreRecordCallback() {}; >- }; >- virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0; >+ virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier) = 0; > > virtual Vector<IDBIndexMetadata> getIndexes(int64_t databaseId, int64_t objectStoreId) = 0; > virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) = 0; > virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0; >- virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) = 0; >- virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) = 0; >+ virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier*) = 0; >+ virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const RecordIdentifier*) = 0; > virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0; > virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) = 0; > >@@ -104,8 +97,7 @@ public: > virtual PassRefPtr<IDBKey> key() = 0; > virtual PassRefPtr<IDBKey> primaryKey() = 0; > virtual String value() = 0; >- virtual PassRefPtr<ObjectStoreRecordIdentifier> objectStoreRecordIdentifier() = 0; >- virtual void close() = 0; >+ virtual PassRefPtr<RecordIdentifier> objectStoreRecordIdentifier() = 0; > virtual ~Cursor() { }; > }; > >diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp >index 428cc0412c2b63444074032f82ce5b879de8bb22..b4944ca895c8d02d0154e05d61536731c05a3cc7 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp >@@ -198,8 +198,6 @@ void IDBCursorBackendImpl::close() > { > IDB_TRACE("IDBCursorBackendImpl::close"); > m_closed = true; >- if (m_cursor) >- m_cursor->close(); > m_cursor.clear(); > m_savedCursor.clear(); > } >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp >index 402b759dca1bb3c8f76de5ae63fffa903785354e..13e699f9666821cfb00b9050da8199e01474332a 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp >@@ -126,7 +126,7 @@ void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBI > do { > ++count; > } while (backingStoreCursor->continueFunction(0)); >- backingStoreCursor->close(); >+ > callbacks->onSuccess(count); > } > >@@ -155,12 +155,11 @@ void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBInd > return; > } > key = backingStoreCursor->key(); >- backingStoreCursor->close(); > } > > RefPtr<IDBKey> primaryKey = index->backingStore()->getPrimaryKeyViaIndex(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key); > >- String value = index->backingStore()->getObjectStoreRecord(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), *primaryKey); >+ String value = index->backingStore()->getRecord(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), *primaryKey); > > if (value.isNull()) { > callbacks->onSuccess(); >@@ -189,11 +188,9 @@ void IDBIndexBackendImpl::getKeyInternal(ScriptExecutionContext* context, PassRe > RefPtr<IDBKey> keyResult = index->backingStore()->getPrimaryKeyViaIndex(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *backingStoreCursor->key()); > if (!keyResult) { > callbacks->onSuccess(static_cast<IDBKey*>(0)); >- backingStoreCursor->close(); > return; > } > callbacks->onSuccess(keyResult.get()); >- backingStoreCursor->close(); > } > > >diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h >index 26d6f90a9b9cc3c439fab921bd573c6b7a0a1853..1cb272514a1f281203508353a394210723c4b384 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h >+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h >@@ -54,22 +54,20 @@ public: > virtual Vector<IDBObjectStoreMetadata> getObjectStores(int64_t databaseId); > virtual bool createObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement); > virtual void deleteObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId); >- virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier(); >- virtual String getObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&); >- virtual bool putObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*); >+ virtual PassRefPtr<RecordIdentifier> createInvalidRecordIdentifier(); >+ virtual String getRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&); >+ virtual bool putRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, RecordIdentifier*); > virtual void clearObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId); >- virtual void deleteObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*); >+ virtual void deleteRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier*); > virtual int64_t getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId); > virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent); >- virtual bool keyExistsInObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier); >- >- virtual bool forEachObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&); >+ virtual bool keyExistsInObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier); > > virtual Vector<IDBIndexMetadata> getIndexes(int64_t databaseId, int64_t objectStoreId); > virtual bool createIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry); > virtual void deleteIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId); >- virtual bool putIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*); >- virtual bool deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*); >+ virtual bool putIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier*); >+ virtual bool deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const RecordIdentifier*); > virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&); > virtual bool keyExistsInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey); > >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp >index 976ad0bdb7b97b8bdab7222e990695deccba5a62..4640c13dd2e3c77b2de80cc0db7adbf5903e03f5 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp >@@ -89,10 +89,9 @@ void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr< > return; > } > key = backingStoreCursor->key(); >- backingStoreCursor->close(); > } > >- String wireData = objectStore->backingStore()->getObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key); >+ String wireData = objectStore->backingStore()->getRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key); > if (wireData.isNull()) { > callbacks->onSuccess(); > return; >@@ -160,7 +159,7 @@ public: > return true; > } > >- bool writeIndexKeys(const IDBBackingStore::ObjectStoreRecordIdentifier* recordIdentifier, IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId) const >+ bool writeIndexKeys(const IDBBackingStore::RecordIdentifier* recordIdentifier, IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId) const > { > int64_t indexId = m_indexMetadata.id; > for (size_t i = 0; i < m_indexKeys.size(); ++i) { >@@ -237,7 +236,7 @@ void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, c > RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr); > > // FIXME: This method could be asynchronous, but we need to evaluate if it's worth the extra complexity. >- RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = backingStore()->createInvalidRecordIdentifier(); >+ RefPtr<IDBBackingStore::RecordIdentifier> recordIdentifier = backingStore()->createInvalidRecordIdentifier(); > if (!backingStore()->keyExistsInObjectStore(transaction->backingStoreTransaction(), databaseId(), id(), *primaryKey, recordIdentifier.get())) { > transaction->abort(); > return; >@@ -330,7 +329,7 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr< > > ASSERT(key && key->isValid()); > >- RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = objectStore->backingStore()->createInvalidRecordIdentifier(); >+ RefPtr<IDBBackingStore::RecordIdentifier> recordIdentifier = objectStore->backingStore()->createInvalidRecordIdentifier(); > if (putMode == AddOnly && objectStore->backingStore()->keyExistsInObjectStore(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, recordIdentifier.get())) { > callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "Key already exists in the object store.")); > return; >@@ -345,7 +344,7 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr< > > // Before this point, don't do any mutation. After this point, rollback the transaction in case of error. > >- if (!objectStore->backingStore()->putObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) { >+ if (!objectStore->backingStore()->putRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) { > RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."); > callbacks->onError(error); > transaction->abort(error); >@@ -388,7 +387,7 @@ void IDBObjectStoreBackendImpl::deleteFunction(PassRefPtr<IDBKeyRange> prpKeyRan > void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction) > { > IDB_TRACE("IDBObjectStoreBackendImpl::deleteInternal"); >- RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier; >+ RefPtr<IDBBackingStore::RecordIdentifier> recordIdentifier; > > RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT); > if (backingStoreCursor) { >@@ -401,11 +400,9 @@ void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefP > ASSERT_UNUSED(success, success); > } > >- objectStore->backingStore()->deleteObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), recordIdentifier.get()); >+ objectStore->backingStore()->deleteRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), recordIdentifier.get()); > > } while (backingStoreCursor->continueFunction(0)); >- >- backingStoreCursor->close(); > } > > callbacks->onSuccess(); >@@ -581,7 +578,6 @@ void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPt > ++count; > } while (backingStoreCursor->continueFunction(0)); > >- backingStoreCursor->close(); > callbacks->onSuccess(count); > } > >diff --git a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h >index 1f1640841067bdcead0f8ddd82a927255762192e..4e37d3eaa904f6b922f28d20b89ee0b1d50c1bf9 100644 >--- a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h >+++ b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h >@@ -43,23 +43,21 @@ public: > virtual bool createObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE { return false; }; > virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { } > >- virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<ObjectStoreRecordIdentifier>(); } >+ virtual PassRefPtr<RecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<RecordIdentifier>(); } > >- virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); } >- virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) OVERRIDE { return false; } >+ virtual String getRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); } >+ virtual bool putRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, RecordIdentifier*) OVERRIDE { return false; } > virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { } >- virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) OVERRIDE { } >+ virtual void deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier*) OVERRIDE { } > virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; } > virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; } >- virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; } >- >- virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) OVERRIDE { return false; } >+ virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; } > > virtual Vector<IDBIndexMetadata> getIndexes(int64_t databaseId, int64_t objectStoreId) OVERRIDE { return Vector<IDBIndexMetadata>(); } > 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; }; > virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { } >- virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; } >- virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; } >+ virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier*) OVERRIDE { return false; } >+ virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const RecordIdentifier*) OVERRIDE { return false; } > virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); } > virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 101488
: 172839