Transition most use of IDBBackingStoreLevelDB to IDBBackingStoreInterface
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 20:31:07 +0000 (20:31 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 20:31:07 +0000 (20:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123105

Reviewed by Anders Carlsson.

Source/WebCore:

Export more required headers:
* WebCore.xcodeproj/project.pbxproj:

Flesh out many of the pure virtual methods on IDBBackingStoreInterface, as well as
the RecordIdentifier and Cursor classes:

* Modules/indexeddb/IDBBackingStoreInterface.h:
(WebCore::IDBBackingStoreInterface::RecordIdentifier::~RecordIdentifier):
(WebCore::IDBBackingStoreInterface::Cursor::~Cursor):

Use IDBBackingStoreInterface, IDBBackingStoreInterface::RecordIdentifier, and
IDBBackingStoreInterface::Cursor wherever possible:

* Modules/indexeddb/IDBFactoryBackendInterface.cpp:
* Modules/indexeddb/IDBFactoryBackendInterface.h:

* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
(WebCore::IDBBackingStoreLevelDB::putRecord):
(WebCore::IDBBackingStoreLevelDB::deleteRecord):
(WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
(WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
(WebCore::ObjectStoreKeyCursorImpl::clone):
(WebCore::ObjectStoreCursorImpl::clone):
(WebCore::IndexKeyCursorImpl::clone):
(WebCore::IndexCursorImpl::clone):
(WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
(WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
(WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
(WebCore::IDBBackingStoreLevelDB::openIndexCursor):
(WebCore::IDBBackingStoreLevelDB::Transaction::Transaction):
(WebCore::IDBBackingStoreLevelDB::Transaction::begin):
* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
(WebCore::IDBBackingStoreLevelDB::RecordIdentifier::RecordIdentifier):

* Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.cpp:
(WebCore::IDBCursorBackendLevelDB::IDBCursorBackendLevelDB):
* Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.h:

(WebCore::IDBCursorBackendLevelDB::create):
* Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
(WebCore::IDBDatabaseBackendLevelDB::create):
(WebCore::IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB):
(WebCore::IDBDatabaseBackendLevelDB::backingStore):
(WebCore::IDBDatabaseBackendLevelDB::setIndexKeys):
(WebCore::IDBDatabaseBackendLevelDB::createTransaction):
* Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
(WebCore::IDBFactoryBackendLevelDB::createTransactionBackend):
* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp:
(WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::verifyIndexKeys):
(WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::writeIndexKeys):
(WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::addingKeyAllowed):
(WebCore::IDBObjectStoreBackendLevelDB::makeIndexWriters):
(WebCore::IDBObjectStoreBackendLevelDB::generateKey):
(WebCore::IDBObjectStoreBackendLevelDB::updateKeyGenerator):
* Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp:
(WebCore::IDBTransactionBackendLevelDB::create):
(WebCore::IDBTransactionBackendLevelDB::IDBTransactionBackendLevelDB):
* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.cpp:
(WebCore::GetOperation::perform):
(WebCore::OpenCursorOperation::perform):
(WebCore::CountOperation::perform):
(WebCore::DeleteRangeOperation::perform):
* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.h:
(WebCore::CreateObjectStoreOperation::create):
(WebCore::CreateObjectStoreOperation::CreateObjectStoreOperation):
(WebCore::DeleteObjectStoreOperation::create):
(WebCore::DeleteObjectStoreOperation::DeleteObjectStoreOperation):
(WebCore::CreateIndexOperation::create):
(WebCore::CreateIndexOperation::CreateIndexOperation):
(WebCore::DeleteIndexOperation::create):
(WebCore::DeleteIndexOperation::DeleteIndexOperation):
(WebCore::GetOperation::create):
(WebCore::GetOperation::GetOperation):
(WebCore::PutOperation::create):
(WebCore::PutOperation::PutOperation):
(WebCore::OpenCursorOperation::create):
(WebCore::OpenCursorOperation::OpenCursorOperation):
(WebCore::CountOperation::create):
(WebCore::CountOperation::CountOperation):
(WebCore::DeleteRangeOperation::create):
(WebCore::DeleteRangeOperation::DeleteRangeOperation):
(WebCore::ClearOperation::create):
(WebCore::ClearOperation::ClearOperation):

Source/WebKit2:

Stub out a new pure virtual method:
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
(WebKit::WebIDBFactoryBackend::createTransactionBackend):
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157730 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBBackingStoreInterface.h
Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.cpp
Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h
Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h

index ae57f67..323cb1d 100644 (file)
@@ -1,3 +1,102 @@
+2013-10-21  Brady Eidson  <beidson@apple.com>
+
+        Transition most use of IDBBackingStoreLevelDB to IDBBackingStoreInterface
+        https://bugs.webkit.org/show_bug.cgi?id=123105
+
+        Reviewed by Anders Carlsson.
+
+        Export more required headers:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        Flesh out many of the pure virtual methods on IDBBackingStoreInterface, as well as
+        the RecordIdentifier and Cursor classes:
+
+        * Modules/indexeddb/IDBBackingStoreInterface.h:
+        (WebCore::IDBBackingStoreInterface::RecordIdentifier::~RecordIdentifier):
+        (WebCore::IDBBackingStoreInterface::Cursor::~Cursor):
+
+        Use IDBBackingStoreInterface, IDBBackingStoreInterface::RecordIdentifier, and
+        IDBBackingStoreInterface::Cursor wherever possible:
+
+        * Modules/indexeddb/IDBFactoryBackendInterface.cpp:
+        * Modules/indexeddb/IDBFactoryBackendInterface.h:
+
+        * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
+        (WebCore::IDBBackingStoreLevelDB::putRecord):
+        (WebCore::IDBBackingStoreLevelDB::deleteRecord):
+        (WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
+        (WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
+        (WebCore::ObjectStoreKeyCursorImpl::clone):
+        (WebCore::ObjectStoreCursorImpl::clone):
+        (WebCore::IndexKeyCursorImpl::clone):
+        (WebCore::IndexCursorImpl::clone):
+        (WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
+        (WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
+        (WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
+        (WebCore::IDBBackingStoreLevelDB::openIndexCursor):
+        (WebCore::IDBBackingStoreLevelDB::Transaction::Transaction):
+        (WebCore::IDBBackingStoreLevelDB::Transaction::begin):
+        * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
+        (WebCore::IDBBackingStoreLevelDB::RecordIdentifier::RecordIdentifier):
+
+        * Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.cpp:
+        (WebCore::IDBCursorBackendLevelDB::IDBCursorBackendLevelDB):
+        * Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.h:
+
+        (WebCore::IDBCursorBackendLevelDB::create):
+        * Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
+        (WebCore::IDBDatabaseBackendLevelDB::create):
+        (WebCore::IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB):
+        (WebCore::IDBDatabaseBackendLevelDB::backingStore):
+        (WebCore::IDBDatabaseBackendLevelDB::setIndexKeys):
+        (WebCore::IDBDatabaseBackendLevelDB::createTransaction):
+        * Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.h:
+
+        * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
+        (WebCore::IDBFactoryBackendLevelDB::createTransactionBackend):
+        * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
+
+        * Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp:
+        (WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::verifyIndexKeys):
+        (WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::writeIndexKeys):
+        (WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::addingKeyAllowed):
+        (WebCore::IDBObjectStoreBackendLevelDB::makeIndexWriters):
+        (WebCore::IDBObjectStoreBackendLevelDB::generateKey):
+        (WebCore::IDBObjectStoreBackendLevelDB::updateKeyGenerator):
+        * Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.h:
+
+        * Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp:
+        (WebCore::IDBTransactionBackendLevelDB::create):
+        (WebCore::IDBTransactionBackendLevelDB::IDBTransactionBackendLevelDB):
+        * Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.h:
+
+        * Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.cpp:
+        (WebCore::GetOperation::perform):
+        (WebCore::OpenCursorOperation::perform):
+        (WebCore::CountOperation::perform):
+        (WebCore::DeleteRangeOperation::perform):
+        * Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.h:
+        (WebCore::CreateObjectStoreOperation::create):
+        (WebCore::CreateObjectStoreOperation::CreateObjectStoreOperation):
+        (WebCore::DeleteObjectStoreOperation::create):
+        (WebCore::DeleteObjectStoreOperation::DeleteObjectStoreOperation):
+        (WebCore::CreateIndexOperation::create):
+        (WebCore::CreateIndexOperation::CreateIndexOperation):
+        (WebCore::DeleteIndexOperation::create):
+        (WebCore::DeleteIndexOperation::DeleteIndexOperation):
+        (WebCore::GetOperation::create):
+        (WebCore::GetOperation::GetOperation):
+        (WebCore::PutOperation::create):
+        (WebCore::PutOperation::PutOperation):
+        (WebCore::OpenCursorOperation::create):
+        (WebCore::OpenCursorOperation::OpenCursorOperation):
+        (WebCore::CountOperation::create):
+        (WebCore::CountOperation::CountOperation):
+        (WebCore::DeleteRangeOperation::create):
+        (WebCore::DeleteRangeOperation::DeleteRangeOperation):
+        (WebCore::ClearOperation::create):
+        (WebCore::ClearOperation::ClearOperation):
+
 2013-10-21  Zoltan Horvath  <zoltan@webkit.org>
 
         [CSS Shapes][CSS Regions] Don't apply shape-inside when we have multiple auto-height regions and the height is not resolved
index 2ba9f85..499d60d 100644 (file)
@@ -26,6 +26,9 @@
 #ifndef IDBBackingStoreInterface_h
 #define IDBBackingStoreInterface_h
 
+#include "IDBMetadata.h"
+#include "IndexedDB.h"
+
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
+class IDBKey;
+class IDBKeyPath;
+class IDBKeyRange;
+class SharedBuffer;
+
 class IDBBackingStoreInterface : public RefCounted<IDBBackingStoreInterface> {
 public:
     virtual ~IDBBackingStoreInterface() { }
@@ -42,6 +50,67 @@ public:
     public:
         virtual ~Transaction() { }
     };
+
+    class RecordIdentifier {
+    public:
+        virtual ~RecordIdentifier() { }
+
+        virtual const Vector<char> primaryKey() const = 0;
+        virtual int64_t version() const = 0;
+        virtual void reset(const Vector<char>& primaryKey, int64_t version) = 0;
+    };
+
+    class Cursor : public RefCounted<Cursor> {
+    public:
+        enum IteratorState {
+            Ready = 0,
+            Seek
+        };
+
+        virtual ~Cursor() { }
+
+        virtual PassRefPtr<IDBKey> key() const = 0;
+        virtual bool continueFunction(const IDBKey* = 0, IteratorState = Seek) = 0;
+        virtual bool advance(unsigned long) = 0;
+
+        virtual PassRefPtr<Cursor> clone() = 0;
+        virtual PassRefPtr<IDBKey> primaryKey() const = 0;
+        virtual PassRefPtr<SharedBuffer> value() const = 0;
+        virtual const RecordIdentifier& recordIdentifier() const = 0;
+    };
+
+    virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata*, bool& found) = 0;
+    virtual bool getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap* objectStores) = 0;
+    virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId) = 0;
+    virtual bool keyExistsInObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, IDBBackingStoreInterface::RecordIdentifier* foundRecordIdentifier, bool& found) = 0;
+
+    virtual bool putIndexDataForRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const IDBBackingStoreInterface::RecordIdentifier&) = 0;
+    virtual bool keyExistsInIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& foundPrimaryKey, bool& exists) = 0;
+
+    virtual bool deleteDatabase(const String& name) = 0;
+    virtual bool updateIDBDatabaseIntVersion(IDBBackingStoreInterface::Transaction*, int64_t rowId, int64_t intVersion) = 0;
+
+    virtual bool getRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, Vector<char>& record) = 0;
+    virtual bool putRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, PassRefPtr<SharedBuffer> value, IDBBackingStoreInterface::RecordIdentifier*) = 0;
+    virtual bool deleteRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBBackingStoreInterface::RecordIdentifier&) = 0;
+
+    virtual bool createObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) = 0;
+    virtual bool deleteObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
+    virtual bool clearObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
+
+    virtual bool createIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) = 0;
+    virtual bool deleteIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0;
+
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openObjectStoreKeyCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection) = 0;
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openObjectStoreCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection) = 0;
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openIndexKeyCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IndexedDB::CursorDirection) = 0;
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openIndexCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IndexedDB::CursorDirection) = 0;
+
+    virtual bool getPrimaryKeyViaIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& primaryKey) = 0;
+
+    virtual bool getKeyGeneratorCurrentNumber(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t& keyGeneratorCurrentNumber) = 0;
+    virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent) = 0;
+
 };
 
 } // namespace WebCore
