| Index: Source/core/loader/FrameLoader.cpp
|
| diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
|
| index 0bb9bc66894e79f19d623da064e85fb2be17da8a..41a6a23581c20ddd24ad60fa26efac6b2b8250b1 100644
|
| --- a/Source/core/loader/FrameLoader.cpp
|
| +++ b/Source/core/loader/FrameLoader.cpp
|
| @@ -340,10 +340,18 @@ void FrameLoader::replaceDocumentWhileExecutingJavaScriptURL(const String& sourc
|
| documentLoader->replaceDocumentWhileExecutingJavaScriptURL(init, source, ownerDocument);
|
| }
|
|
|
| +void FrameLoader::receivedMainResourceRedirect(const KURL& newURL)
|
| +{
|
| + client()->dispatchDidReceiveServerRedirectForProvisionalLoad();
|
| + // If a back/forward navigation redirects cross-origin, don't reuse any state from the HistoryItem.
|
| + if (m_provisionalItem && !SecurityOrigin::create(m_provisionalItem->url())->isSameSchemeHostPort(SecurityOrigin::create(newURL).get()))
|
| + m_provisionalItem.clear();
|
| +}
|
| +
|
| void FrameLoader::setHistoryItemStateForCommit(HistoryCommitType historyCommitType, HistoryNavigationType navigationType)
|
| {
|
| RefPtrWillBeRawPtr<HistoryItem> oldItem = m_currentItem;
|
| - if (historyCommitType == BackForwardCommit)
|
| + if (historyCommitType == BackForwardCommit && m_provisionalItem)
|
| m_currentItem = m_provisionalItem.release();
|
| else
|
| m_currentItem = HistoryItem::create();
|
|
|