IndexedDB: Stub out transaction-backend methods
authoralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 18:52:18 +0000 (18:52 +0000)
committeralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 18:52:18 +0000 (18:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103921

Reviewed by Dimitri Glazkov.

Source/WebCore:

In preparation for a refactoring. Legacy methods
will be removed in https://bugs.webkit.org/show_bug.cgi?id=103923.

No new tests, just adding unused methods for refactoring.

* Modules/indexeddb/IDBCallbacks.h:
(WebCore::IDBCallbacks::onUpgradeNeeded):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::onAbort):
(WebCore):
(WebCore::IDBDatabase::onComplete):
* Modules/indexeddb/IDBDatabase.h:
(IDBDatabase):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::createTransaction):
(WebCore):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
(WebCore::IDBDatabaseBackendImpl::commit):
(WebCore::IDBDatabaseBackendImpl::abort):
* Modules/indexeddb/IDBDatabaseBackendInterface.h:
(IDBDatabaseBackendInterface):
* Modules/indexeddb/IDBDatabaseCallbacks.h:
(IDBDatabaseCallbacks):
* Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
(WebCore::IDBDatabaseCallbacksImpl::onAbort):
(WebCore):
(WebCore::IDBDatabaseCallbacksImpl::onComplete):
* Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
(IDBDatabaseCallbacksImpl):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::open):
* Modules/indexeddb/IDBFactoryBackendImpl.h:
(WebCore::IDBFactoryBackendImpl::open):
(IDBFactoryBackendImpl):
* Modules/indexeddb/IDBFactoryBackendInterface.h:
(IDBFactoryBackendInterface):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore):
* Modules/indexeddb/IDBOpenDBRequest.h:
(IDBOpenDBRequest):
* Modules/indexeddb/IDBTransactionBackendInterface.h:
(WebCore):
* Modules/indexeddb/IDBTransactionCoordinator.h:

Source/WebKit/chromium:

Add new signatures for refactoring, to allow
transaction_ids to make is through the open/onUpgradeNeeded
loop.

