| Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| index ddbde836da3c55855ac4d4c45b57722839c80089..bf26832ea0d32f46357eeee81ec981c8e2ed1d08 100644
|
| --- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| +++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| @@ -837,34 +837,11 @@
|
| m_exceptionCode = exceptionState.code();
|
| }
|
|
|
| -void XMLHttpRequest::throwForLoadFailureIfNeeded(ExceptionState& exceptionState, const String& reason)
|
| -{
|
| - if (m_error && !m_exceptionCode)
|
| - m_exceptionCode = NetworkError;
|
| -
|
| - if (!m_exceptionCode)
|
| - return;
|
| -
|
| - String message = "Failed to load '" + m_url.elidedString() + "'";
|
| - if (reason.isNull()) {
|
| - message.append(".");
|
| - } else {
|
| - message.append(": ");
|
| - message.append(reason);
|
| - }
|
| -
|
| - exceptionState.throwDOMException(m_exceptionCode, message);
|
| -}
|
| -
|
| void XMLHttpRequest::createRequest(PassRefPtr<FormData> httpBody, ExceptionState& exceptionState)
|
| {
|
| // Only GET request is supported for blob URL.
|
| if (m_url.protocolIs("blob") && m_method != "GET") {
|
| - handleNetworkError();
|
| -
|
| - if (!m_async) {
|
| - throwForLoadFailureIfNeeded(exceptionState, "'GET' is the only method allowed for 'blob:' URLs.");
|
| - }
|
| + exceptionState.throwDOMException(NetworkError, "'GET' is the only method allowed for 'blob:' URLs.");
|
| return;
|
| }
|
|
|
| @@ -939,15 +916,16 @@
|
| // FIXME: Maybe create() can return null for other reasons too?
|
| ASSERT(!m_loader);
|
| m_loader = ThreadableLoader::create(executionContext, this, request, options, resourceLoaderOptions);
|
| -
|
| - return;
|
| - }
|
| -
|
| - // Use count for XHR synchronous requests.
|
| - UseCounter::count(&executionContext, UseCounter::XMLHttpRequestSynchronous);
|
| - ThreadableLoader::loadResourceSynchronously(executionContext, request, *this, options, resourceLoaderOptions);
|
| -
|
| - throwForLoadFailureIfNeeded(exceptionState, String());
|
| + } else {
|
| + // Use count for XHR synchronous requests.
|
| + UseCounter::count(&executionContext, UseCounter::XMLHttpRequestSynchronous);
|
| + ThreadableLoader::loadResourceSynchronously(executionContext, request, *this, options, resourceLoaderOptions);
|
| + }
|
| +
|
| + if (!m_exceptionCode && m_error)
|
| + m_exceptionCode = NetworkError;
|
| + if (m_exceptionCode)
|
| + exceptionState.throwDOMException(m_exceptionCode, "Failed to load '" + m_url.elidedString() + "'.");
|
| }
|
|
|
| void XMLHttpRequest::abort()
|
|
|