index 6e7b37a..03c445b 100644 (file)
 #include "DatabaseStrategy.h"
 #include "PlatformStrategies.h"
 
-#if USE(LEVELDB)
-#include "IDBFactoryBackendLevelDB.h"
-#endif
-
 namespace WebCore {
 
 PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendInterface::create()
index aa1c480..7922398 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef IDBFactoryBackendInterface_h
 #define IDBFactoryBackendInterface_h
 
+#include "IndexedDB.h"
+
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
+class IDBBackingStoreInterface;
 class IDBCallbacks;
 class IDBDatabase;
+class IDBDatabaseBackendLevelDB; // FIXME: This is a LevelDB specific type for now. http://webkit.org/b/123027 will fix that.
 class IDBDatabaseCallbacks;
+class IDBTransactionBackendInterface;
 class SecurityOrigin;
 class ScriptExecutionContext;
 
@@ -58,6 +63,8 @@ public:
     virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
 
     virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier) = 0;
+
+    virtual PassRefPtr<IDBTransactionBackendInterface> createTransactionBackend(IDBDatabaseBackendLevelDB*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode) = 0;
 };
 
 } // namespace WebCore
index b6ee775..28318a9 100644 (file)
@@ -898,7 +898,7 @@ WARN_UNUSED_RETURN static bool getNewVersionNumber(LevelDBTransaction* transacti
     return true;
 }
 
-bool IDBBackingStoreLevelDB::putRecord(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, PassRefPtr<SharedBuffer> prpValue, RecordIdentifier* recordIdentifier)
+bool IDBBackingStoreLevelDB::putRecord(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, PassRefPtr<SharedBuffer> prpValue, IDBBackingStoreInterface::RecordIdentifier* recordIdentifier)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::putRecord");
     if (!KeyPrefix::validIds(databaseId, objectStoreId))
@@ -941,7 +941,7 @@ bool IDBBackingStoreLevelDB::clearObjectStore(IDBBackingStoreInterface::Transact
     return true;
 }
 
-bool IDBBackingStoreLevelDB::deleteRecord(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier& recordIdentifier)
+bool IDBBackingStoreLevelDB::deleteRecord(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBBackingStoreInterface::RecordIdentifier& recordIdentifier)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::deleteRecord");
     if (!KeyPrefix::validIds(databaseId, objectStoreId))
@@ -1027,7 +1027,7 @@ bool IDBBackingStoreLevelDB::maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStor
     return true;
 }
 
-bool IDBBackingStoreLevelDB::keyExistsInObjectStore(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, RecordIdentifier* foundRecordIdentifier, bool& found)
+bool IDBBackingStoreLevelDB::keyExistsInObjectStore(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, IDBBackingStoreInterface::RecordIdentifier* foundRecordIdentifier, bool& found)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::keyExistsInObjectStore");
     if (!KeyPrefix::validIds(databaseId, objectStoreId))
@@ -1186,7 +1186,7 @@ bool IDBBackingStoreLevelDB::deleteIndex(IDBBackingStoreInterface::Transaction*
     return true;
 }
 
