void IDBRequest::willIterateCursor(IDBCursor& cursor) { ASSERT(m_readyState == IDBRequestReadyState::Done); ASSERT(scriptExecutionContext()); ASSERT(m_transaction); ASSERT(!m_pendingCursor); ASSERT(&cursor == resultCursor()); m_pendingCursor = &cursor; m_result = nullptr; m_readyState = IDBRequestReadyState::Pending; m_domError = nullptr; m_idbError = { }; }
void IDBRequest::willIterateCursor(IDBCursor& cursor) { ASSERT(m_readyState == IDBRequestReadyState::Done); ASSERT(scriptExecutionContext()); ASSERT(m_transaction); ASSERT(!m_pendingCursor); ASSERT(&cursor == resultCursor()); ASSERT(!m_cursorRequestNotifier); m_pendingCursor = &cursor; m_hasPendingActivity = true; m_result = nullptr; m_readyState = IDBRequestReadyState::Pending; m_domError = nullptr; m_idbError = { }; m_cursorRequestNotifier = std::make_unique<ScopeGuard>([this]() { m_pendingCursor->decrementOutstandingRequestCount(); }); }