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

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

Issue 2780953002: When historyEntryRequiresUserGesture is enabled, exempt docs that have been committed for 5 seconds (Closed)
Patch Set: Address ojan's comments Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 if (!request.originDocument()) 708 if (!request.originDocument())
709 return FrameLoadTypeReload; 709 return FrameLoadTypeReload;
710 return FrameLoadTypeReplaceCurrentItem; 710 return FrameLoadTypeReplaceCurrentItem;
711 } 711 }
712 712
713 if (request.substituteData().failingURL() == 713 if (request.substituteData().failingURL() ==
714 m_documentLoader->urlForHistory() && 714 m_documentLoader->urlForHistory() &&
715 m_documentLoader->loadType() == FrameLoadTypeReload) 715 m_documentLoader->loadType() == FrameLoadTypeReload)
716 return FrameLoadTypeReload; 716 return FrameLoadTypeReload;
717 717
718 if (m_frame->settings()->getHistoryEntryRequiresUserGesture() && 718 if (request.originDocument() &&
719 request.originDocument() && 719 !request.originDocument()->canCreateHistoryEntry())
720 !request.originDocument()->frame()->hasReceivedUserGesture())
721 return FrameLoadTypeReplaceCurrentItem; 720 return FrameLoadTypeReplaceCurrentItem;
722 721
723 if (request.resourceRequest().url().isEmpty() && 722 if (request.resourceRequest().url().isEmpty() &&
724 request.substituteData().failingURL().isEmpty()) { 723 request.substituteData().failingURL().isEmpty()) {
725 return FrameLoadTypeReplaceCurrentItem; 724 return FrameLoadTypeReplaceCurrentItem;
726 } 725 }
727 726
728 return FrameLoadTypeStandard; 727 return FrameLoadTypeStandard;
729 } 728 }
730 729
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 // TODO(japhet): This is needed because the browser process DCHECKs if the 1750 // TODO(japhet): This is needed because the browser process DCHECKs if the
1752 // first entry we commit in a new frame has replacement set. It's unclear 1751 // first entry we commit in a new frame has replacement set. It's unclear
1753 // whether the DCHECK is right, investigate removing this special case. 1752 // whether the DCHECK is right, investigate removing this special case.
1754 bool replaceCurrentItem = loadType == FrameLoadTypeReplaceCurrentItem && 1753 bool replaceCurrentItem = loadType == FrameLoadTypeReplaceCurrentItem &&
1755 (!opener() || !request.url().isEmpty()); 1754 (!opener() || !request.url().isEmpty());
1756 loader->setReplacesCurrentHistoryItem(replaceCurrentItem); 1755 loader->setReplacesCurrentHistoryItem(replaceCurrentItem);
1757 return loader; 1756 return loader;
1758 } 1757 }
1759 1758
1760 } // namespace blink 1759 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698