* public/WebIDBCallbacks.h:
(WebKit::WebIDBCallbacks::onUpgradeNeeded):
* public/WebIDBDatabase.h:
(WebKit::WebIDBDatabase::createTransaction):
(WebKit::WebIDBDatabase::abort):
(WebKit::WebIDBDatabase::commit):
(WebIDBDatabase):
* public/WebIDBDatabaseCallbacks.h:
(WebIDBDatabaseCallbacks):
(WebKit::WebIDBDatabaseCallbacks::onAbort):
(WebKit::WebIDBDatabaseCallbacks::onComplete):
* public/WebIDBFactory.h:
(WebKit::WebIDBFactory::open):
* src/IDBCallbacksProxy.cpp:
(WebKit::IDBCallbacksProxy::onUpgradeNeeded):
(WebKit):
* src/IDBCallbacksProxy.h:
(IDBCallbacksProxy):
* src/IDBDatabaseBackendProxy.cpp:
(WebKit::IDBDatabaseBackendProxy::createTransaction):
(WebKit):
(WebKit::IDBDatabaseBackendProxy::commit):
(WebKit::IDBDatabaseBackendProxy::abort):
* src/IDBDatabaseBackendProxy.h:
(IDBDatabaseBackendProxy):
* src/IDBDatabaseCallbacksProxy.cpp:
(WebKit::IDBDatabaseCallbacksProxy::onAbort):
(WebKit):
(WebKit::IDBDatabaseCallbacksProxy::onComplete):
* src/IDBDatabaseCallbacksProxy.h:
(IDBDatabaseCallbacksProxy):
* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::open):
(WebKit):
* src/IDBFactoryBackendProxy.h:
(IDBFactoryBackendProxy):
* src/WebIDBCallbacksImpl.cpp:
(WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
(WebKit):
* src/WebIDBCallbacksImpl.h:
(WebIDBCallbacksImpl):
* src/WebIDBDatabaseCallbacksImpl.cpp:
(WebKit::WebIDBDatabaseCallbacksImpl::onAbort):
(WebKit):
(WebKit::WebIDBDatabaseCallbacksImpl::onComplete):
* src/WebIDBDatabaseCallbacksImpl.h:
(WebIDBDatabaseCallbacksImpl):
* src/WebIDBDatabaseImpl.cpp:
(WebKit::WebIDBDatabaseImpl::createTransaction):
(WebKit):
(WebKit::WebIDBDatabaseImpl::abort):
(WebKit::WebIDBDatabaseImpl::commit):
* src/WebIDBDatabaseImpl.h:
(WebIDBDatabaseImpl):
* src/WebIDBFactoryImpl.cpp:
(WebKit::WebIDBFactoryImpl::open):
(WebKit):
* src/WebIDBFactoryImpl.h:
(WebIDBFactoryImpl):
* tests/IDBAbortOnCorruptTest.cpp:
* tests/IDBDatabaseBackendTest.cpp:

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

35 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebIDBDatabase.h
Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h
Source/WebKit/chromium/public/WebIDBFactory.h
Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp
Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h
Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp
Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h
Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
Source/WebKit/chromium/src/WebIDBFactoryImpl.h
Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp

index 77cba8f..0ba243c 100644 (file)
@@ -1,3 +1,70 @@
+2012-12-05  Alec Flett  <alecflett@chromium.org>
+
+        IndexedDB: Stub out transaction-backend methods
+        https://bugs.webkit.org/show_bug.cgi?id=103921
+
+        Reviewed by Dimitri Glazkov.
+
+        In preparation for a refactoring. Legacy methods 
+        will be removed in https://bugs.webkit.org/show_bug.cgi?id=103923.
+
+        No new tests, just adding unused methods for refactoring.
+
+        * Modules/indexeddb/IDBCallbacks.h:
+        (WebCore::IDBCallbacks::onUpgradeNeeded):
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::onAbort):
+        (WebCore):
+        (WebCore::IDBDatabase::onComplete):
+        * Modules/indexeddb/IDBDatabase.h:
+        (IDBDatabase):
+        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+        (WebCore::IDBDatabaseBackendImpl::createTransaction):
+        (WebCore):
+        * Modules/indexeddb/IDBDatabaseBackendImpl.h:
+        (IDBDatabaseBackendImpl):
+        (WebCore::IDBDatabaseBackendImpl::commit):
+        (WebCore::IDBDatabaseBackendImpl::abort):
+        * Modules/indexeddb/IDBDatabaseBackendInterface.h:
+        (IDBDatabaseBackendInterface):
+        * Modules/indexeddb/IDBDatabaseCallbacks.h:
+        (IDBDatabaseCallbacks):
+        * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
+        (WebCore::IDBDatabaseCallbacksImpl::onAbort):
+        (WebCore):
+        (WebCore::IDBDatabaseCallbacksImpl::onComplete):
+        * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
+        (IDBDatabaseCallbacksImpl):
+        * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
+        (WebCore::IDBFactoryBackendImpl::open):
+        * Modules/indexeddb/IDBFactoryBackendImpl.h:
+        (WebCore::IDBFactoryBackendImpl::open):
+        (IDBFactoryBackendImpl):
+        * Modules/indexeddb/IDBFactoryBackendInterface.h:
+        (IDBFactoryBackendInterface):
+        * Modules/indexeddb/IDBOpenDBRequest.cpp:
+        (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
+        (WebCore):
+        * Modules/indexeddb/IDBOpenDBRequest.h:
+        (IDBOpenDBRequest):
+        * Modules/indexeddb/IDBTransactionBackendInterface.h:
+        (WebCore):
+        * Modules/indexeddb/IDBTransactionCoordinator.h:
+
+2012-11-27  Alec Flett  <alecflett@chromium.org>
+
+        IndexedDB: remove IDBDatabaseBackendInterface::transaction()
+        https://bugs.webkit.org/show_bug.cgi?id=102733
+
+        Reviewed by Darin Fisher.
+
+        Part 3 of a refactor, remove the old transaction() method.
+
+        No new tests as this is just post-refactor cleanup.
+
+        * Modules/indexeddb/IDBDatabaseBackendInterface.h:
+        (IDBDatabaseBackendInterface):
+
 2012-12-05  Robert Hogan  <robert@webkit.org>
 
         REGRESSION(r126683): Table cell are getting borders when the style doesn't mention any
index 49e50b4..e41e8fc 100644 (file)
@@ -109,6 +109,16 @@ void IDBDatabase::transactionFinished(IDBTransaction* transaction)
         closeConnection();
 }
 
+void IDBDatabase::onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
+{
+    ASSERT_NOT_REACHED();
+}
+
+void IDBDatabase::onComplete(int64_t transactionId)
+{
+    ASSERT_NOT_REACHED();
+}
+
 PassRefPtr<DOMStringList> IDBDatabase::objectStoreNames() const
 {
     RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
index 9a27f25..20bcaaa 100644 (file)
@@ -78,6 +78,8 @@ public:
     // IDBDatabaseCallbacks
     virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
     virtual void onVersionChange(const String& requestedVersion);
+    virtual void onAbort(int64_t, PassRefPtr<IDBDatabaseError>);
+    virtual void onComplete(int64_t);
 
     // ActiveDOMObject
     virtual void stop() OVERRIDE;
index dc2ee5f..7ab618b 100644 (file)
@@ -432,6 +432,7 @@ void IDBDatabaseBackendImpl::processPendingCalls()
     }
 }
 
+// FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
 PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, unsigned short mode)
 {
     RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::create(transactionId, objectStoreIds, mode, this);
@@ -439,6 +440,11 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::createTransac
     return transaction.release();
 }
 
+void IDBDatabaseBackendImpl::createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
+{
+    ASSERT_NOT_REACHED();
+}
+
 void IDBDatabaseBackendImpl::openConnection(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
 {
     ASSERT(m_backingStore.get());
index df0ba2d..29e4e53 100644 (file)
@@ -63,9 +63,14 @@ public:
     virtual IDBDatabaseMetadata metadata() const;
     virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(int64_t id, const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&);
     virtual void deleteObjectStore(int64_t, IDBTransactionBackendInterface*, ExceptionCode&);
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, unsigned short mode);
+    virtual void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode);
     virtual void close(PassRefPtr<IDBDatabaseCallbacks>);
 
+    virtual void commit(int64_t transactionId) { ASSERT_NOT_REACHED(); }
+    virtual void abort(int64_t transactionId) { ASSERT_NOT_REACHED(); }
+
     PassRefPtr<IDBObjectStoreBackendImpl> objectStore(int64_t id);
     IDBTransactionCoordinator* transactionCoordinator() const { return m_transactionCoordinator.get(); }
     void transactionStarted(PassRefPtr<IDBTransactionBackendImpl>);
index 1095318..a6a2af7 100644 (file)
@@ -55,8 +55,14 @@ public:
 
     virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
     virtual void deleteObjectStore(int64_t, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, unsigned short mode) = 0;
+    virtual void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode) = 0;
     virtual void close(PassRefPtr<IDBDatabaseCallbacks>) = 0;
+
+    // Transaction-specific operations.
+    virtual void commit(int64_t transactionId) = 0;
+    virtual void abort(int64_t transactionId) = 0;
 };
 
 } // namespace WebCore
index 841ec0f..aa734f8 100644 (file)
@@ -41,6 +41,9 @@ public:
     virtual void onForcedClose() = 0;
     virtual void onVersionChange(const String& version) = 0;
     virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) = 0;
+
+    virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) = 0;
+    virtual void onComplete(int64_t transactionId) = 0;
 };
 
 } // namespace WebCore
index 970d3a1..411af3c 100644 (file)
@@ -71,6 +71,18 @@ void IDBDatabaseCallbacksImpl::connect(IDBDatabase* database)
     m_database = database;
 }
 
+void IDBDatabaseCallbacksImpl::onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
+{
+    if (m_database)
+        m_database->onAbort(transactionId, error);
+}
+
+void IDBDatabaseCallbacksImpl::onComplete(int64_t transactionId)
+{
+    if (m_database)
+        m_database->onComplete(transactionId);
+}
+
 } // namespace WebCore
 
 #endif
index bb4a1ae..3c14f8a 100644 (file)
@@ -46,6 +46,9 @@ public:
     virtual void onVersionChange(const String& version);
     virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
 
+    virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>);
+    virtual void onComplete(int64_t transactionId);
+
     void connect(IDBDatabase*);
 
 private:
index c14c68c..1346194 100644 (file)
@@ -127,7 +127,9 @@ PassRefPtr<IDBOpenDBRequest> IDBFactory::openInternal(ScriptExecutionContext* co
         return 0;
 
     RefPtr<IDBDatabaseCallbacksImpl> databaseCallbacks = IDBDatabaseCallbacksImpl::create();
-    RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, IDBAny::createNull(), databaseCallbacks, version);
+    int64 transactionId = IDBDatabase::nextTransactionId();
+    RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, IDBAny::createNull(), databaseCallbacks, transactionId, version);
+    // FIXME: pass the transactionId in here in https://bugs.webkit.org/show_bug.cgi?id=103922
     m_backend->open(name, version, request, databaseCallbacks, context->securityOrigin(), context, getIndexedDBDatabasePath(context));
     return request;
 }
index 4738e35..be04739 100644 (file)
@@ -141,7 +141,7 @@ PassRefPtr<IDBBackingStore> IDBFactoryBackendImpl::openBackingStore(PassRefPtr<S
     return 0;
 }
 
