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

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

Issue 326073007: Fix for crash in restoreScrollPositionAndViewState (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« 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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 bool canRestoreWithoutAnnoyingUser = !view->wasScrolledByUser() && (canResto reWithoutClamping || m_state == FrameStateComplete); 1028 bool canRestoreWithoutAnnoyingUser = !view->wasScrolledByUser() && (canResto reWithoutClamping || m_state == FrameStateComplete);
1029 if (!canRestoreWithoutAnnoyingUser) 1029 if (!canRestoreWithoutAnnoyingUser)
1030 return; 1030 return;
1031 1031
1032 if (m_frame->isMainFrame() && m_currentItem->pageScaleFactor()) { 1032 if (m_frame->isMainFrame() && m_currentItem->pageScaleFactor()) {
1033 FloatPoint pinchViewportOffset(m_currentItem->pinchViewportScrollPoint() ); 1033 FloatPoint pinchViewportOffset(m_currentItem->pinchViewportScrollPoint() );
1034 IntPoint frameScrollOffset(m_currentItem->scrollPoint()); 1034 IntPoint frameScrollOffset(m_currentItem->scrollPoint());
1035 1035
1036 m_frame->page()->setPageScaleFactor(m_currentItem->pageScaleFactor(), fr ameScrollOffset); 1036 m_frame->page()->setPageScaleFactor(m_currentItem->pageScaleFactor(), fr ameScrollOffset);
1037 1037
1038 if (m_frame->document()->settings()->pinchVirtualViewportEnabled()) { 1038 if (m_frame->settings()->pinchVirtualViewportEnabled()) {
1039 // If the pinch viewport's offset is (-1, -1) it means the history i tem 1039 // If the pinch viewport's offset is (-1, -1) it means the history i tem
1040 // is an old version of HistoryItem so distribute the scroll between 1040 // is an old version of HistoryItem so distribute the scroll between
1041 // the main frame and the pinch viewport as best as we can. 1041 // the main frame and the pinch viewport as best as we can.
1042 // FIXME(bokan): This legacy distribution can be removed once the vi rtual viewport 1042 // FIXME(bokan): This legacy distribution can be removed once the vi rtual viewport
1043 // pinch path is enabled on all platforms for at least one release. 1043 // pinch path is enabled on all platforms for at least one release.
1044 if (pinchViewportOffset.x() == -1 && pinchViewportOffset.y() == -1) 1044 if (pinchViewportOffset.x() == -1 && pinchViewportOffset.y() == -1)
1045 pinchViewportOffset = FloatPoint(frameScrollOffset - view->scrol lPosition()); 1045 pinchViewportOffset = FloatPoint(frameScrollOffset - view->scrol lPosition());
1046 1046
1047 m_frame->host()->pinchViewport().setLocation(pinchViewportOffset); 1047 m_frame->host()->pinchViewport().setLocation(pinchViewportOffset);
1048 } 1048 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. 1469 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1470 Frame* parentFrame = m_frame->tree().parent(); 1470 Frame* parentFrame = m_frame->tree().parent();
1471 if (parentFrame && parentFrame->isLocalFrame()) 1471 if (parentFrame && parentFrame->isLocalFrame())
1472 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); 1472 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
1473 if (FrameOwner* frameOwner = m_frame->owner()) 1473 if (FrameOwner* frameOwner = m_frame->owner())
1474 flags |= frameOwner->sandboxFlags(); 1474 flags |= frameOwner->sandboxFlags();
1475 return flags; 1475 return flags;
1476 } 1476 }
1477 1477
1478 } // namespace WebCore 1478 } // namespace WebCore
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