Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2491)

Unified Diff: Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1034453002: [bindings] Remove custom binding usage from XMLHttpRequest.open() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: isEmpty => isNull Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xmlhttprequest/XMLHttpRequest.h ('k') | Source/core/xmlhttprequest/XMLHttpRequest.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index f10abe0c2f6232c1fa2d7783f2980af4b9082cee..4c32a3e7bd395ab1a5038e4ca1983324b19df265 100644
--- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -687,11 +687,16 @@ void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionSta
m_includeCredentials = value;
}
-void XMLHttpRequest::open(const AtomicString& method, const KURL& url, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const String& url, ExceptionState& exceptionState)
{
open(method, url, true, exceptionState);
}
+void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, ExceptionState& exceptionState)
+{
+ open(method, executionContext()->completeURL(urlString), async, exceptionState);
+}
+
void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, ExceptionState& exceptionState)
{
WTF_LOG(Network, "XMLHttpRequest %p open('%s', '%s', %d)", this, method.utf8().data(), url.elidedString().utf8().data(), async);
@@ -763,19 +768,22 @@ void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
m_state = OPENED;
}
-void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, const String& user, ExceptionState& exceptionState)
{
- KURL urlWithCredentials(url);
- urlWithCredentials.setUser(user);
+ KURL urlWithCredentials(executionContext()->completeURL(urlString));
+ if (!user.isNull())
+ urlWithCredentials.setUser(user);
open(method, urlWithCredentials, async, exceptionState);
}
-void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, const String& password, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, const String& user, const String& password, ExceptionState& exceptionState)
{
- KURL urlWithCredentials(url);
- urlWithCredentials.setUser(user);
- urlWithCredentials.setPass(password);
+ KURL urlWithCredentials(executionContext()->completeURL(urlString));
+ if (!user.isNull())
+ urlWithCredentials.setUser(user);
+ if (!password.isNull())
+ urlWithCredentials.setPass(password);
open(method, urlWithCredentials, async, exceptionState);
}
« no previous file with comments | « Source/core/xmlhttprequest/XMLHttpRequest.h ('k') | Source/core/xmlhttprequest/XMLHttpRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698