-void IDBFactoryBackendImpl::open(const String& name, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, PassRefPtr<SecurityOrigin> prpSecurityOrigin, ScriptExecutionContext*, const String& dataDirectory)
+void IDBFactoryBackendImpl::open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, PassRefPtr<SecurityOrigin> prpSecurityOrigin, ScriptExecutionContext*, const String& dataDirectory)
 {
     RefPtr<SecurityOrigin> securityOrigin = prpSecurityOrigin;
     const String uniqueIdentifier = computeUniqueIdentifier(name, securityOrigin.get());
index 7a020fb..3c11cd3 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef IDBFactoryBackendImpl_h
 #define IDBFactoryBackendImpl_h
 
+#include "IDBCallbacks.h"
+#include "IDBDatabaseCallbacks.h"
 #include "IDBFactoryBackendInterface.h"
 #include "SecurityOrigin.h"
 #include <wtf/HashMap.h>
@@ -56,7 +58,13 @@ public:
     virtual void removeIDBBackingStore(const String& fileIdentifier);
 
     virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
-    virtual void open(const String& name, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
+    virtual void open(const String& name, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
+    {
+        return open(name, version, 0, callbacks, databaseCallbacks, securityOrigin, context, 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 deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
 
 protected:
index 83a2857..a9fd3a6 100644 (file)
@@ -54,7 +54,9 @@ public:
     virtual ~IDBFactoryBackendInterface() { }
 
     virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual void open(const String& name, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
+    virtual void open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
     virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
 };
 
index 7b6f8c6..125c31b 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBOpenDBRequest> IDBOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl> callbacks, int64_t version)
+PassRefPtr<IDBOpenDBRequest> IDBOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl> callbacks, int64_t transactionId, int64_t version)
 {
-    RefPtr<IDBOpenDBRequest> request(adoptRef(new IDBOpenDBRequest(context, source, callbacks, version)));
+    RefPtr<IDBOpenDBRequest> request(adoptRef(new IDBOpenDBRequest(context, source, callbacks, transactionId, version)));
     request->suspendIfNeeded();
     return request.release();
 }
 
-IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl> callbacks, int64_t version)
+IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl> callbacks, int64_t transactionId, int64_t version)
     : IDBRequest(context, source, IDBTransactionBackendInterface::NormalTask, 0)
     , m_databaseCallbacks(callbacks)
+    , m_transactionId(transactionId)
     , m_version(version)
 {
     ASSERT(!m_result);
@@ -100,8 +101,7 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassRefPtr<IDBTransac
     }
     metadata.intVersion = oldVersion;
 
-    int64_t transactionId = IDBDatabase::nextTransactionId();
-    RefPtr<IDBTransaction> frontend = IDBTransaction::create(scriptExecutionContext(), transactionId, transactionBackend, idbDatabase.get(), this, metadata);
+    RefPtr<IDBTransaction> frontend = IDBTransaction::create(scriptExecutionContext(), m_transactionId, transactionBackend, idbDatabase.get(), this, metadata);
     transactionBackend->setCallbacks(frontend.get());
     m_transaction = frontend;
     m_result = IDBAny::create(idbDatabase.release());
index a551426..6d5f909 100644 (file)
@@ -36,7 +36,7 @@ class IDBDatabaseCallbacksImpl;
 
 class IDBOpenDBRequest : public IDBRequest {
 public:
-    static PassRefPtr<IDBOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl>, int64_t version);
+    static PassRefPtr<IDBOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl>, int64_t transactionId, int64_t version);
     virtual ~IDBOpenDBRequest();
 
     using IDBRequest::onSuccess;
@@ -56,9 +56,10 @@ protected:
     virtual bool shouldEnqueueEvent() const OVERRIDE;
 
 private:
-    IDBOpenDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl>, int64_t version);
+    IDBOpenDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, PassRefPtr<IDBDatabaseCallbacksImpl>, int64_t transactionId, int64_t version);
 
     RefPtr<IDBDatabaseCallbacksImpl> m_databaseCallbacks;
+    const int64_t m_transactionId;
     int64_t m_version;
 };
 
index 7a85c92..ac53553 100644 (file)
@@ -41,7 +41,6 @@ class IDBTransactionCallbacks;
 
 typedef int ExceptionCode;
 
-// This class is shared by IDBTransaction (async) and IDBTransactionSync (sync).
 // This is implemented by IDBTransactionBackendImpl and optionally others (in order to proxy
 // calls across process barriers). All calls to these classes should be non-blocking and
 // trigger work on a background thread if necessary.
index 8299853..60906fe 100644 (file)
@@ -28,7 +28,6 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "IDBTransactionBackendInterface.h"
 #include <wtf/HashMap.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/RefPtr.h>
index b907322..638d02a 100644 (file)
@@ -1,3 +1,95 @@
+2012-12-05  Alec Flett  <alecflett@chromium.org>
+
+        IndexedDB: Stub out transaction-backend methods
+        https://bugs.webkit.org/show_bug.cgi?id=103921
+
+        Reviewed by Dimitri Glazkov.
+
+        Add new signatures for refactoring, to allow
+        transaction_ids to make is through the open/onUpgradeNeeded
+        loop.
+
+        * public/WebIDBCallbacks.h:
+        (WebKit::WebIDBCallbacks::onUpgradeNeeded):
+        * public/WebIDBDatabase.h:
+        (WebKit::WebIDBDatabase::createTransaction):
+        (WebKit::WebIDBDatabase::abort):
+        (WebKit::WebIDBDatabase::commit):
+        (WebIDBDatabase):
+        * public/WebIDBDatabaseCallbacks.h:
+        (WebIDBDatabaseCallbacks):
+        (WebKit::WebIDBDatabaseCallbacks::onAbort):
+        (WebKit::WebIDBDatabaseCallbacks::onComplete):
+        * public/WebIDBFactory.h:
+        (WebKit::WebIDBFactory::open):
+        * src/IDBCallbacksProxy.cpp:
+        (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
+        (WebKit):
+        * src/IDBCallbacksProxy.h:
+        (IDBCallbacksProxy):
+        * src/IDBDatabaseBackendProxy.cpp:
+        (WebKit::IDBDatabaseBackendProxy::createTransaction):
+        (WebKit):
+        (WebKit::IDBDatabaseBackendProxy::commit):
+        (WebKit::IDBDatabaseBackendProxy::abort):
+        * src/IDBDatabaseBackendProxy.h:
+        (IDBDatabaseBackendProxy):
+        * src/IDBDatabaseCallbacksProxy.cpp:
+        (WebKit::IDBDatabaseCallbacksProxy::onAbort):
+        (WebKit):
+        (WebKit::IDBDatabaseCallbacksProxy::onComplete):
+        * src/IDBDatabaseCallbacksProxy.h:
+        (IDBDatabaseCallbacksProxy):
+        * src/IDBFactoryBackendProxy.cpp:
+        (WebKit::IDBFactoryBackendProxy::open):
+        (WebKit):
+        * src/IDBFactoryBackendProxy.h:
+        (IDBFactoryBackendProxy):
+        * src/WebIDBCallbacksImpl.cpp:
+        (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
+        (WebKit):
+        * src/WebIDBCallbacksImpl.h:
+        (WebIDBCallbacksImpl):
+        * src/WebIDBDatabaseCallbacksImpl.cpp:
+        (WebKit::WebIDBDatabaseCallbacksImpl::onAbort):
+        (WebKit):
+        (WebKit::WebIDBDatabaseCallbacksImpl::onComplete):
+        * src/WebIDBDatabaseCallbacksImpl.h:
+        (WebIDBDatabaseCallbacksImpl):
+        * src/WebIDBDatabaseImpl.cpp:
+        (WebKit::WebIDBDatabaseImpl::createTransaction):
+        (WebKit):
+        (WebKit::WebIDBDatabaseImpl::abort):
+        (WebKit::WebIDBDatabaseImpl::commit):
+        * src/WebIDBDatabaseImpl.h:
+        (WebIDBDatabaseImpl):
+        * src/WebIDBFactoryImpl.cpp:
+        (WebKit::WebIDBFactoryImpl::open):
+        (WebKit):
+        * src/WebIDBFactoryImpl.h:
+        (WebIDBFactoryImpl):
+        * tests/IDBAbortOnCorruptTest.cpp:
+        * tests/IDBDatabaseBackendTest.cpp:
+
+2012-11-27  Alec Flett  <alecflett@chromium.org>
+
+        IndexedDB: remove IDBDatabaseBackendInterface::transaction()
+        https://bugs.webkit.org/show_bug.cgi?id=102733
+
+        Reviewed by Darin Fisher.
+
+        Part 3 of a refactor - just remove the proxy code for the now
+        defunct transaction method.
+
+        * public/WebIDBDatabase.h:
+        * src/IDBDatabaseBackendProxy.cpp:
+        * src/IDBDatabaseBackendProxy.h:
+        (IDBDatabaseBackendProxy):
+        * src/WebIDBDatabaseImpl.cpp:
+        * src/WebIDBDatabaseImpl.h:
+        (WebIDBDatabaseImpl):
+        * tests/IDBDatabaseBackendTest.cpp:
+
 2012-12-05  Joshua Bell  <jsbell@chromium.org>
 
         IndexedDB: Replace use of ScriptExecutionContext::Task (Part 2)
index 95baf66..1676ae6 100644 (file)
@@ -56,10 +56,15 @@ public:
         return 0;
     }
     virtual void deleteObjectStore(long long objectStoreId, const WebIDBTransaction& transaction, WebExceptionCode& ec) { WEBKIT_ASSERT_NOT_REACHED(); }
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual WebIDBTransaction* createTransaction(long long id, const WebVector<long long>&, unsigned short mode) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
+    virtual void createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>&, unsigned short mode) { WEBKIT_ASSERT_NOT_REACHED(); }
     virtual void close() { WEBKIT_ASSERT_NOT_REACHED(); }
     virtual void forceClose() { WEBKIT_ASSERT_NOT_REACHED(); }
 