-bool IDBBackingStoreLevelDB::putIndexDataForRecord(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const RecordIdentifier& recordIdentifier)
+bool IDBBackingStoreLevelDB::putIndexDataForRecord(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const IDBBackingStoreInterface::RecordIdentifier& recordIdentifier)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::putIndexDataForRecord");
     ASSERT(key.isValid());
@@ -1499,7 +1499,7 @@ public:
         return adoptRef(new ObjectStoreKeyCursorImpl(transaction, cursorOptions));
     }
 
-    virtual PassRefPtr<IDBBackingStoreLevelDB::Cursor> clone()
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> clone()
     {
         return adoptRef(new ObjectStoreKeyCursorImpl(this));
     }
@@ -1560,7 +1560,7 @@ public:
         return adoptRef(new ObjectStoreCursorImpl(transaction, cursorOptions));
     }
 
-    virtual PassRefPtr<IDBBackingStoreLevelDB::Cursor> clone()
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> clone()
     {
         return adoptRef(new ObjectStoreCursorImpl(this));
     }
@@ -1627,7 +1627,7 @@ public:
         return adoptRef(new IndexKeyCursorImpl(transaction, cursorOptions));
     }
 
-    virtual PassRefPtr<IDBBackingStoreLevelDB::Cursor> clone()
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> clone()
     {
         return adoptRef(new IndexKeyCursorImpl(this));
     }
@@ -1718,7 +1718,7 @@ public:
         return adoptRef(new IndexCursorImpl(transaction, cursorOptions));
     }
 
-    virtual PassRefPtr<IDBBackingStoreLevelDB::Cursor> clone()
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> clone()
     {
         return adoptRef(new IndexCursorImpl(this));
     }
@@ -1910,8 +1910,8 @@ static bool indexCursorOptions(LevelDBTransaction* transaction, int64_t database
 
     return true;
 }
+PassRefPtr<IDBBackingStoreInterface::Cursor> IDBBackingStoreLevelDB::openObjectStoreCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
 
-PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openObjectStoreCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::openObjectStoreCursor");
     LevelDBTransaction* levelDBTransaction = IDBBackingStoreLevelDB::Transaction::levelDBTransactionFrom(transaction);
@@ -1925,7 +1925,7 @@ PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openObjectSto
     return cursor.release();
 }
 
-PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openObjectStoreKeyCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
+PassRefPtr<IDBBackingStoreInterface::Cursor> IDBBackingStoreLevelDB::openObjectStoreKeyCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::openObjectStoreKeyCursor");
     LevelDBTransaction* levelDBTransaction = IDBBackingStoreLevelDB::Transaction::levelDBTransactionFrom(transaction);
@@ -1939,7 +1939,7 @@ PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openObjectSto
     return cursor.release();
 }
 
-PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openIndexKeyCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
+PassRefPtr<IDBBackingStoreInterface::Cursor> IDBBackingStoreLevelDB::openIndexKeyCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::openIndexKeyCursor");
     LevelDBTransaction* levelDBTransaction = IDBBackingStoreLevelDB::Transaction::levelDBTransactionFrom(transaction);
@@ -1953,7 +1953,7 @@ PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openIndexKeyC
     return cursor.release();
 }
 
-PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openIndexCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
+PassRefPtr<IDBBackingStoreInterface::Cursor> IDBBackingStoreLevelDB::openIndexCursor(IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IndexedDB::CursorDirection direction)
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::openIndexCursor");
     LevelDBTransaction* levelDBTransaction = IDBBackingStoreLevelDB::Transaction::levelDBTransactionFrom(transaction);
@@ -1967,7 +1967,7 @@ PassRefPtr<IDBBackingStoreLevelDB::Cursor> IDBBackingStoreLevelDB::openIndexCurs
     return cursor.release();
 }
 
-IDBBackingStoreLevelDB::Transaction::Transaction(IDBBackingStoreLevelDB* backingStore)
+IDBBackingStoreLevelDB::Transaction::Transaction(IDBBackingStoreInterface* backingStore)
     : m_backingStore(backingStore)
 {
 }
@@ -1976,7 +1976,7 @@ void IDBBackingStoreLevelDB::Transaction::begin()
 {
     LOG(StorageAPI, "IDBBackingStoreLevelDB::Transaction::begin");
     ASSERT(!m_transaction);
-    m_transaction = LevelDBTransaction::create(m_backingStore->m_db.get());
+    m_transaction = LevelDBTransaction::create(reinterpret_cast<IDBBackingStoreLevelDB*>(m_backingStore)->m_db.get());
 }
 
 bool IDBBackingStoreLevelDB::Transaction::commit()
index 11e09ee..80ec859 100644 (file)
@@ -55,7 +55,7 @@ public:
     virtual bool destroyLevelDB(const String& fileName) = 0;
 };
 
-class IDBBackingStoreLevelDB : public IDBBackingStoreInterface {
+class IDBBackingStoreLevelDB FINAL : public IDBBackingStoreInterface {
 public:
     class Transaction;
 
@@ -67,52 +67,58 @@ public:
     WeakPtr<IDBBackingStoreLevelDB> createWeakPtr() { return m_weakFactory.createWeakPtr(); }
 
     virtual Vector<String> getDatabaseNames();
-    virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata*, bool& success) WARN_UNUSED_RETURN;
-    virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId);
+    virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata*, bool& success) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId) OVERRIDE;
     virtual bool updateIDBDatabaseMetaData(IDBBackingStoreLevelDB::Transaction*, int64_t rowId, const String& version);
-    virtual bool updateIDBDatabaseIntVersion(IDBBackingStoreInterface::Transaction*, int64_t rowId, int64_t intVersion);
-    virtual bool deleteDatabase(const String& name);
+    virtual bool updateIDBDatabaseIntVersion(IDBBackingStoreInterface::Transaction*, int64_t rowId, int64_t intVersion) OVERRIDE;
+    virtual bool deleteDatabase(const String& name) OVERRIDE;
 
-    bool getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap*) WARN_UNUSED_RETURN;
-    virtual bool createObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement);
-    virtual bool deleteObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) WARN_UNUSED_RETURN;
+    virtual bool getObjectStores(int64_t databaseId, IDBDatabaseMetadata::ObjectStoreMap*) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool createObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE;
+    virtual bool deleteObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE WARN_UNUSED_RETURN;
 
