| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/loader/HistoryItem.h" | 26 #include "core/loader/HistoryItem.h" |
| 27 | 27 |
| 28 #include "core/dom/Document.h" | 28 #include "core/dom/Document.h" |
| 29 #include "core/html/forms/FormController.h" | 29 #include "core/html/forms/FormController.h" |
| 30 #include "platform/network/ResourceRequest.h" | 30 #include "platform/network/ResourceRequest.h" |
| 31 #include "platform/weborigin/SecurityOrigin.h" | |
| 32 #include "platform/weborigin/SecurityPolicy.h" | 31 #include "platform/weborigin/SecurityPolicy.h" |
| 33 #include "wtf/Assertions.h" | 32 #include "wtf/Assertions.h" |
| 34 #include "wtf/CurrentTime.h" | 33 #include "wtf/CurrentTime.h" |
| 35 #include "wtf/text/CString.h" | 34 #include "wtf/text/CString.h" |
| 36 | 35 |
| 37 namespace blink { | 36 namespace blink { |
| 38 | 37 |
| 39 static long long generateSequenceNumber() | 38 static long long generateSequenceNumber() |
| 40 { | 39 { |
| 41 // Initialize to the current time to reduce the likelihood of generating | 40 // Initialize to the current time to reduce the likelihood of generating |
| (...skipping 27 matching lines...) Expand all Loading... |
| 69 const Referrer& HistoryItem::referrer() const | 68 const Referrer& HistoryItem::referrer() const |
| 70 { | 69 { |
| 71 return m_referrer; | 70 return m_referrer; |
| 72 } | 71 } |
| 73 | 72 |
| 74 const String& HistoryItem::target() const | 73 const String& HistoryItem::target() const |
| 75 { | 74 { |
| 76 return m_target; | 75 return m_target; |
| 77 } | 76 } |
| 78 | 77 |
| 79 PassRefPtr<SecurityOrigin> HistoryItem::requestorOrigin() const | |
| 80 { | |
| 81 return SecurityOrigin::createFromString(m_requestorOrigin); | |
| 82 } | |
| 83 | |
| 84 void HistoryItem::setURLString(const String& urlString) | 78 void HistoryItem::setURLString(const String& urlString) |
| 85 { | 79 { |
| 86 if (m_urlString != urlString) | 80 if (m_urlString != urlString) |
| 87 m_urlString = urlString; | 81 m_urlString = urlString; |
| 88 } | 82 } |
| 89 | 83 |
| 90 void HistoryItem::setURL(const KURL& url) | 84 void HistoryItem::setURL(const KURL& url) |
| 91 { | 85 { |
| 92 setURLString(url.getString()); | 86 setURLString(url.getString()); |
| 93 } | 87 } |
| 94 | 88 |
| 95 void HistoryItem::setReferrer(const Referrer& referrer) | 89 void HistoryItem::setReferrer(const Referrer& referrer) |
| 96 { | 90 { |
| 97 // This should be a RELEASE_ASSERT. | 91 // This should be a RELEASE_ASSERT. |
| 98 m_referrer = SecurityPolicy::generateReferrer(referrer.referrerPolicy, url()
, referrer.referrer); | 92 m_referrer = SecurityPolicy::generateReferrer(referrer.referrerPolicy, url()
, referrer.referrer); |
| 99 } | 93 } |
| 100 | 94 |
| 101 void HistoryItem::setRequestorOrigin(PassRefPtr<SecurityOrigin> origin) | |
| 102 { | |
| 103 m_requestorOrigin = origin->toString(); | |
| 104 } | |
| 105 | |
| 106 void HistoryItem::setTarget(const String& target) | 95 void HistoryItem::setTarget(const String& target) |
| 107 { | 96 { |
| 108 m_target = target; | 97 m_target = target; |
| 109 } | 98 } |
| 110 | 99 |
| 111 const FloatPoint& HistoryItem::visualViewportScrollPoint() const | 100 const FloatPoint& HistoryItem::visualViewportScrollPoint() const |
| 112 { | 101 { |
| 113 return m_visualViewportScrollPoint; | 102 return m_visualViewportScrollPoint; |
| 114 } | 103 } |
| 115 | 104 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // FIXME: We should find a better way to check if this is the current docume
nt. | 199 // FIXME: We should find a better way to check if this is the current docume
nt. |
| 211 return equalIgnoringFragmentIdentifier(url(), doc->url()); | 200 return equalIgnoringFragmentIdentifier(url(), doc->url()); |
| 212 } | 201 } |
| 213 | 202 |
| 214 DEFINE_TRACE(HistoryItem) | 203 DEFINE_TRACE(HistoryItem) |
| 215 { | 204 { |
| 216 visitor->trace(m_documentState); | 205 visitor->trace(m_documentState); |
| 217 } | 206 } |
| 218 | 207 |
| 219 } // namespace blink | 208 } // namespace blink |
| OLD | NEW |