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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 return true; | 206 return true; |
207 } | 207 } |
208 | 208 |
209 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
ing& /* title */, const String& urlString, HistoryScrollRestorationType restorat
ionType, FrameLoadType type, ExceptionState& exceptionState) | 209 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
ing& /* title */, const String& urlString, HistoryScrollRestorationType restorat
ionType, FrameLoadType type, ExceptionState& exceptionState) |
210 { | 210 { |
211 if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader()) | 211 if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader()) |
212 return; | 212 return; |
213 | 213 |
214 KURL fullURL = urlForState(urlString); | 214 KURL fullURL = urlForState(urlString); |
215 if (!canChangeToUrl(fullURL, m_frame->document()->securityOrigin(), m_frame-
>document()->url())) { | 215 if (!canChangeToUrl(fullURL, m_frame->document()->getSecurityOrigin(), m_fra
me->document()->url())) { |
216 // 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. | 216 // 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. |
217 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->securityOrigin()->toString() + "' and URL '" + m_frame->docume
nt()->url().elidedString() + "'."); | 217 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->getSecurityOrigin()->toString() + "' and URL '" + m_frame->doc
ument()->url().elidedString() + "'."); |
218 return; | 218 return; |
219 } | 219 } |
220 | 220 |
221 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, restorationType, type); | 221 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, restorationType, type); |
222 } | 222 } |
223 | 223 |
224 } // namespace blink | 224 } // namespace blink |
OLD | NEW |