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

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: AtomicString => String 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
Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index f10abe0c2f6232c1fa2d7783f2980af4b9082cee..303412b60fa9eca37a070f879d9fb6458a55dd16 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.isEmpty())
yhirano 2015/03/24 14:07:22 Can you tell me why you use isEmpty, not isNull? T
+ 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.isEmpty())
+ urlWithCredentials.setUser(user);
+ if (!password.isEmpty())
+ urlWithCredentials.setPass(password);
open(method, urlWithCredentials, async, exceptionState);
}

Powered by Google App Engine
This is Rietveld 408576698