void IDBConnectionToServer::establishTransaction(IDBTransaction& transaction)
{
    LOG(IndexedDB, "IDBConnectionToServer::establishTransaction");

    ASSERT(!hasRecordOfTransaction(transaction));
    m_pendingTransactions.set(transaction.info().identifier(), &transaction);

    m_delegate->establishTransaction(transaction.database().databaseConnectionIdentifier(), transaction.info());
}
IDBRequest::IDBRequest(ScriptExecutionContext& context, IDBObjectStore& objectStore, IDBTransaction& transaction)
    : IDBActiveDOMObject(&context)
    , m_transaction(&transaction)
    , m_resourceIdentifier(transaction.connectionProxy())
    , m_source(&objectStore)
    , m_connectionProxy(transaction.database().connectionProxy())
{
    m_result = NullResultType::Empty;
    suspendIfNeeded();
}
Beispiel #3
0
void IDBConnectionProxy::establishTransaction(IDBTransaction& transaction)
{
    {
        Locker<Lock> locker(m_transactionMapLock);
        ASSERT(!hasRecordOfTransaction(transaction));
        m_pendingTransactions.set(transaction.info().identifier(), &transaction);
    }

    callConnectionOnMainThread(&IDBConnectionToServer::establishTransaction, transaction.database().databaseConnectionIdentifier(), transaction.info());
}
IDBRequest::IDBRequest(ScriptExecutionContext& context, IDBCursor& cursor, IDBTransaction& transaction)
    : IDBActiveDOMObject(&context)
    , m_transaction(&transaction)
    , m_resourceIdentifier(transaction.connectionProxy())
    , m_pendingCursor(&cursor)
    , m_connectionProxy(transaction.database().connectionProxy())
{
    suspendIfNeeded();

    WTF::switchOn(cursor.source(),
        [this] (const auto& value) { this->m_source = IDBRequest::Source { value }; }
    );

    m_result = NullResultType::Empty;
    cursor.setRequest(*this);
}