+    virtual void abort(long long transactionId) { WEBKIT_ASSERT_NOT_REACHED(); }
+    virtual void commit(long long transactionId) { WEBKIT_ASSERT_NOT_REACHED(); }
+
 protected:
     WebIDBDatabase() { }
 };
index 12da7e0..b462661 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef WebIDBDatabaseCallbacks_h
 #define WebIDBDatabaseCallbacks_h
 
+#include "WebIDBDatabaseError.h"
 #include "platform/WebCommon.h"
 #include "platform/WebString.h"
 
@@ -38,6 +39,9 @@ public:
     virtual void onForcedClose() { WEBKIT_ASSERT_NOT_REACHED(); }
     virtual void onVersionChange(long long oldVersion, long long newVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
     virtual void onVersionChange(const WebString& requestedVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+    virtual void onAbort(long long transactionId, const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); }
+    virtual void onComplete(long long transactionId) { WEBKIT_ASSERT_NOT_REACHED(); }
 };
 
 } // namespace WebKit
index 12ecf07..eba3884 100644 (file)
@@ -56,7 +56,9 @@ public:
     virtual void getDatabaseNames(WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
 
     // The WebKit implementation of open ignores the WebFrame* parameter.
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual void open(const WebString& name, long long version, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
+    virtual void open(const WebString& name, long long version, long long transactionId, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
 
     virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
 };
index e9c80d0..a0dc24e 100644 (file)
@@ -94,6 +94,22 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::createTransa
     return IDBTransactionBackendProxy::create(transaction.release());
 }
 
+void IDBDatabaseBackendProxy::createTransaction(int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
+{
+    m_webIDBDatabase->createTransaction(id, new WebIDBDatabaseCallbacksImpl(callbacks), objectStoreIds, mode);
+}
+
+void IDBDatabaseBackendProxy::commit(int64_t transactionId)
+{
+    m_webIDBDatabase->commit(transactionId);
+}
+
+void IDBDatabaseBackendProxy::abort(int64_t transactionId)
+{
+    m_webIDBDatabase->abort(transactionId);
+}
+
+
 void IDBDatabaseBackendProxy::close(PassRefPtr<IDBDatabaseCallbacks>)
 {
     m_webIDBDatabase->close();
index 03d05d9..b988d35 100644 (file)
@@ -46,9 +46,14 @@ public:
 
     virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
     virtual void deleteObjectStore(int64_t, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> createTransaction(int64_t, const Vector<int64_t>&, unsigned short mode);
+    virtual void createTransaction(int64_t, PassRefPtr<WebCore::IDBDatabaseCallbacks>, const Vector<int64_t>&, unsigned short mode);
     virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>);
 
+    virtual void commit(int64_t);
+    virtual void abort(int64_t);
+
 private:
     IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase>);
 
index 31897da..6365926 100644 (file)
@@ -63,6 +63,16 @@ void IDBDatabaseCallbacksProxy::onVersionChange(const String& requestedVersion)
     m_callbacks->onVersionChange(requestedVersion);
 }
 
+void IDBDatabaseCallbacksProxy::onAbort(int64_t transactionId, PassRefPtr<WebCore::IDBDatabaseError> error)
+{
+    m_callbacks->onAbort(transactionId, error);
+}
+
+void IDBDatabaseCallbacksProxy::onComplete(int64_t transactionId)
+{
+    m_callbacks->onComplete(transactionId);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INDEXED_DATABASE)
index cb1ddb3..fab45ba 100644 (file)
@@ -44,6 +44,9 @@ public:
     virtual void onVersionChange(const String& requestedVersion);
     virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
 
+    virtual void onAbort(int64_t transactionId, PassRefPtr<WebCore::IDBDatabaseError>);
+    virtual void onComplete(int64_t transactionId);
+
 private:
     IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks>);
 