-    class RecordIdentifier {
-        WTF_MAKE_NONCOPYABLE(RecordIdentifier);
+    class RecordIdentifier : public IDBBackingStoreInterface::RecordIdentifier {
     public:
-        RecordIdentifier(const Vector<char>& primaryKey, int64_t version) : m_primaryKey(primaryKey), m_version(version) { ASSERT(!primaryKey.isEmpty()); }
-        RecordIdentifier() : m_primaryKey(), m_version(-1) { }
+        RecordIdentifier(const Vector<char>& primaryKey, int64_t version)
+            : IDBBackingStoreInterface::RecordIdentifier()
+            , m_primaryKey(primaryKey)
+            , m_version(version)
+        {
+            ASSERT(!primaryKey.isEmpty());
+        }
 
-        const Vector<char> primaryKey() const { return m_primaryKey; }
-        int64_t version() const { return m_version; }
-        void reset(const Vector<char>& primaryKey, int64_t version) { m_primaryKey = primaryKey; m_version = version; }
+        RecordIdentifier()
+            : IDBBackingStoreInterface::RecordIdentifier()
+            , m_primaryKey()
+            , m_version(-1)
+        {
+        }
+
+        const Vector<char> primaryKey() const OVERRIDE { return m_primaryKey; }
+        int64_t version() const OVERRIDE { return m_version; }
+        virtual void reset(const Vector<char>& primaryKey, int64_t version) OVERRIDE { m_primaryKey = primaryKey; m_version = version; }
 
     private:
         Vector<char> m_primaryKey; // FIXME: Make it more clear that this is the *encoded* version of the key.
         int64_t m_version;
     };
 
-    virtual bool getRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, Vector<char>& record) WARN_UNUSED_RETURN;
-    virtual bool putRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, PassRefPtr<SharedBuffer> value, RecordIdentifier*) WARN_UNUSED_RETURN;
-    virtual bool clearObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) WARN_UNUSED_RETURN;
-    virtual bool deleteRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier&) WARN_UNUSED_RETURN;
-    virtual bool getKeyGeneratorCurrentNumber(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t& currentNumber) WARN_UNUSED_RETURN;
-    virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent) WARN_UNUSED_RETURN;
-    virtual bool keyExistsInObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier, bool& found) WARN_UNUSED_RETURN;
-
-    virtual bool createIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) WARN_UNUSED_RETURN;
-    virtual bool deleteIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) WARN_UNUSED_RETURN;
-    virtual bool putIndexDataForRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier&) WARN_UNUSED_RETURN;
-    virtual bool getPrimaryKeyViaIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& primaryKey) WARN_UNUSED_RETURN;
-    virtual bool keyExistsInIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey, bool& exists) WARN_UNUSED_RETURN;
-
-    class Cursor : public RefCounted<Cursor> {
+    virtual bool getRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, Vector<char>& record) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool putRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, PassRefPtr<SharedBuffer> value, IDBBackingStoreInterface::RecordIdentifier*) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool clearObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool deleteRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBBackingStoreInterface::RecordIdentifier&) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool getKeyGeneratorCurrentNumber(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t& currentNumber) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool keyExistsInObjectStore(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, IDBBackingStoreInterface::RecordIdentifier* foundRecordIdentifier, bool& found) OVERRIDE WARN_UNUSED_RETURN;
+
+    virtual bool createIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool deleteIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool putIndexDataForRecord(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const IDBBackingStoreInterface::RecordIdentifier&) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool getPrimaryKeyViaIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& primaryKey) OVERRIDE WARN_UNUSED_RETURN;
+    virtual bool keyExistsInIndex(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey, bool& exists) OVERRIDE WARN_UNUSED_RETURN;
+
+    class Cursor : public IDBBackingStoreInterface::Cursor {
     public:
-        enum IteratorState {
-            Ready = 0,
-            Seek
-        };
-
         struct CursorOptions {
             int64_t databaseId;
             int64_t objectStoreId;
@@ -125,15 +131,15 @@ public:
             bool unique;
         };
 
-        PassRefPtr<IDBKey> key() const { return m_currentKey; }
-        bool continueFunction(const IDBKey* = 0, IteratorState = Seek);
-        bool advance(unsigned long);
+        virtual PassRefPtr<IDBKey> key() const OVERRIDE { return m_currentKey; }
+        virtual bool continueFunction(const IDBKey* = 0, IteratorState = Seek) OVERRIDE;
+        virtual bool advance(unsigned long) OVERRIDE;
         bool firstSeek();
 
-        virtual PassRefPtr<Cursor> clone() = 0;
-        virtual PassRefPtr<IDBKey> primaryKey() const { return m_currentKey; }
-        virtual PassRefPtr<SharedBuffer> value() const = 0;
-        virtual const RecordIdentifier& recordIdentifier() const { return m_recordIdentifier; }
+        virtual PassRefPtr<IDBBackingStoreInterface::Cursor> clone() OVERRIDE = 0;
+        virtual PassRefPtr<IDBKey> primaryKey() const OVERRIDE { return m_currentKey; }
+        virtual PassRefPtr<SharedBuffer> value() const OVERRIDE = 0;
+        virtual const RecordIdentifier& recordIdentifier() const OVERRIDE { return m_recordIdentifier; }
         virtual ~Cursor() { }
         virtual bool loadCurrentRow() = 0;
 
@@ -157,14 +163,14 @@ public:
         IDBBackingStoreLevelDB::RecordIdentifier m_recordIdentifier;
     };
 
-    virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection);
-    virtual PassRefPtr<Cursor> openObjectStoreCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection);
-    virtual PassRefPtr<Cursor> openIndexKeyCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IndexedDB::CursorDirection);
-    virtual PassRefPtr<Cursor> openIndexCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IndexedDB::CursorDirection);
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openObjectStoreKeyCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection) OVERRIDE;
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openObjectStoreCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IndexedDB::CursorDirection) OVERRIDE;
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openIndexKeyCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IndexedDB::CursorDirection) OVERRIDE;
+    virtual PassRefPtr<IDBBackingStoreInterface::Cursor> openIndexCursor(IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IndexedDB::CursorDirection) OVERRIDE;
 
     class Transaction : public IDBBackingStoreInterface::Transaction {
     public:
-        explicit Transaction(IDBBackingStoreLevelDB*);
+        explicit Transaction(IDBBackingStoreInterface*);
         void begin();
         bool commit();
         void rollback();
@@ -180,7 +186,7 @@ public:
         }
 
     private:
-        IDBBackingStoreLevelDB* m_backingStore;
+        IDBBackingStoreInterface* m_backingStore;
         RefPtr<LevelDBTransaction> m_transaction;
     };
 
index 3714a05..29a5980 100644 (file)
@@ -101,7 +101,7 @@ private:
     RefPtr<IDBCallbacks> m_callbacks;
 };
 
-IDBCursorBackendLevelDB::IDBCursorBackendLevelDB(PassRefPtr<IDBBackingStoreLevelDB::Cursor> cursor, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, IDBTransactionBackendLevelDB* transaction, int64_t objectStoreId)
+IDBCursorBackendLevelDB::IDBCursorBackendLevelDB(PassRefPtr<IDBBackingStoreInterface::Cursor> cursor, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, IDBTransactionBackendLevelDB* transaction, int64_t objectStoreId)
     : m_taskType(taskType)
     , m_cursorType(cursorType)
     , m_database(transaction->database())
index 18acfe6..b2deea3 100644 (file)
@@ -44,11 +44,11 @@ class IDBKeyRange;
 
 class IDBCursorBackendLevelDB : public IDBCursorBackendInterface {
 public:
-    static PassRefPtr<IDBCursorBackendLevelDB> create(PassRefPtr<IDBBackingStoreLevelDB::Cursor> cursor, IndexedDB::CursorType cursorType, IDBTransactionBackendLevelDB* transaction, int64_t objectStoreId)
+    static PassRefPtr<IDBCursorBackendLevelDB> create(PassRefPtr<IDBBackingStoreInterface::Cursor> cursor, IndexedDB::CursorType cursorType, IDBTransactionBackendLevelDB* transaction, int64_t objectStoreId)
     {
         return adoptRef(new IDBCursorBackendLevelDB(cursor, cursorType, IDBDatabaseBackendInterface::NormalTask, transaction, objectStoreId));
     }
-    static PassRefPtr<IDBCursorBackendLevelDB> create(PassRefPtr<IDBBackingStoreLevelDB::Cursor> cursor, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, IDBTransactionBackendLevelDB* transaction, int64_t objectStoreId)
+    static PassRefPtr<IDBCursorBackendLevelDB> create(PassRefPtr<IDBBackingStoreInterface::Cursor> cursor, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, IDBTransactionBackendLevelDB* transaction, int64_t objectStoreId)
     {
         return adoptRef(new IDBCursorBackendLevelDB(cursor, cursorType, taskType, transaction, objectStoreId));
     }
@@ -68,7 +68,7 @@ public:
     void close();
 
 private:
-    IDBCursorBackendLevelDB(PassRefPtr<IDBBackingStoreLevelDB::Cursor>, IndexedDB::CursorType, IDBDatabaseBackendInterface::TaskType, IDBTransactionBackendLevelDB*, int64_t objectStoreId);
+    IDBCursorBackendLevelDB(PassRefPtr<IDBBackingStoreInterface::Cursor>, IndexedDB::CursorType, IDBDatabaseBackendInterface::TaskType, IDBTransactionBackendLevelDB*, int64_t objectStoreId);
 
     class CursorIterationOperation;
     class CursorAdvanceOperation;
@@ -80,8 +80,8 @@ private:
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
     const int64_t m_objectStoreId;
 
-    RefPtr<IDBBackingStoreLevelDB::Cursor> m_cursor; // Must be destroyed before m_transaction.
-    RefPtr<IDBBackingStoreLevelDB::Cursor> m_savedCursor; // Must be destroyed before m_transaction.
+    RefPtr<IDBBackingStoreInterface::Cursor> m_cursor; // Must be destroyed before m_transaction.
+    RefPtr<IDBBackingStoreInterface::Cursor> m_savedCursor; // Must be destroyed before m_transaction.
 
     bool m_closed;
 };
