| Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| index 0f4e892fe5ee55ef50746222b880aebaa3bf09d3..a49093f4a3ad011907303d495ea976a84db61bfa 100644
|
| --- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| +++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| @@ -701,14 +701,20 @@ void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionSta
|
| m_includeCredentials = value;
|
| }
|
|
|
| -void XMLHttpRequest::open(const AtomicString& method, const String& url, ExceptionState& exceptionState)
|
| +void XMLHttpRequest::open(const AtomicString& method, const String& urlString, ExceptionState& exceptionState)
|
| {
|
| - open(method, url, true, exceptionState);
|
| + open(method, executionContext()->completeURL(urlString), true, exceptionState);
|
| }
|
|
|
| -void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, ExceptionState& exceptionState)
|
| +void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, const String& username, const String& password, ExceptionState& exceptionState)
|
| {
|
| - open(method, executionContext()->completeURL(urlString), async, exceptionState);
|
| + KURL url(executionContext()->completeURL(urlString));
|
| + if (!username.isNull())
|
| + url.setUser(username);
|
| + if (!password.isNull())
|
| + url.setPass(password);
|
| +
|
| + open(method, url, async, exceptionState);
|
| }
|
|
|
| void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, ExceptionState& exceptionState)
|
| @@ -782,26 +788,6 @@ void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
|
| m_state = OPENED;
|
| }
|
|
|
| -void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, const String& user, ExceptionState& exceptionState)
|
| -{
|
| - KURL urlWithCredentials(executionContext()->completeURL(urlString));
|
| - if (!user.isNull())
|
| - urlWithCredentials.setUser(user);
|
| -
|
| - open(method, urlWithCredentials, async, exceptionState);
|
| -}
|
| -
|
| -void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, const String& user, const String& password, ExceptionState& exceptionState)
|
| -{
|
| - KURL urlWithCredentials(executionContext()->completeURL(urlString));
|
| - if (!user.isNull())
|
| - urlWithCredentials.setUser(user);
|
| - if (!password.isNull())
|
| - urlWithCredentials.setPass(password);
|
| -
|
| - open(method, urlWithCredentials, async, exceptionState);
|
| -}
|
| -
|
| bool XMLHttpRequest::initSend(ExceptionState& exceptionState)
|
| {
|
| if (!executionContext())
|
| @@ -818,12 +804,13 @@ bool XMLHttpRequest::initSend(ExceptionState& exceptionState)
|
|
|
| void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData& data, ExceptionState& exceptionState)
|
| {
|
| + InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url());
|
| +
|
| if (data.isNull()) {
|
| - send(exceptionState);
|
| + send(String(), exceptionState);
|
| return;
|
| }
|
|
|
| - InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url());
|
| if (data.isArrayBuffer()) {
|
| send(data.getAsArrayBuffer().get(), exceptionState);
|
| return;
|
| @@ -853,12 +840,6 @@ void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrSt
|
| send(data.getAsString(), exceptionState);
|
| }
|
|
|
| -void XMLHttpRequest::send(ExceptionState& exceptionState)
|
| -{
|
| - InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url());
|
| - send(String(), exceptionState);
|
| -}
|
| -
|
| bool XMLHttpRequest::areMethodAndURLValidForSend()
|
| {
|
| return m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily();
|
|
|