index fff5496..dbec96b 100755 (executable)
@@ -205,6 +205,7 @@ void IDBFactoryBackendProxy::getDatabaseNames(PassRefPtr<IDBCallbacks> prpCallba
 }
 
 
+// FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
 void IDBFactoryBackendProxy::open(const String& name, int64_t version, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
 {
     RefPtr<IDBCallbacks> callbacks(prpCallbacks);
@@ -217,6 +218,18 @@ void IDBFactoryBackendProxy::open(const String& name, int64_t version, PassRefPt
     m_webIDBFactory->open(name, version, new WebIDBCallbacksImpl(callbacks), new WebIDBDatabaseCallbacksImpl(databaseCallbacks), origin, webFrame, dataDir);
 }
 
+void IDBFactoryBackendProxy::open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
+{
+    RefPtr<IDBCallbacks> callbacks(prpCallbacks);
+    RefPtr<IDBDatabaseCallbacks> databaseCallbacks(prpDatabaseCallbacks);
+    WebSecurityOrigin origin(securityOrigin);
+    if (!allowIndexedDB(context, name, origin, callbacks))
+        return;
+
+    WebFrameImpl* webFrame = getWebFrame(context);
+    m_webIDBFactory->open(name, version, transactionId, new WebIDBCallbacksImpl(callbacks), new WebIDBDatabaseCallbacksImpl(databaseCallbacks), origin, webFrame, dataDir);
+}
+
 void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
 {
     RefPtr<IDBCallbacks> callbacks(prpCallbacks);
index 88380d7..c899e80 100644 (file)
@@ -49,7 +49,9 @@ public:
     virtual ~IDBFactoryBackendProxy();
 
     virtual void getDatabaseNames(PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual void open(const String& name, int64_t version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
+    virtual void open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
     virtual void deleteDatabase(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
 
 private:
index 5ae86a6..6a36fd2 100644 (file)
@@ -59,6 +59,17 @@ void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebString& version)
     m_callbacks->onVersionChange(version);
 }
 
+void WebIDBDatabaseCallbacksImpl::onAbort(long long transactionId, const WebIDBDatabaseError& error)
+{
+    m_callbacks->onAbort(transactionId, error);
+}
+
+void WebIDBDatabaseCallbacksImpl::onComplete(long long transactionId)
+{
+    m_callbacks->onComplete(transactionId);
+}
+
+
 } // namespace WebKit
 
 #endif // ENABLE(INDEXED_DATABASE)
index b0737ee..5293d54 100644 (file)
@@ -46,6 +46,8 @@ public:
     virtual void onForcedClose();
     virtual void onVersionChange(long long oldVersion, long long newVersion);
     virtual void onVersionChange(const WebString& version);
+    virtual void onAbort(long long transactionId, const WebIDBDatabaseError&);
+    virtual void onComplete(long long transactionId);
 
 private:
     RefPtr<WebCore::IDBDatabaseCallbacks> m_callbacks;
index 403a30b..8684648 100644 (file)
@@ -75,6 +75,7 @@ void WebIDBDatabaseImpl::deleteObjectStore(long long objectStoreId, const WebIDB
     m_databaseBackend->deleteObjectStore(objectStoreId, transaction.getIDBTransactionBackendInterface(), ec);
 }
 
+// FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
 WebIDBTransaction* WebIDBDatabaseImpl::createTransaction(long long id, const WebVector<long long>& objectStoreIds, unsigned short mode)
 {
     Vector<int64_t> objectStoreIdList(objectStoreIds.size());
@@ -86,6 +87,15 @@ WebIDBTransaction* WebIDBDatabaseImpl::createTransaction(long long id, const Web
     return new WebIDBTransactionImpl(transaction);
 }
 
+void WebIDBDatabaseImpl::createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>& objectStoreIds, unsigned short mode)
+{
+    Vector<int64_t> objectStoreIdList(objectStoreIds.size());
+    for (size_t i = 0; i < objectStoreIds.size(); ++i)
+        objectStoreIdList[i] = objectStoreIds[i];
+    RefPtr<IDBDatabaseCallbacksProxy> databaseCallbacksProxy = IDBDatabaseCallbacksProxy::create(adoptPtr(callbacks));
+    m_databaseBackend->createTransaction(id, databaseCallbacksProxy.get(), objectStoreIdList, mode);
+}
+
 void WebIDBDatabaseImpl::close()
 {
     // Use the callbacks passed in to the constructor so that the backend in
@@ -104,6 +114,18 @@ void WebIDBDatabaseImpl::forceClose()
     callbacks->onForcedClose();
 }
 
+void WebIDBDatabaseImpl::abort(long long transactionId)
+{
+    if (m_databaseBackend)
+        m_databaseBackend->abort(transactionId);
+}
+
+void WebIDBDatabaseImpl::commit(long long transactionId)
+{
+    if (m_databaseBackend)
+        m_databaseBackend->commit(transactionId);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INDEXED_DATABASE)
index 66aa84d..3b97728 100644 (file)
@@ -54,9 +54,13 @@ public:
 
     virtual WebIDBObjectStore* createObjectStore(long long, const WebString& name, const WebIDBKeyPath&, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&);
     virtual void deleteObjectStore(long long objectStoreId, const WebIDBTransaction&, WebExceptionCode&);
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual WebIDBTransaction* createTransaction(long long id, const WebVector<long long>&, unsigned short mode);
+    virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>&, unsigned short mode);
     virtual void forceClose();
     virtual void close();
+    virtual void abort(long long transactionId);
+    virtual void commit(long long transactionId);
 
 private:
     WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend;
index 94a8d46..d10eb92 100755 (executable)
@@ -65,6 +65,7 @@ void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, const WebSe
     m_idbFactoryBackend->getDatabaseNames(IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, dataDir);
 }
 
+// FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
 void WebIDBFactoryImpl::open(const WebString& name, long long version, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
 {
     RefPtr<IDBCallbacksProxy> callbacksProxy = IDBCallbacksProxy::create(adoptPtr(callbacks));
@@ -73,6 +74,14 @@ void WebIDBFactoryImpl::open(const WebString& name, long long version, WebIDBCal
     m_idbFactoryBackend->open(name, version, callbacksProxy.get(), databaseCallbacksProxy.get(), origin, 0, dataDir);
 }
 
+void WebIDBFactoryImpl::open(const WebString& name, long long version, long long transactionId, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
+{
+    RefPtr<IDBCallbacksProxy> callbacksProxy = IDBCallbacksProxy::create(adoptPtr(callbacks));
+    RefPtr<IDBDatabaseCallbacksProxy> databaseCallbacksProxy = IDBDatabaseCallbacksProxy::create(adoptPtr(databaseCallbacks));
+    callbacksProxy->setDatabaseCallbacks(databaseCallbacksProxy);
+    m_idbFactoryBackend->open(name, version, transactionId, callbacksProxy.get(), databaseCallbacksProxy.get(), origin, 0, dataDir);
+}
+
 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
 {
     m_idbFactoryBackend->deleteDatabase(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, dataDir);
index 33f5a21..7c0dee7 100644 (file)
@@ -45,7 +45,9 @@ public:
     virtual ~WebIDBFactoryImpl();
 
     virtual void getDatabaseNames(WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual void open(const WebString& name, long long version, WebIDBCallbacks*, WebIDBDatabaseCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
+    virtual void open(const WebString& name, long long version, long long transactionId, WebIDBCallbacks*, WebIDBDatabaseCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
     virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
 
 private:
index a3d80fd..473a207 100644 (file)
@@ -112,6 +112,8 @@ public:
     virtual void onVersionChange(const String& version) OVERRIDE { }
     virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRIDE { }
     virtual void onForcedClose() OVERRIDE { }
+    virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error) OVERRIDE { }
+    virtual void onComplete(int64_t transactionId) OVERRIDE { }
 private:
     FakeIDBDatabaseCallbacks() { }
 };
index 0d26224..55b85da 100644 (file)
@@ -108,6 +108,8 @@ public:
     virtual void onVersionChange(const String& version) OVERRIDE { }
     virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRIDE { }
     virtual void onForcedClose() OVERRIDE { }
+    virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error) OVERRIDE { }
+    virtual void onComplete(int64_t transactionId) OVERRIDE { }
 private:
     FakeIDBDatabaseCallbacks() { }
 };
@@ -152,7 +154,9 @@ public:
     virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&) { return 0; }
     virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&) { }
     virtual void deleteObjectStore(int64_t, IDBTransactionBackendInterface*, ExceptionCode&) { }
+    // FIXME: Remove this method in https://bugs.webkit.org/show_bug.cgi?id=103923.
     virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t, const Vector<int64_t>&, unsigned short mode) { return 0; }
+    void createTransaction(int64_t, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, unsigned short mode) { }
 
     virtual void close(PassRefPtr<IDBDatabaseCallbacks>)
     {
@@ -160,6 +164,9 @@ public:
         m_webDatabase.close();
     }
 
+    virtual void abort(int64_t transactionId) { }
+    virtual void commit(int64_t transactionId) { }
+
 private:
     MockIDBDatabaseBackendProxy(WebIDBDatabaseImpl& webDatabase)
         : m_wasCloseCalled(false)