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

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 1173513002: Fix Blink commit type for subframes after initial about:blank load. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix broken layout test Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 return FrameLoadTypeRedirectWithLockedBackForwardList; 668 return FrameLoadTypeRedirectWithLockedBackForwardList;
669 if (!request.originDocument() && request.resourceRequest().url() == m_docume ntLoader->urlForHistory()) 669 if (!request.originDocument() && request.resourceRequest().url() == m_docume ntLoader->urlForHistory())
670 return FrameLoadTypeSame; 670 return FrameLoadTypeSame;
671 if (request.substituteData().failingURL() == m_documentLoader->urlForHistory () && m_loadType == FrameLoadTypeReload) 671 if (request.substituteData().failingURL() == m_documentLoader->urlForHistory () && m_loadType == FrameLoadTypeReload)
672 return FrameLoadTypeReload; 672 return FrameLoadTypeReload;
673 return FrameLoadTypeStandard; 673 return FrameLoadTypeStandard;
674 } 674 }
675 675
676 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) 676 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request)
677 { 677 {
678 // From the HTML5 spec for location.assign():
Charlie Reis 2015/06/09 07:14:18 I'm moving this rule from NavigationScheduler::mus
679 // "If the browsing context's session history contains only one Document,
680 // and that was the about:blank Document created when the browsing context
681 // was created, then the navigation must be done with replacement enabled. "
682 if (!m_stateMachine.committedMultipleRealLoads()
Nate Chapin 2015/06/09 18:25:33 Should this be a case in determineFrameLoadType()?
Charlie Reis 2015/06/11 16:43:48 Yes, that seems reasonable. Done.
683 && equalIgnoringCase(m_frame->document()->url(), blankURL())) {
684 request.setLockBackForwardList(true);
685 }
686
678 // If no origin Document* was specified, skip remaining security checks and assume the caller has fully initialized the FrameLoadRequest. 687 // If no origin Document* was specified, skip remaining security checks and assume the caller has fully initialized the FrameLoadRequest.
679 if (!request.originDocument()) 688 if (!request.originDocument())
680 return true; 689 return true;
681 690
682 KURL url = request.resourceRequest().url(); 691 KURL url = request.resourceRequest().url();
683 if (m_frame->script().executeScriptIfJavaScriptURL(url)) 692 if (m_frame->script().executeScriptIfJavaScriptURL(url))
684 return false; 693 return false;
685 694
686 if (!request.originDocument()->securityOrigin()->canDisplay(url)) { 695 if (!request.originDocument()->securityOrigin()->canDisplay(url)) {
687 reportLocalLoadFailed(m_frame, url.elidedString()); 696 reportLocalLoadFailed(m_frame, url.elidedString());
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 // FIXME: We need a way to propagate insecure requests policy flags to 1453 // FIXME: We need a way to propagate insecure requests policy flags to
1445 // out-of-process frames. For now, we'll always use default behavior. 1454 // out-of-process frames. For now, we'll always use default behavior.
1446 if (!parentFrame->isLocalFrame()) 1455 if (!parentFrame->isLocalFrame())
1447 return nullptr; 1456 return nullptr;
1448 1457
1449 ASSERT(toLocalFrame(parentFrame)->document()); 1458 ASSERT(toLocalFrame(parentFrame)->document());
1450 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1459 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1451 } 1460 }
1452 1461
1453 } // namespace blink 1462 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698