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

Unified Diff: Source/platform/network/ResourceResponse.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/platform/network/ResourceResponse.h ('k') | Source/wtf/text/AtomicStringHash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/network/ResourceResponse.cpp
diff --git a/Source/platform/network/ResourceResponse.cpp b/Source/platform/network/ResourceResponse.cpp
index 795f310f3f73da9401bc730c179b55121ac4cd65..0b156692cd0ce2b3244fb4bbcb55f31821115fe9 100644
--- a/Source/platform/network/ResourceResponse.cpp
+++ b/Source/platform/network/ResourceResponse.cpp
@@ -267,7 +267,7 @@ void ResourceResponse::setHTTPStatusText(const AtomicString& statusText)
m_httpStatusText = statusText;
}
-AtomicString ResourceResponse::httpHeaderField(const AtomicString& name) const
+const AtomicString& ResourceResponse::httpHeaderField(const AtomicString& name) const
{
return m_httpHeaderFields.get(name);
}
@@ -340,7 +340,7 @@ void ResourceResponse::parseCacheControlDirectives() const
DEFINE_STATIC_LOCAL(const AtomicString, mustRevalidateDirective, ("must-revalidate", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(const AtomicString, maxAgeDirective, ("max-age", AtomicString::ConstructFromLiteral));
- AtomicString cacheControlValue = m_httpHeaderFields.get(cacheControlString);
+ const AtomicString& cacheControlValue = m_httpHeaderFields.get(cacheControlString);
if (!cacheControlValue.isEmpty()) {
Vector<pair<String, String> > directives;
parseCacheHeader(cacheControlValue, directives);
@@ -373,7 +373,7 @@ void ResourceResponse::parseCacheControlDirectives() const
// This is deprecated and equivalent to Cache-control: no-cache
// Don't bother tokenizing the value, it is not important
DEFINE_STATIC_LOCAL(const AtomicString, pragmaHeader, ("pragma", AtomicString::ConstructFromLiteral));
- String pragmaValue = m_httpHeaderFields.get(pragmaHeader);
+ const AtomicString& pragmaValue = m_httpHeaderFields.get(pragmaHeader);
m_cacheControlContainsNoCache = pragmaValue.lower().contains(noCacheDirective);
}
@@ -416,7 +416,7 @@ double ResourceResponse::cacheControlMaxAge() const
static double parseDateValueInHeader(const HTTPHeaderMap& headers, const AtomicString& headerName)
{
- String headerValue = headers.get(headerName);
+ const AtomicString& headerValue = headers.get(headerName);
if (headerValue.isEmpty())
return std::numeric_limits<double>::quiet_NaN();
// This handles all date formats required by RFC2616:
@@ -443,7 +443,7 @@ double ResourceResponse::age() const
{
if (!m_haveParsedAgeHeader) {
DEFINE_STATIC_LOCAL(const AtomicString, headerName, ("age", AtomicString::ConstructFromLiteral));
- String headerValue = m_httpHeaderFields.get(headerName);
+ const AtomicString& headerValue = m_httpHeaderFields.get(headerName);
bool ok;
m_age = headerValue.toDouble(&ok);
if (!ok)
« no previous file with comments | « Source/platform/network/ResourceResponse.h ('k') | Source/wtf/text/AtomicStringHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698