void XMLHttpRequest::abort() { // internalAbort() calls dropProtection(), which may release the last reference. Ref<XMLHttpRequest> protect(*this); bool sendFlag = m_loader; if (!internalAbort()) return; clearResponseBuffers(); // Clear headers as required by the spec m_requestHeaders.clear(); if ((m_state <= OPENED && !sendFlag) || m_state == DONE) m_state = UNSENT; else { ASSERT(!m_loader); changeState(DONE); m_state = UNSENT; } dispatchErrorEvents(eventNames().abortEvent); }
void XMLHttpRequest::abort() { // internalAbort() calls dropProtection(), which may release the last reference. Ref<XMLHttpRequest> protectedThis(*this); if (!internalAbort()) return; clearResponseBuffers(); // Clear headers as required by the spec m_requestHeaders.clear(); if ((m_state == OPENED && m_sendFlag) || m_state == HEADERS_RECEIVED || m_state == LOADING) { ASSERT(!m_loader); m_sendFlag = false; changeState(DONE); dispatchErrorEvents(eventNames().abortEvent); } m_state = UNSENT; }
void XMLHttpRequest::abortError() { genericError(); dispatchErrorEvents(eventNames().abortEvent); }
void XMLHttpRequest::networkError() { genericError(); dispatchErrorEvents(eventNames().errorEvent); internalAbort(); }