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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3734 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 return; 3745 return;
3746 } 3746 }
3747 3747
3748 KURL cookieURL = this->cookieURL(); 3748 KURL cookieURL = this->cookieURL();
3749 if (cookieURL.isEmpty()) 3749 if (cookieURL.isEmpty())
3750 return; 3750 return;
3751 3751
3752 setCookies(this, cookieURL, value); 3752 setCookies(this, cookieURL, value);
3753 } 3753 }
3754 3754
3755 AtomicString Document::referrer() const 3755 const AtomicString& Document::referrer() const
3756 { 3756 {
3757 if (loader()) 3757 if (loader())
3758 return loader()->request().httpReferrer(); 3758 return loader()->request().httpReferrer();
3759 return nullAtom; 3759 return nullAtom;
3760 } 3760 }
3761 3761
3762 String Document::domain() const 3762 String Document::domain() const
3763 { 3763 {
3764 return securityOrigin()->domain(); 3764 return securityOrigin()->domain();
3765 } 3765 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3801 if (m_frame) 3801 if (m_frame)
3802 m_frame->script().updateSecurityOrigin(); 3802 m_frame->script().updateSecurityOrigin();
3803 } 3803 }
3804 3804
3805 // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified 3805 // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified
3806 String Document::lastModified() const 3806 String Document::lastModified() const
3807 { 3807 {
3808 DateComponents date; 3808 DateComponents date;
3809 bool foundDate = false; 3809 bool foundDate = false;
3810 if (m_frame) { 3810 if (m_frame) {
3811 String httpLastModified; 3811 if (DocumentLoader* documentLoader = loader()) {
3812 if (DocumentLoader* documentLoader = loader()) 3812 const AtomicString& httpLastModified = documentLoader->response().ht tpHeaderField("Last-Modified");
3813 httpLastModified = documentLoader->response().httpHeaderField("Last- Modified"); 3813 if (!httpLastModified.isEmpty()) {
3814 if (!httpLastModified.isEmpty()) { 3814 date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModi fied));
3815 date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified )); 3815 foundDate = true;
3816 foundDate = true; 3816 }
3817 } 3817 }
3818 } 3818 }
3819 // FIXME: If this document came from the file system, the HTML5 3819 // FIXME: If this document came from the file system, the HTML5
3820 // specificiation tells us to read the last modification date from the file 3820 // specificiation tells us to read the last modification date from the file
3821 // system. 3821 // system.
3822 if (!foundDate) 3822 if (!foundDate)
3823 date.setMillisecondsSinceEpochForDateTime(currentTimeMS()); 3823 date.setMillisecondsSinceEpochForDateTime(currentTimeMS());
3824 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, dat e.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second()); 3824 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, dat e.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second());
3825 } 3825 }
3826 3826
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
5232 } 5232 }
5233 5233
5234 FastTextAutosizer* Document::fastTextAutosizer() 5234 FastTextAutosizer* Document::fastTextAutosizer()
5235 { 5235 {
5236 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable d()) 5236 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable d())
5237 m_fastTextAutosizer = FastTextAutosizer::create(this); 5237 m_fastTextAutosizer = FastTextAutosizer::create(this);
5238 return m_fastTextAutosizer.get(); 5238 return m_fastTextAutosizer.get();
5239 } 5239 }
5240 5240
5241 } // namespace WebCore 5241 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698