Commit 6e5f0963 authored by beidson@apple.com's avatar beidson@apple.com

Let IDBDatabaseBackend create IDBTransactionBackend's directly

https://bugs.webkit.org/show_bug.cgi?id=124438

Reviewed by Beth Dakin.

Source/WebCore:

Create IDBTransactionBackends directly:
* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::createTransaction):
* Modules/indexeddb/IDBDatabaseBackend.h:

Remove maybeCreateTransactionBackend():
* Modules/indexeddb/IDBFactoryBackendInterface.h:
* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:

Source/WebKit2:

Remove maybeCreateTransactionBackend():
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 55d46133
2013-11-15 Brady Eidson <beidson@apple.com>
Let IDBDatabaseBackend create IDBTransactionBackend's directly
https://bugs.webkit.org/show_bug.cgi?id=124438
Reviewed by Beth Dakin.
Create IDBTransactionBackends directly:
* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::createTransaction):
* Modules/indexeddb/IDBDatabaseBackend.h:
Remove maybeCreateTransactionBackend():
* Modules/indexeddb/IDBFactoryBackendInterface.h:
* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
2013-11-15 Jer Noble <jer.noble@apple.com>
HTMLMediaElement should not throw an exception from setCurrentTime or fastSeek.
......
......@@ -429,15 +429,12 @@ void IDBDatabaseBackend::processPendingOpenCalls(bool success)
}
}
void IDBDatabaseBackend::createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, unsigned short mode)
void IDBDatabaseBackend::createTransaction(int64_t transactionID, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIDs, unsigned short mode)
{
RefPtr<IDBTransactionBackend> transaction = m_factory->maybeCreateTransactionBackend(this, transactionId, callbacks, objectStoreIds, static_cast<IndexedDB::TransactionMode>(mode));
RefPtr<IDBTransactionBackend> transaction = IDBTransactionBackend::create(this, transactionID, callbacks, objectStoreIDs, static_cast<IndexedDB::TransactionMode>(mode));
if (!transaction)
return;
ASSERT(!m_transactions.contains(transactionId));
m_transactions.add(transactionId, transaction.get());
ASSERT(!m_transactions.contains(transactionID));
m_transactions.add(transactionID, transaction.get());
}
void IDBDatabaseBackend::openConnection(PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, int64_t transactionId, uint64_t version)
......
......@@ -118,8 +118,6 @@ public:
const IDBDatabaseMetadata& metadata() const { return m_metadata; }
void setCurrentVersion(uint64_t version) { m_metadata.version = version; }
bool isIDBDatabaseBackend() { return true; }
bool hasPendingSecondHalfOpen() { return m_pendingSecondHalfOpen; }
void setPendingSecondHalfOpen(PassOwnPtr<IDBPendingOpenCall> pendingOpenCall) { m_pendingSecondHalfOpen = pendingOpenCall; }
......
......@@ -66,7 +66,6 @@ public:
virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier) = 0;
virtual PassRefPtr<IDBTransactionBackend> maybeCreateTransactionBackend(IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode) = 0;
};
} // namespace WebCore
......
......@@ -192,14 +192,6 @@ void IDBFactoryBackendLevelDB::open(const String& name, uint64_t version, int64_
databaseBackend->openConnection(callbacks, databaseCallbacks, transactionId, version);
}
PassRefPtr<IDBTransactionBackend> IDBFactoryBackendLevelDB::maybeCreateTransactionBackend(IDBDatabaseBackend* backend, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
{
if (!backend->isIDBDatabaseBackend())
return 0;
return IDBTransactionBackend::create(static_cast<IDBDatabaseBackend*>(backend), transactionId, databaseCallbacks, objectStoreIds, mode);
}
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE) && USE(LEVELDB)
......@@ -63,8 +63,6 @@ public:
virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) OVERRIDE FINAL;
virtual PassRefPtr<IDBTransactionBackend> maybeCreateTransactionBackend(IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IndexedDB::TransactionMode) OVERRIDE FINAL;
protected:
virtual PassRefPtr<IDBBackingStoreLevelDB> openBackingStore(const SecurityOrigin&, const String& dataDir);
......
2013-11-15 Brady Eidson <beidson@apple.com>
Let IDBDatabaseBackend create IDBTransactionBackend's directly
https://bugs.webkit.org/show_bug.cgi?id=124438
Reviewed by Beth Dakin.
Remove maybeCreateTransactionBackend():
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:
2013-11-15 Brady Eidson <beidson@apple.com>
Remove last vestiges of IDBBackingStore* from IDBTransactionBackend.
......
......@@ -100,12 +100,6 @@ void WebIDBFactoryBackend::removeIDBDatabaseBackend(const String&)
notImplemented();
}
PassRefPtr<IDBTransactionBackend> WebIDBFactoryBackend::maybeCreateTransactionBackend(IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>&, IndexedDB::TransactionMode)
{
notImplemented();
return 0;
}
} // namespace WebKit
#endif // ENABLE(DATABASE_PROCESS)
......
......@@ -45,8 +45,6 @@ public:
virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier) OVERRIDE;
virtual PassRefPtr<WebCore::IDBTransactionBackend> maybeCreateTransactionBackend(WebCore::IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<WebCore::IDBDatabaseCallbacks>, const Vector<int64_t>&, WebCore::IndexedDB::TransactionMode) OVERRIDE;
private:
explicit WebIDBFactoryBackend(const String& databaseDirectoryIdentifier);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment