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

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

Issue 2475693002: Do not reset NavigationHandle when navigating same-page (Closed)
Patch Set: Created 4 years, 1 month 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 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 // Update the data source's request with the new URL to fake the URL change 769 // Update the data source's request with the new URL to fake the URL change
770 m_frame->document()->setURL(newURL); 770 m_frame->document()->setURL(newURL);
771 documentLoader()->setReplacesCurrentHistoryItem(type != 771 documentLoader()->setReplacesCurrentHistoryItem(type !=
772 FrameLoadTypeStandard); 772 FrameLoadTypeStandard);
773 documentLoader()->updateForSameDocumentNavigation( 773 documentLoader()->updateForSameDocumentNavigation(
774 newURL, sameDocumentNavigationSource); 774 newURL, sameDocumentNavigationSource);
775 775
776 // Generate start and stop notifications only when loader is completed so that 776 // Generate start and stop notifications only when loader is completed so that
777 // we don't fire them for fragment redirection that happens in window.onload 777 // we don't fire them for fragment redirection that happens in window.onload
778 // handler. See https://bugs.webkit.org/show_bug.cgi?id=31838 778 // handler. See https://bugs.webkit.org/show_bug.cgi?id=31838
779 if (m_frame->document()->loadEventFinished()) 779 if (m_frame->document()->loadEventFinished() && !m_provisionalDocumentLoader)
Charlie Reis 2016/11/03 22:02:22 I'm curious-- how is this related to the rest of t
clamy 2016/11/04 14:18:21 Without it, we still delete the NavigationHandle o
Charlie Reis 2016/11/04 17:30:53 Acknowledged.
780 client()->didStartLoading(NavigationWithinSameDocument); 780 client()->didStartLoading(NavigationWithinSameDocument);
781 781
782 HistoryCommitType historyCommitType = loadTypeToCommitType(type); 782 HistoryCommitType historyCommitType = loadTypeToCommitType(type);
783 if (!m_currentItem) 783 if (!m_currentItem)
784 historyCommitType = HistoryInertCommit; 784 historyCommitType = HistoryInertCommit;
785 if (m_frame->settings()->historyEntryRequiresUserGesture() && 785 if (m_frame->settings()->historyEntryRequiresUserGesture() &&
786 initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) { 786 initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) {
787 historyCommitType = HistoryInertCommit; 787 historyCommitType = HistoryInertCommit;
788 } 788 }
789 789
790 setHistoryItemStateForCommit( 790 setHistoryItemStateForCommit(
791 type, historyCommitType, 791 type, historyCommitType,
792 sameDocumentNavigationSource == SameDocumentNavigationHistoryApi 792 sameDocumentNavigationSource == SameDocumentNavigationHistoryApi
793 ? HistoryNavigationType::HistoryApi 793 ? HistoryNavigationType::HistoryApi
794 : HistoryNavigationType::Fragment); 794 : HistoryNavigationType::Fragment);
795 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) { 795 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) {
796 m_currentItem->setStateObject(std::move(data)); 796 m_currentItem->setStateObject(std::move(data));
797 m_currentItem->setScrollRestorationType(scrollRestorationType); 797 m_currentItem->setScrollRestorationType(scrollRestorationType);
798 } 798 }
799 client()->dispatchDidNavigateWithinPage( 799 client()->dispatchDidNavigateWithinPage(
800 m_currentItem.get(), historyCommitType, !!initiatingDocument); 800 m_currentItem.get(), historyCommitType, !!initiatingDocument);
801 client()->dispatchDidReceiveTitle(m_frame->document()->title()); 801 client()->dispatchDidReceiveTitle(m_frame->document()->title());
802 if (m_frame->document()->loadEventFinished()) 802 if (m_frame->document()->loadEventFinished() && !m_provisionalDocumentLoader)
803 client()->didStopLoading(); 803 client()->didStopLoading();
804 } 804 }
805 805
806 void FrameLoader::detachDocumentLoader(Member<DocumentLoader>& loader) { 806 void FrameLoader::detachDocumentLoader(Member<DocumentLoader>& loader) {
807 if (!loader) 807 if (!loader)
808 return; 808 return;
809 809
810 FrameNavigationDisabler navigationDisabler(*m_frame); 810 FrameNavigationDisabler navigationDisabler(*m_frame);
811 loader->detachFromFrame(); 811 loader->detachFromFrame();
812 loader = nullptr; 812 loader = nullptr;
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 m_documentLoader ? m_documentLoader->url() : String()); 1926 m_documentLoader ? m_documentLoader->url() : String());
1927 return tracedValue; 1927 return tracedValue;
1928 } 1928 }
1929 1929
1930 inline void FrameLoader::takeObjectSnapshot() const { 1930 inline void FrameLoader::takeObjectSnapshot() const {
1931 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1931 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1932 toTracedValue()); 1932 toTracedValue());
1933 } 1933 }
1934 1934
1935 } // namespace blink 1935 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698