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

Unified Diff: Source/core/dom/Document.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/dom/Document.h ('k') | Source/core/fetch/CSSStyleSheetResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index f1dd98641183bbe1dade7499e0fca23b60f5a2dc..85bb1123c2a2a7badd350050bcc068b3af67dfd7 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3754,7 +3754,7 @@ void Document::setCookie(const String& value, ExceptionState& exceptionState)
setCookies(this, cookieURL, value);
}
-AtomicString Document::referrer() const
+const AtomicString& Document::referrer() const
{
if (loader())
return loader()->request().httpReferrer();
@@ -3810,12 +3810,12 @@ String Document::lastModified() const
DateComponents date;
bool foundDate = false;
if (m_frame) {
- String httpLastModified;
- if (DocumentLoader* documentLoader = loader())
- httpLastModified = documentLoader->response().httpHeaderField("Last-Modified");
- if (!httpLastModified.isEmpty()) {
- date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
- foundDate = true;
+ if (DocumentLoader* documentLoader = loader()) {
+ const AtomicString& httpLastModified = documentLoader->response().httpHeaderField("Last-Modified");
+ if (!httpLastModified.isEmpty()) {
+ date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
+ foundDate = true;
+ }
}
}
// FIXME: If this document came from the file system, the HTML5
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/fetch/CSSStyleSheetResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698