Index: branches/chromium/1599/Source/core/xml/XMLHttpRequest.cpp |
=================================================================== |
--- branches/chromium/1599/Source/core/xml/XMLHttpRequest.cpp (revision 159086) |
+++ branches/chromium/1599/Source/core/xml/XMLHttpRequest.cpp (working copy) |
@@ -450,9 +450,7 @@ |
void XMLHttpRequest::open(const String& method, const KURL& url, bool async, ExceptionState& es) |
{ |
- if (!internalAbort()) |
- return; |
- |
+ internalAbort(); |
State previousState = m_state; |
m_state = UNSENT; |
m_error = false; |
@@ -785,8 +783,7 @@ |
bool sendFlag = m_loader; |
- if (!internalAbort()) |
- return; |
+ internalAbort(); |
clearResponseBuffers(); |
@@ -809,7 +806,7 @@ |
} |
} |
-bool XMLHttpRequest::internalAbort() |
+void XMLHttpRequest::internalAbort() |
{ |
bool hadLoader = m_loader; |
@@ -818,20 +815,9 @@ |
// FIXME: when we add the support for multi-part XHR, we will have to think be careful with this initialization. |
m_receivedLength = 0; |
- if (hadLoader) |
- // Cancelling the ThreadableLoader m_loader may result in calling |
- // window.onload synchronously. If such an onload handler contains |
- // open() call on the same XMLHttpRequest object, reentry happens. If |
- // m_loader is left to be non 0, internalAbort() call for the inner |
- // open() makes an extra dropProtection() call (when we're back to the |
- // outer open(), we'll call dropProtection()). To avoid that, clears |
- // m_loader before calling cancel. |
- // |
- // If, window.onload contains open() and send(), m_loader will be set to |
- // non 0 value. So, we cannot continue the outer open(). In such case, |
- // just abort the outer open() by returning false. |
- RefPtr<ThreadableLoader> loader = m_loader.release(); |
- loader->cancel(); |
+ if (hadLoader) { |
+ m_loader->cancel(); |
+ m_loader = 0; |
} |
m_decoder = 0; |
@@ -840,8 +826,6 @@ |
if (hadLoader) |
dropProtectionSoon(); |
- |
- return !m_loader; |
} |
void XMLHttpRequest::clearResponse() |
@@ -1202,8 +1186,7 @@ |
{ |
// internalAbort() calls dropProtection(), which may release the last reference. |
RefPtr<XMLHttpRequest> protect(this); |
- if (!internalAbort()) |
- return; |
+ internalAbort(); |
clearResponse(); |
clearRequest(); |