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

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

Issue 1858833003: Move isNavigationAllowed() check to main entry point for loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 navigationPolicyFromMouseEvent(0, gestureEvent->ctrlKey(), gestureEvent- >shiftKey(), gestureEvent->altKey(), gestureEvent->metaKey(), &policy); 877 navigationPolicyFromMouseEvent(0, gestureEvent->ctrlKey(), gestureEvent- >shiftKey(), gestureEvent->altKey(), gestureEvent->metaKey(), &policy);
878 } 878 }
879 return policy; 879 return policy;
880 } 880 }
881 881
882 void FrameLoader::load(const FrameLoadRequest& passedRequest, FrameLoadType fram eLoadType, 882 void FrameLoader::load(const FrameLoadRequest& passedRequest, FrameLoadType fram eLoadType,
883 HistoryItem* historyItem, HistoryLoadType historyLoadType) 883 HistoryItem* historyItem, HistoryLoadType historyLoadType)
884 { 884 {
885 ASSERT(m_frame->document()); 885 ASSERT(m_frame->document());
886 886
887 if (!m_frame->isNavigationAllowed())
888 return;
889
887 if (m_inStopAllLoaders) 890 if (m_inStopAllLoaders)
888 return; 891 return;
889 892
890 if (m_frame->page()->defersLoading() && isBackForwardLoadType(frameLoadType) ) { 893 if (m_frame->page()->defersLoading() && isBackForwardLoadType(frameLoadType) ) {
891 m_deferredHistoryLoad = DeferredHistoryLoad::create(passedRequest.resour ceRequest(), historyItem, frameLoadType, historyLoadType); 894 m_deferredHistoryLoad = DeferredHistoryLoad::create(passedRequest.resour ceRequest(), historyItem, frameLoadType, historyLoadType);
892 return; 895 return;
893 } 896 }
894 897
895 FrameLoadRequest request(passedRequest); 898 FrameLoadRequest request(passedRequest);
896 request.resourceRequest().setHasUserGesture(UserGestureIndicator::processing UserGesture()); 899 request.resourceRequest().setHasUserGesture(UserGestureIndicator::processing UserGesture());
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 // FIXME: We need a way to propagate insecure requests policy flags to 1567 // FIXME: We need a way to propagate insecure requests policy flags to
1565 // out-of-process frames. For now, we'll always use default behavior. 1568 // out-of-process frames. For now, we'll always use default behavior.
1566 if (!parentFrame->isLocalFrame()) 1569 if (!parentFrame->isLocalFrame())
1567 return nullptr; 1570 return nullptr;
1568 1571
1569 ASSERT(toLocalFrame(parentFrame)->document()); 1572 ASSERT(toLocalFrame(parentFrame)->document());
1570 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1573 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1571 } 1574 }
1572 1575
1573 } // namespace blink 1576 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698