index b887166..5ca86f5 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBDatabaseBackendLevelDB> IDBDatabaseBackendLevelDB::create(const String& name, IDBBackingStoreLevelDB* database, IDBFactoryBackendInterface* factory, const String& uniqueIdentifier)
+PassRefPtr<IDBDatabaseBackendLevelDB> IDBDatabaseBackendLevelDB::create(const String& name, IDBBackingStoreInterface* backingStore, IDBFactoryBackendInterface* factory, const String& uniqueIdentifier)
 {
-    RefPtr<IDBDatabaseBackendLevelDB> backend = adoptRef(new IDBDatabaseBackendLevelDB(name, database, factory, uniqueIdentifier));
+    RefPtr<IDBDatabaseBackendLevelDB> backend = adoptRef(new IDBDatabaseBackendLevelDB(name, backingStore, factory, uniqueIdentifier));
     if (!backend->openInternal())
         return 0;
     return backend.release();
 }
 
-IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB(const String& name, IDBBackingStoreLevelDB* backingStore, IDBFactoryBackendInterface* factory, const String& uniqueIdentifier)
+IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB(const String& name, IDBBackingStoreInterface* backingStore, IDBFactoryBackendInterface* factory, const String& uniqueIdentifier)
     : m_backingStore(backingStore)
     , m_metadata(name, InvalidId, 0, InvalidId)
     , m_identifier(uniqueIdentifier)
@@ -118,9 +118,9 @@ IDBDatabaseBackendLevelDB::~IDBDatabaseBackendLevelDB()
 {
 }
 
-PassRefPtr<IDBBackingStoreLevelDB> IDBDatabaseBackendLevelDB::backingStore() const
+IDBBackingStoreInterface* IDBDatabaseBackendLevelDB::backingStore() const
 {
-    return m_backingStore;
+    return m_backingStore.get();
 }
 
 void IDBDatabaseBackendLevelDB::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
@@ -246,7 +246,7 @@ void IDBDatabaseBackendLevelDB::setIndexKeys(int64_t transactionId, int64_t obje
     ASSERT(transaction->mode() == IndexedDB::TransactionVersionChange);
 
     RefPtr<IDBKey> primaryKey = prpPrimaryKey;
-    RefPtr<IDBBackingStoreLevelDB> store = backingStore();
+    RefPtr<IDBBackingStoreInterface> store = backingStore();
     // FIXME: This method could be asynchronous, but we need to evaluate if it's worth the extra complexity.
     IDBBackingStoreLevelDB::RecordIdentifier recordIdentifier;
     bool found = false;
@@ -426,7 +426,8 @@ void IDBDatabaseBackendLevelDB::processPendingCalls()
 
 void IDBDatabaseBackendLevelDB::createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
 {
-    RefPtr<IDBTransactionBackendLevelDB> transaction = IDBTransactionBackendLevelDB::create(m_backingStore.get(), transactionId, callbacks, objectStoreIds, static_cast<IndexedDB::TransactionMode>(mode), this);
+    RefPtr<IDBTransactionBackendInterface> transaction = m_factory->createTransactionBackend(this, transactionId, callbacks, objectStoreIds, static_cast<IndexedDB::TransactionMode>(mode));
+
     ASSERT(!m_transactions.contains(transactionId));
     m_transactions.add(transactionId, transaction.get());
 }
index 762c7d1..3a050f3 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace WebCore {
 
-class IDBBackingStoreLevelDB;
+class IDBBackingStoreInterface;
 class IDBDatabase;
 class IDBFactoryBackendInterface;
 class IDBTransactionBackendInterface;
@@ -45,10 +45,10 @@ class IDBTransactionCoordinatorLevelDB;
 
 class IDBDatabaseBackendLevelDB : public IDBDatabaseBackendInterface {
 public:
-    static PassRefPtr<IDBDatabaseBackendLevelDB> create(const String& name, IDBBackingStoreLevelDB* database, IDBFactoryBackendInterface*, const String& uniqueIdentifier);
+    static PassRefPtr<IDBDatabaseBackendLevelDB> create(const String& name, IDBBackingStoreInterface*, IDBFactoryBackendInterface*, const String& uniqueIdentifier);
     virtual ~IDBDatabaseBackendLevelDB();
 
-    PassRefPtr<IDBBackingStoreLevelDB> backingStore() const;
+    IDBBackingStoreInterface* backingStore() const;
 
     static const int64_t InvalidId = 0;
     int64_t id() const { return m_metadata.id; }
@@ -93,7 +93,7 @@ public:
     class VersionChangeAbortOperation;
 
 private:
-    IDBDatabaseBackendLevelDB(const String& name, IDBBackingStoreLevelDB* database, IDBFactoryBackendInterface*, const String& uniqueIdentifier);
+    IDBDatabaseBackendLevelDB(const String& name, IDBBackingStoreInterface*, IDBFactoryBackendInterface*, const String& uniqueIdentifier);
 
     bool openInternal();
     void runIntVersionChangeTransaction(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, int64_t requestedVersion);
@@ -103,7 +103,7 @@ private:
     bool isDeleteDatabaseBlocked();
     void deleteDatabaseFinal(PassRefPtr<IDBCallbacks>);
 
-    RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    RefPtr<IDBBackingStoreInterface> m_backingStore;
     IDBDatabaseMetadata m_metadata;
 
     String m_identifier;
index 8745025..5fa1acc 100644 (file)
@@ -33,6 +33,7 @@
 #include "IDBBackingStoreLevelDB.h"
 #include "IDBDatabaseBackendLevelDB.h"
 #include "IDBDatabaseException.h"
+#include "IDBTransactionBackendLevelDB.h"
 #include "IDBTransactionCoordinatorLevelDB.h"
 #include "Logging.h"
 #include "SecurityOrigin.h"
@@ -186,6 +187,11 @@ void IDBFactoryBackendLevelDB::open(const String& name, int64_t version, int64_t
     databaseBackend->openConnection(callbacks, databaseCallbacks, transactionId, version);
 }
 
+PassRefPtr<IDBTransactionBackendInterface> IDBFactoryBackendLevelDB::createTransactionBackend(IDBDatabaseBackendLevelDB* backend, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
+{
+    return IDBTransactionBackendLevelDB::create(backend, transactionId, databaseCallbacks, objectStoreIds, mode);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE) && USE(LEVELDB)
index ff09d3f..7a330a3 100644 (file)
@@ -58,10 +58,13 @@ public:
     // Notifications from weak pointers.
     virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier) OVERRIDE FINAL;
 
-    virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
-    virtual void open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
+    virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) OVERRIDE FINAL;
+    virtual void open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) OVERRIDE FINAL;
+
+    virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) OVERRIDE FINAL;
+
+    virtual PassRefPtr<IDBTransactionBackendInterface> createTransactionBackend(IDBDatabaseBackendLevelDB*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IndexedDB::TransactionMode) OVERRIDE FINAL;
 
-    virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
 
 protected:
     IDBFactoryBackendLevelDB();
