| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void History::go(ExecutionContext* context, int distance) | 99 void History::go(ExecutionContext* context, int distance) |
| 100 { | 100 { |
| 101 if (!m_frame || !m_frame->loader().client()) | 101 if (!m_frame || !m_frame->loader().client()) |
| 102 return; | 102 return; |
| 103 | 103 |
| 104 ASSERT(isMainThread()); | 104 ASSERT(isMainThread()); |
| 105 Document* activeDocument = toDocument(context); | 105 Document* activeDocument = toDocument(context); |
| 106 if (!activeDocument) | 106 if (!activeDocument) |
| 107 return; | 107 return; |
| 108 | 108 |
| 109 if (!activeDocument->canNavigate(*m_frame)) | 109 if (!activeDocument->frame()->canNavigate(*m_frame)) |
| 110 return; | 110 return; |
| 111 | 111 |
| 112 if (distance) | 112 if (distance) |
| 113 m_frame->loader().client()->navigateBackForward(distance); | 113 m_frame->loader().client()->navigateBackForward(distance); |
| 114 else | 114 else |
| 115 m_frame->reload(NormalReload, ClientRedirect); | 115 m_frame->reload(NormalReload, ClientRedirect); |
| 116 } | 116 } |
| 117 | 117 |
| 118 KURL History::urlForState(const String& urlString) | 118 KURL History::urlForState(const String& urlString) |
| 119 { | 119 { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 135 KURL fullURL = urlForState(urlString); | 135 KURL fullURL = urlForState(urlString); |
| 136 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest
(fullURL)) { | 136 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest
(fullURL)) { |
| 137 // 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. | 137 // 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. |
| 138 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->securityOrigin()->toString() + "'."); | 138 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->securityOrigin()->toString() + "'."); |
| 139 return; | 139 return; |
| 140 } | 140 } |
| 141 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, type); | 141 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, type); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |