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

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: 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 5721682d37bbe6c898fe8031d0ab2fa09ba1da97..d2c1dc97de8a837e93e7f5538f1ea594fb0cdc03 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3752,7 +3752,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();
@@ -3808,12 +3808,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

Powered by Google App Engine
This is Rietveld 408576698