| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/page/BackForwardClient.h" | 37 #include "core/page/BackForwardClient.h" |
| 38 #include "core/page/Page.h" | 38 #include "core/page/Page.h" |
| 39 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
| 40 #include "platform/weborigin/SecurityOrigin.h" | 40 #include "platform/weborigin/SecurityOrigin.h" |
| 41 #include "wtf/MainThread.h" | 41 #include "wtf/MainThread.h" |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 | 44 |
| 45 History::History(Frame* frame) | 45 History::History(Frame* frame) |
| 46 : DOMWindowProperty(frame) | 46 : DOMWindowProperty(frame) |
| 47 , m_lastStateObjectRequested(0) | 47 , m_lastStateObjectRequested(nullptr) |
| 48 { | 48 { |
| 49 ScriptWrappable::init(this); | 49 ScriptWrappable::init(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 unsigned History::length() const | 52 unsigned History::length() const |
| 53 { | 53 { |
| 54 if (!m_frame) | 54 if (!m_frame) |
| 55 return 0; | 55 return 0; |
| 56 if (!m_frame->page()) | 56 if (!m_frame->page()) |
| 57 return 0; | 57 return 0; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, updateBackForwardListPolicy); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace WebCore | 140 } // namespace WebCore |
| OLD | NEW |