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

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

Issue 102103002: Have HashMap<KeyType, AtomicString>::get() return a const reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use AtomicString::ConstructFromLiteral Created 7 years 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/xml/XMLHttpRequest.h ('k') | Source/platform/network/HTTPHeaderMap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 1eb7c1b7940d883a4b6efbfa27cbc75428b83a83..9eb54f8bf09813a96bf40d9f07b59306d57c8293 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -640,8 +640,7 @@ void XMLHttpRequest::send(Document* document, ExceptionState& exceptionState)
return;
if (areMethodAndURLValidForSend()) {
- String contentType = getRequestHeader("Content-Type");
- if (contentType.isEmpty()) {
+ if (getRequestHeader("Content-Type").isEmpty()) {
// FIXME: this should include the charset used for encoding.
setRequestHeaderInternal("Content-Type", "application/xml");
}
@@ -691,8 +690,7 @@ void XMLHttpRequest::send(Blob* body, ExceptionState& exceptionState)
return;
if (areMethodAndURLValidForSend()) {
- const String& contentType = getRequestHeader("Content-Type");
- if (contentType.isEmpty()) {
+ if (getRequestHeader("Content-Type").isEmpty()) {
const String& blobType = body->type();
if (!blobType.isEmpty() && isValidContentType(blobType))
setRequestHeaderInternal("Content-Type", AtomicString(blobType));
@@ -1112,7 +1110,7 @@ void XMLHttpRequest::setRequestHeaderInternal(const AtomicString& name, const At
result.iterator->value = result.iterator->value + ", " + value;
}
-AtomicString XMLHttpRequest::getRequestHeader(const AtomicString& name) const
+const AtomicString& XMLHttpRequest::getRequestHeader(const AtomicString& name) const
{
return m_requestHeaders.get(name);
}
@@ -1151,7 +1149,7 @@ String XMLHttpRequest::getAllResponseHeaders(ExceptionState& exceptionState) con
return stringBuilder.toString();
}
-AtomicString XMLHttpRequest::getResponseHeader(const AtomicString& name, ExceptionState& exceptionState) const
+const AtomicString& XMLHttpRequest::getResponseHeader(const AtomicString& name, ExceptionState& exceptionState) const
{
if (m_state < HEADERS_RECEIVED || m_error)
return nullAtom;
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | Source/platform/network/HTTPHeaderMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698