#include "modules/indexeddb/IDBCursorWithValue.h"
#include "modules/indexeddb/IDBDatabase.h"
#include "modules/indexeddb/IDBEventDispatcher.h"
-#include "modules/indexeddb/IDBPendingTransactionMonitor.h"
#include "modules/indexeddb/IDBTracing.h"
#include "platform/SharedBuffer.h"
#include "public/platform/WebBlobInfo.h"
IDBRequest* IDBRequest::create(ScriptState* scriptState, IDBAny* source, IDBTransaction* transaction)
{
- IDBRequest* request = adoptRefCountedGarbageCollectedWillBeNoop(new IDBRequest(scriptState, source, transaction));
+ IDBRequest* request = new IDBRequest(scriptState, source, transaction);
request->suspendIfNeeded();
// Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
if (transaction)
return value;
}
-PassRefPtrWillBeRawPtr<DOMError> IDBRequest::error(ExceptionState& exceptionState) const
+DOMError* IDBRequest::error(ExceptionState& exceptionState) const
{
if (m_readyState != DONE) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage);
ASSERT(!m_blobInfo);
m_blobInfo = blobInfo;
if (m_blobInfo && m_blobInfo->size() > 0)
- V8PerIsolateData::from(scriptState()->isolate())->ensureIDBPendingTransactionMonitor()->registerRequest(*this);
+ ThreadState::current()->registerPreFinalizer(*this);
}
void IDBRequest::handleBlobAcks()
if (m_blobInfo.get() && m_blobInfo->size()) {
m_transaction->db()->ackReceivedBlobs(m_blobInfo.get());
m_blobInfo.clear();
- V8PerIsolateData::from(scriptState()->isolate())->ensureIDBPendingTransactionMonitor()->unregisterRequest(*this);
+ ThreadState::current()->unregisterPreFinalizer(*this);
}
}
return true;
}
-void IDBRequest::onError(PassRefPtrWillBeRawPtr<DOMError> error)
+void IDBRequest::onError(DOMError* error)
{
IDB_TRACE("IDBRequest::onError()");
if (!shouldEnqueueEvent())
cursorToNotify = getResultCursor();
if (cursorToNotify) {
if (m_blobInfo && m_blobInfo->size() > 0)
- V8PerIsolateData::from(scriptState()->isolate())->ensureIDBPendingTransactionMonitor()->unregisterRequest(*this);
+ ThreadState::current()->unregisterPreFinalizer(*this);
cursorToNotify->setValueReady(m_cursorKey.release(), m_cursorPrimaryKey.release(), m_cursorValue.release(), m_blobInfo.release());
}
}