Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1423)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 278133002: Don't save history state for frames that were initially blocked due to mixed content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index b7efdbfb62071fd2412dfde87aeaf460ac4aca2e..9d169b6672ed21670a9fd7f6527fe9258c3b91cf 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -284,11 +284,11 @@ void FrameLoader::setHistoryItemStateForCommit(HistoryCommitType historyCommitTy
m_currentItem->setFormInfoFromRequest(isPushOrReplaceState ? ResourceRequest() : m_documentLoader->request());
}
-static HistoryCommitType loadTypeToCommitType(FrameLoadType type, bool isValidHistoryURL)
+static HistoryCommitType loadTypeToCommitType(FrameLoadType type)
{
switch (type) {
case FrameLoadTypeStandard:
- return isValidHistoryURL ? StandardCommit : HistoryInertCommit;
+ return StandardCommit;
case FrameLoadTypeInitialInChildFrame:
return InitialCommitInChildFrame;
case FrameLoadTypeBackForward:
@@ -304,8 +304,11 @@ void FrameLoader::receivedFirstData()
if (m_stateMachine.creatingInitialEmptyDocument())
return;
- bool isValidHistoryURL = !m_documentLoader->urlForHistory().isEmpty() && (!opener() || m_currentItem || !m_documentLoader->originalRequest().url().isEmpty());
- HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType, isValidHistoryURL);
+ HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType);
+ if (historyCommitType == StandardCommit && (m_documentLoader->urlForHistory().isEmpty() || (opener() && !m_currentItem && m_documentLoader->originalRequest().url().isEmpty())))
+ historyCommitType = HistoryInertCommit;
+ else if (historyCommitType == InitialCommitInChildFrame && MixedContentChecker::isMixedContent(m_frame->tree().top()->document()->securityOrigin(), m_documentLoader->url()))
+ historyCommitType = HistoryInertCommit;
setHistoryItemStateForCommit(historyCommitType);
if (!m_stateMachine.committedMultipleRealLoads() && m_loadType == FrameLoadTypeStandard)
« no previous file with comments | « LayoutTests/http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698