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

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

Issue 1491123002: Speculative fix for null m_documentLoader in restoreScrollPositionAndViewState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 } 1111 }
1112 1112
1113 FrameLoadType FrameLoader::loadType() const 1113 FrameLoadType FrameLoader::loadType() const
1114 { 1114 {
1115 return m_loadType; 1115 return m_loadType;
1116 } 1116 }
1117 1117
1118 void FrameLoader::restoreScrollPositionAndViewState() 1118 void FrameLoader::restoreScrollPositionAndViewState()
1119 { 1119 {
1120 FrameView* view = m_frame->view(); 1120 FrameView* view = m_frame->view();
1121 if (!m_frame->page() || !view || !view->layoutViewportScrollableArea() || !m _currentItem || !m_stateMachine.committedFirstRealDocumentLoad()) 1121 if (!m_frame->page()
1122 || !view
1123 || !view->layoutViewportScrollableArea()
1124 || !m_currentItem
1125 || !m_stateMachine.committedFirstRealDocumentLoad()
1126 || !documentLoader()) {
1122 return; 1127 return;
1128 }
1123 1129
1124 if (!needsHistoryItemRestore(m_loadType)) 1130 if (!needsHistoryItemRestore(m_loadType))
1125 return; 1131 return;
1126 1132
1127 bool shouldRestoreScroll = m_currentItem->scrollRestorationType() != ScrollR estorationManual; 1133 bool shouldRestoreScroll = m_currentItem->scrollRestorationType() != ScrollR estorationManual;
1128 bool shouldRestoreScale = m_currentItem->pageScaleFactor(); 1134 bool shouldRestoreScale = m_currentItem->pageScaleFactor();
1129 1135
1130 // This tries to balance: 1136 // This tries to balance:
1131 // 1. restoring as soon as possible 1137 // 1. restoring as soon as possible
1132 // 2. not overriding user scroll (TODO(majidvp): also respect user scale) 1138 // 2. not overriding user scroll (TODO(majidvp): also respect user scale)
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 // FIXME: We need a way to propagate insecure requests policy flags to 1553 // FIXME: We need a way to propagate insecure requests policy flags to
1548 // out-of-process frames. For now, we'll always use default behavior. 1554 // out-of-process frames. For now, we'll always use default behavior.
1549 if (!parentFrame->isLocalFrame()) 1555 if (!parentFrame->isLocalFrame())
1550 return nullptr; 1556 return nullptr;
1551 1557
1552 ASSERT(toLocalFrame(parentFrame)->document()); 1558 ASSERT(toLocalFrame(parentFrame)->document());
1553 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1559 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1554 } 1560 }
1555 1561
1556 } // namespace blink 1562 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698