| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 Document* document = m_frame->document(); | 116 Document* document = m_frame->document(); |
| 117 | 117 |
| 118 if (urlString.isNull()) | 118 if (urlString.isNull()) |
| 119 return document->url(); | 119 return document->url(); |
| 120 if (urlString.isEmpty()) | 120 if (urlString.isEmpty()) |
| 121 return document->baseURL(); | 121 return document->baseURL(); |
| 122 | 122 |
| 123 return KURL(document->baseURL(), urlString); | 123 return KURL(document->baseURL(), urlString); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
ing& /* title */, const String& urlString, UpdateBackForwardListPolicy updateBac
kForwardListPolicy, ExceptionState& exceptionState) | 126 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
ing& /* title */, const String& urlString, FrameLoadType type, ExceptionState& e
xceptionState) |
| 127 { | 127 { |
| 128 if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader()) | 128 if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader()) |
| 129 return; | 129 return; |
| 130 | 130 |
| 131 KURL fullURL = urlForState(urlString); | 131 KURL fullURL = urlForState(urlString); |
| 132 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest
(fullURL)) { | 132 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest
(fullURL)) { |
| 133 // We can safely expose the URL to JavaScript, as a) no redirection take
s place: JavaScript already had this URL, b) JavaScript can only access a same-o
rigin History object. | 133 // We can safely expose the URL to JavaScript, as a) no redirection take
s place: JavaScript already had this URL, b) JavaScript can only access a same-o
rigin History object. |
| 134 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->securityOrigin()->toString() + "'."); | 134 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->securityOrigin()->toString() + "'."); |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, updateBackForwardListPolicy); | 137 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, type); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace WebCore | 140 } // namespace WebCore |
| OLD | NEW |