index cdaf149..42405b1 100644 (file)
@@ -44,7 +44,7 @@
 
 namespace WebCore {
 
-bool IDBObjectStoreBackendLevelDB::IndexWriter::verifyIndexKeys(IDBBackingStoreLevelDB& backingStore, IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, bool& canAddKeys, const IDBKey* primaryKey, String* errorMessage) const
+bool IDBObjectStoreBackendLevelDB::IndexWriter::verifyIndexKeys(IDBBackingStoreInterface& backingStore, IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, bool& canAddKeys, const IDBKey* primaryKey, String* errorMessage) const
 {
     canAddKeys = false;
     for (size_t i = 0; i < m_indexKeys.size(); ++i) {
@@ -61,7 +61,7 @@ bool IDBObjectStoreBackendLevelDB::IndexWriter::verifyIndexKeys(IDBBackingStoreL
     return true;
 }
 
-void IDBObjectStoreBackendLevelDB::IndexWriter::writeIndexKeys(const IDBBackingStoreLevelDB::RecordIdentifier& recordIdentifier, IDBBackingStoreLevelDB& backingStore, IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId) const
+void IDBObjectStoreBackendLevelDB::IndexWriter::writeIndexKeys(const IDBBackingStoreLevelDB::RecordIdentifier& recordIdentifier, IDBBackingStoreInterface& backingStore, IDBBackingStoreInterface::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) {
@@ -71,7 +71,7 @@ void IDBObjectStoreBackendLevelDB::IndexWriter::writeIndexKeys(const IDBBackingS
     }
 }
 
-bool IDBObjectStoreBackendLevelDB::IndexWriter::addingKeyAllowed(IDBBackingStoreLevelDB& backingStore, IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey* indexKey, const IDBKey* primaryKey, bool& allowed) const
+bool IDBObjectStoreBackendLevelDB::IndexWriter::addingKeyAllowed(IDBBackingStoreInterface& backingStore, IDBBackingStoreInterface::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey* indexKey, const IDBKey* primaryKey, bool& allowed) const
 {
     allowed = false;
     if (!m_indexMetadata.unique) {
@@ -89,7 +89,7 @@ bool IDBObjectStoreBackendLevelDB::IndexWriter::addingKeyAllowed(IDBBackingStore
     return true;
 }
 
-bool IDBObjectStoreBackendLevelDB::makeIndexWriters(PassRefPtr<IDBTransactionBackendInterface> transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, const IDBObjectStoreMetadata& objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter>>* indexWriters, String* errorMessage, bool& completed)
+bool IDBObjectStoreBackendLevelDB::makeIndexWriters(PassRefPtr<IDBTransactionBackendInterface> transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, const IDBObjectStoreMetadata& objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter>>* indexWriters, String* errorMessage, bool& completed)
 {
     ASSERT(indexIds.size() == indexKeys.size());
     completed = false;
@@ -122,7 +122,7 @@ bool IDBObjectStoreBackendLevelDB::makeIndexWriters(PassRefPtr<IDBTransactionBac
     return true;
 }
 
-PassRefPtr<IDBKey> IDBObjectStoreBackendLevelDB::generateKey(PassRefPtr<IDBBackingStoreLevelDB> backingStore, PassRefPtr<IDBTransactionBackendLevelDB> transaction, int64_t databaseId, int64_t objectStoreId)
+PassRefPtr<IDBKey> IDBObjectStoreBackendLevelDB::generateKey(PassRefPtr<IDBBackingStoreInterface> backingStore, PassRefPtr<IDBTransactionBackendLevelDB> transaction, int64_t databaseId, int64_t objectStoreId)
 {
     const int64_t maxGeneratorValue = 9007199254740992LL; // Maximum integer storable as ECMAScript number.
     int64_t currentNumber;
@@ -137,7 +137,7 @@ PassRefPtr<IDBKey> IDBObjectStoreBackendLevelDB::generateKey(PassRefPtr<IDBBacki
     return IDBKey::createNumber(currentNumber);
 }
 
-bool IDBObjectStoreBackendLevelDB::updateKeyGenerator(PassRefPtr<IDBBackingStoreLevelDB> backingStore, PassRefPtr<IDBTransactionBackendLevelDB> transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey* key, bool checkCurrent)
+bool IDBObjectStoreBackendLevelDB::updateKeyGenerator(PassRefPtr<IDBBackingStoreInterface> backingStore, PassRefPtr<IDBTransactionBackendLevelDB> transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey* key, bool checkCurrent)
 {
     ASSERT(key && key->type() == IDBKey::NumberType);
     return backingStore->maybeUpdateKeyGeneratorCurrentNumber(transaction->backingStoreTransaction(), databaseId, objectStoreId, static_cast<int64_t>(floor(key->number())) + 1, checkCurrent);
index f95b5b4..2e82de0 100644 (file)
@@ -55,21 +55,21 @@ namespace IDBObjectStoreBackendLevelDB {
             , m_indexKeys(indexKeys)
         { }
 
-        bool verifyIndexKeys(IDBBackingStoreLevelDB&, IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, bool& canAddKeys, const IDBKey* primaryKey = 0, String* errorMessage = 0) const WARN_UNUSED_RETURN;
+        bool verifyIndexKeys(IDBBackingStoreInterface&, IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, bool& canAddKeys, const IDBKey* primaryKey = 0, String* errorMessage = 0) const WARN_UNUSED_RETURN;
 
-        void writeIndexKeys(const IDBBackingStoreLevelDB::RecordIdentifier&, IDBBackingStoreLevelDB&, IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) const;
+        void writeIndexKeys(const IDBBackingStoreLevelDB::RecordIdentifier&, IDBBackingStoreInterface&, IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId) const;
 
     private:
-        bool addingKeyAllowed(IDBBackingStoreLevelDB&, IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey* indexKey, const IDBKey* primaryKey, bool& allowed) const WARN_UNUSED_RETURN;
+        bool addingKeyAllowed(IDBBackingStoreInterface&, IDBBackingStoreInterface::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey* indexKey, const IDBKey* primaryKey, bool& allowed) const WARN_UNUSED_RETURN;
 
         const IDBIndexMetadata m_indexMetadata;
         IDBDatabaseBackendInterface::IndexKeys m_indexKeys;
     };
 
-    bool makeIndexWriters(PassRefPtr<IDBTransactionBackendInterface>, IDBBackingStoreLevelDB*, int64_t databaseId, const IDBObjectStoreMetadata&, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>&, Vector<OwnPtr<IndexWriter>>* indexWriters, String* errorMessage, bool& completed) WARN_UNUSED_RETURN;
+    bool makeIndexWriters(PassRefPtr<IDBTransactionBackendInterface>, IDBBackingStoreInterface*, int64_t databaseId, const IDBObjectStoreMetadata&, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>&, Vector<OwnPtr<IndexWriter>>* indexWriters, String* errorMessage, bool& completed) WARN_UNUSED_RETURN;
 
-    PassRefPtr<IDBKey> generateKey(PassRefPtr<IDBBackingStoreLevelDB>, PassRefPtr<IDBTransactionBackendLevelDB>, int64_t databaseId, int64_t objectStoreId);
-    bool updateKeyGenerator(PassRefPtr<IDBBackingStoreLevelDB>, PassRefPtr<IDBTransactionBackendLevelDB>, int64_t databaseId, int64_t objectStoreId, const IDBKey*, bool checkCurrent);
+    PassRefPtr<IDBKey> generateKey(PassRefPtr<IDBBackingStoreInterface>, PassRefPtr<IDBTransactionBackendLevelDB>, int64_t databaseId, int64_t objectStoreId);
+    bool updateKeyGenerator(PassRefPtr<IDBBackingStoreInterface>, PassRefPtr<IDBTransactionBackendLevelDB>, int64_t databaseId, int64_t objectStoreId, const IDBKey*, bool checkCurrent);
 };
 
 } // namespace WebCore
index a3a3bcf..e4ea4c8 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBTransactionBackendLevelDB> IDBTransactionBackendLevelDB::create(IDBBackingStoreLevelDB* backingStore, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode, IDBDatabaseBackendLevelDB* database)
+PassRefPtr<IDBTransactionBackendLevelDB> IDBTransactionBackendLevelDB::create(IDBDatabaseBackendLevelDB* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
 {
     HashSet<int64_t> objectStoreHashSet;
     for (size_t i = 0; i < objectStoreIds.size(); ++i)
         objectStoreHashSet.add(objectStoreIds[i]);
 
-    return adoptRef(new IDBTransactionBackendLevelDB(backingStore, id, callbacks, objectStoreHashSet, mode, database));
+    return adoptRef(new IDBTransactionBackendLevelDB(databaseBackend, id, callbacks, objectStoreHashSet, mode));
 }
 
-IDBTransactionBackendLevelDB::IDBTransactionBackendLevelDB(IDBBackingStoreLevelDB* backingStore, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode, IDBDatabaseBackendLevelDB* database)
+IDBTransactionBackendLevelDB::IDBTransactionBackendLevelDB(IDBDatabaseBackendLevelDB* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
     : IDBTransactionBackendInterface(id)
     , m_objectStoreIds(objectStoreIds)
     , m_mode(mode)
     , m_state(Unused)
     , m_commitPending(false)
     , m_callbacks(callbacks)
-    , m_database(database)
-    , m_transaction(database->backingStore().get())
+    , m_database(databaseBackend)
+    , m_transaction(databaseBackend->backingStore())
     , m_taskTimer(this, &IDBTransactionBackendLevelDB::taskTimerFired)
     , m_pendingPreemptiveEvents(0)
-    , m_backingStore(backingStore)
+    , m_backingStore(databaseBackend->backingStore())
 {
     // We pass a reference of this object before it can be adopted.
     relaxAdoptionRequirement();
index a3f6c1d..5539d85 100644 (file)
@@ -46,7 +46,7 @@ class IDBDatabaseCallbacks;
 
 class IDBTransactionBackendLevelDB : public IDBTransactionBackendInterface {
 public:
-    static PassRefPtr<IDBTransactionBackendLevelDB> create(IDBBackingStoreLevelDB*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IndexedDB::TransactionMode, IDBDatabaseBackendLevelDB*);
+    static PassRefPtr<IDBTransactionBackendLevelDB> create(IDBDatabaseBackendLevelDB*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
     virtual ~IDBTransactionBackendLevelDB();
 
     virtual void commit() OVERRIDE FINAL;
@@ -86,7 +86,7 @@ public:
     virtual void scheduleClearOperation(int64_t objectStoreId, PassRefPtr<IDBCallbacks>) OVERRIDE FINAL;
     
 private:
-    IDBTransactionBackendLevelDB(IDBBackingStoreLevelDB*, int64_t id, PassRefPtr<IDBDatabaseCallbacks>, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode, IDBDatabaseBackendLevelDB*);
+    IDBTransactionBackendLevelDB(IDBDatabaseBackendLevelDB*, int64_t id, PassRefPtr<IDBDatabaseCallbacks>, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
 
     enum State {
         Unused, // Created, but no tasks yet.
@@ -124,7 +124,7 @@ private:
 
     HashSet<IDBCursorBackendLevelDB*> m_openCursors;
     
-    RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    RefPtr<IDBBackingStoreInterface> m_backingStore;
 };
 
 } // namespace WebCore
index 9e8de06..6e1440e 100644 (file)
@@ -87,7 +87,7 @@ void GetOperation::perform()
     if (m_keyRange->isOnlyKey())
         key = m_keyRange->lower();
     else {
-        RefPtr<IDBBackingStoreLevelDB::Cursor> backingStoreCursor;
+        RefPtr<IDBBackingStoreInterface::Cursor> backingStoreCursor;
         if (m_indexId == IDBIndexMetadata::InvalidId) {
             ASSERT(m_cursorType != IndexedDB::CursorKeyOnly);
             // ObjectStore Retrieval Operation
@@ -261,7 +261,7 @@ void OpenCursorOperation::perform()
     if (m_taskType == IDBDatabaseBackendInterface::PreemptiveTask)
         m_transaction->addPreemptiveEvent();
 
-    RefPtr<IDBBackingStoreLevelDB::Cursor> backingStoreCursor;
+    RefPtr<IDBBackingStoreInterface::Cursor> backingStoreCursor;
     if (m_indexId == IDBIndexMetadata::InvalidId) {
         ASSERT(m_cursorType != IndexedDB::CursorKeyOnly);
         backingStoreCursor = m_backingStore->openObjectStoreCursor(m_transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, m_keyRange.get(), m_direction);
@@ -287,7 +287,7 @@ void CountOperation::perform()
 {
     LOG(StorageAPI, "CountOperation");
     uint32_t count = 0;
-    RefPtr<IDBBackingStoreLevelDB::Cursor> backingStoreCursor;
+    RefPtr<IDBBackingStoreInterface::Cursor> backingStoreCursor;
 
     if (m_indexId == IDBIndexMetadata::InvalidId)
         backingStoreCursor = m_backingStore->openObjectStoreKeyCursor(m_transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, m_keyRange.get(), IndexedDB::CursorNext);
@@ -308,7 +308,7 @@ void CountOperation::perform()
 void DeleteRangeOperation::perform()
 {
     LOG(StorageAPI, "DeleteRangeOperation");
-    RefPtr<IDBBackingStoreLevelDB::Cursor> backingStoreCursor = m_backingStore->openObjectStoreCursor(m_transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, m_keyRange.get(), IndexedDB::CursorNext);
+    RefPtr<IDBBackingStoreInterface::Cursor> backingStoreCursor = m_backingStore->openObjectStoreCursor(m_transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, m_keyRange.get(), IndexedDB::CursorNext);
     if (backingStoreCursor) {
         do {
             if (!m_backingStore->deleteRecord(m_transaction->backingStoreTransaction(), m_databaseId, m_objectStoreId, backingStoreCursor->recordIdentifier())) {
index faa7df8..c6b30a9 100644 (file)
@@ -34,13 +34,13 @@ namespace WebCore {
 
 class CreateObjectStoreOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
     {
         return adoptPtr(new CreateObjectStoreOperation(transaction, backingStore, objectStoreMetadata));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    CreateObjectStoreOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
+    CreateObjectStoreOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_objectStoreMetadata(objectStoreMetadata)
@@ -48,19 +48,19 @@ private:
     }
     
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const IDBObjectStoreMetadata m_objectStoreMetadata;
 };
 
 class DeleteObjectStoreOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
     {
         return adoptPtr(new DeleteObjectStoreOperation(transaction, backingStore, objectStoreMetadata));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    DeleteObjectStoreOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
+    DeleteObjectStoreOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, const IDBObjectStoreMetadata& objectStoreMetadata)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_objectStoreMetadata(objectStoreMetadata)
@@ -68,7 +68,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const IDBObjectStoreMetadata m_objectStoreMetadata;
 };
 
@@ -154,13 +154,13 @@ private:
 
 class CreateIndexOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
     {
         return adoptPtr(new CreateIndexOperation(transaction, backingStore, objectStoreId, indexMetadata));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    CreateIndexOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    CreateIndexOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_objectStoreId(objectStoreId)
@@ -169,7 +169,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_objectStoreId;
     const IDBIndexMetadata m_indexMetadata;
 };
@@ -196,13 +196,13 @@ private:
 
 class DeleteIndexOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
     {
         return adoptPtr(new DeleteIndexOperation(transaction, backingStore, objectStoreId, indexMetadata));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    DeleteIndexOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    DeleteIndexOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_objectStoreId(objectStoreId)
@@ -211,7 +211,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_objectStoreId;
     const IDBIndexMetadata m_indexMetadata;
 };
@@ -238,13 +238,13 @@ private:
 
 class GetOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
     {
         return adoptPtr(new GetOperation(transaction, backingStore, metadata, objectStoreId, indexId, keyRange, cursorType, callbacks));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    GetOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
+    GetOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_databaseId(metadata.id)
@@ -261,7 +261,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_databaseId;
     const int64_t m_objectStoreId;
     const int64_t m_indexId;
@@ -274,13 +274,13 @@ private:
 
 class PutOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, IDBDatabaseBackendInterface::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>& indexKeys)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, IDBDatabaseBackendInterface::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>& indexKeys)
     {
         return adoptPtr(new PutOperation(transaction, backingStore, databaseId, objectStore, value, key, putMode, callbacks, indexIds, indexKeys));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    PutOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer>& value, PassRefPtr<IDBKey> key, IDBDatabaseBackendInterface::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>& indexKeys)
+    PutOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer>& value, PassRefPtr<IDBKey> key, IDBDatabaseBackendInterface::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IDBDatabaseBackendInterface::IndexKeys>& indexKeys)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_databaseId(databaseId)
@@ -295,7 +295,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_databaseId;
     const IDBObjectStoreMetadata m_objectStore;
     const RefPtr<SharedBuffer> m_value;
@@ -326,13 +326,13 @@ private:
 
 class OpenCursorOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
     {
         return adoptPtr(new OpenCursorOperation(transaction, backingStore, databaseId, objectStoreId, indexId, keyRange, direction, cursorType, taskType, callbacks));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    OpenCursorOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
+    OpenCursorOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_databaseId(databaseId)
@@ -347,7 +347,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_databaseId;
     const int64_t m_objectStoreId;
     const int64_t m_indexId;
@@ -360,13 +360,13 @@ private:
 
 class CountOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     {
         return adoptPtr(new CountOperation(transaction, backingStore, databaseId, objectStoreId, indexId, keyRange, callbacks));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    CountOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+    CountOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_databaseId(databaseId)
@@ -378,7 +378,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_databaseId;
     const int64_t m_objectStoreId;
     const int64_t m_indexId;
@@ -388,13 +388,13 @@ private:
 
 class DeleteRangeOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     {
         return adoptPtr(new DeleteRangeOperation(transaction, backingStore, databaseId, objectStoreId, keyRange, callbacks));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    DeleteRangeOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+    DeleteRangeOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_databaseId(databaseId)
@@ -405,7 +405,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_databaseId;
     const int64_t m_objectStoreId;
     const RefPtr<IDBKeyRange> m_keyRange;
@@ -414,13 +414,13 @@ private:
 
 class ClearOperation : public IDBTransactionBackendLevelDB::Operation {
 public:
-    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
+    static PassOwnPtr<IDBTransactionBackendLevelDB::Operation> create(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
     {
         return adoptPtr(new ClearOperation(transaction, backingStore, databaseId, objectStoreId, callbacks));
     }
     virtual void perform() OVERRIDE FINAL;
 private:
-    ClearOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreLevelDB* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
+    ClearOperation(IDBTransactionBackendLevelDB* transaction, IDBBackingStoreInterface* backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
         : m_transaction(transaction)
         , m_backingStore(backingStore)
         , m_databaseId(databaseId)
@@ -430,7 +430,7 @@ private:
     }
 
     RefPtr<IDBTransactionBackendLevelDB> m_transaction;
-    const RefPtr<IDBBackingStoreLevelDB> m_backingStore;
+    const RefPtr<IDBBackingStoreInterface> m_backingStore;
     const int64_t m_databaseId;
     const int64_t m_objectStoreId;
     const RefPtr<IDBCallbacks> m_callbacks;
index bab3be2..3b79801 100644 (file)
                51D719DE181106E00016DC51 /* IDBKeyPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71994181106E00016DC51 /* IDBKeyPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51D719DF181106E00016DC51 /* IDBKeyRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71995181106E00016DC51 /* IDBKeyRange.cpp */; };
                51D719E0181106E00016DC51 /* IDBKeyRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71996181106E00016DC51 /* IDBKeyRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               51D719E2181106E00016DC51 /* IDBMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71998181106E00016DC51 /* IDBMetadata.h */; };
+               51D719E2181106E00016DC51 /* IDBMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71998181106E00016DC51 /* IDBMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51D719E3181106E00016DC51 /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71999181106E00016DC51 /* IDBObjectStore.cpp */; };
                51D719E4181106E00016DC51 /* IDBObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7199A181106E00016DC51 /* IDBObjectStore.h */; };
                51D719E6181106E00016DC51 /* IDBOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7199C181106E00016DC51 /* IDBOpenDBRequest.cpp */; };
                51E1ECC10C91C90400DC255B /* IconRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E1ECBB0C91C90400DC255B /* IconRecord.h */; };
                51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E1ECBC0C91C90400DC255B /* PageURLRecord.cpp */; };
                51E1ECC30C91C90400DC255B /* PageURLRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E1ECBD0C91C90400DC255B /* PageURLRecord.h */; };
-               51E337F418125AE30007A246 /* IDBBackingStoreInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E337F318125AE30007A246 /* IDBBackingStoreInterface.h */; };
+               51E337F418125AE30007A246 /* IDBBackingStoreInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E337F318125AE30007A246 /* IDBBackingStoreInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51E3F9C70DA059DC00250911 /* Storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3F9C50DA059DC00250911 /* Storage.cpp */; };
                51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3F9D40DA05E1D00250911 /* JSStorage.cpp */; };
                51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4143216A6595100C633C7 /* ResourceHandleTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51E6821016387302003BBF3C /* LoaderStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E6820F16387302003BBF3C /* LoaderStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */; };
-               51F6E0A31811D2520058A00A /* IDBTransactionBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F6E08F1811D2520058A00A /* IDBTransactionBackendInterface.h */; };
+               51F6E0A31811D2520058A00A /* IDBTransactionBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F6E08F1811D2520058A00A /* IDBTransactionBackendInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 517FBA18151AA71B00B57959 /* DOMWindowExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51FB5504113E3E9100821176 /* JSCloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB5502113E3E9100821176 /* JSCloseEvent.h */; };
                51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */; };
index 31d16df..40db9d2 100644 (file)
@@ -1,3 +1,15 @@
+2013-10-21  Brady Eidson  <beidson@apple.com>
+
+        Transition most use of IDBBackingStoreLevelDB to IDBBackingStoreInterface
+        https://bugs.webkit.org/show_bug.cgi?id=123105
+
+        Reviewed by Anders Carlsson.
+
+        Stub out a new pure virtual method:
+        * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
+        (WebKit::WebIDBFactoryBackend::createTransactionBackend):
+        * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:
+
 2013-10-21  Tim Horton  <timothy_horton@apple.com>
 
         Remote Layer Tree: Backing store should take contentsScale into account
index 54f63db..137cacc 100644 (file)
@@ -34,6 +34,7 @@
 #include "WebToDatabaseProcessConnection.h"
 #include <WebCore/IDBCallbacks.h>
 #include <WebCore/IDBDatabaseCallbacks.h>
+#include <WebCore/IDBTransactionBackendInterface.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/SecurityOrigin.h>
 #include <wtf/MainThread.h>
@@ -99,6 +100,12 @@ void WebIDBFactoryBackend::removeIDBDatabaseBackend(const String&)
     notImplemented();
 }
 
+PassRefPtr<IDBTransactionBackendInterface> WebIDBFactoryBackend::createTransactionBackend(IDBDatabaseBackendLevelDB*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IndexedDB::TransactionMode)
+{
+    notImplemented();
+    return 0;
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(DATABASE_PROCESS)
index 1b2eda9..7e252c8 100644 (file)
@@ -45,6 +45,8 @@ public:
 
     virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier) OVERRIDE FINAL;
 
+    virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> createTransactionBackend(WebCore::IDBDatabaseBackendLevelDB*, int64_t transactionId, PassRefPtr<WebCore::IDBDatabaseCallbacks>, const Vector<int64_t>&, WebCore::IndexedDB::TransactionMode);
+
 private:
     WebIDBFactoryBackend();
 };