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

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 145493005: Keep frames to navigate alive in HistoryController::goToEntry() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 06bbce3a01c3016cfc61bb863ccc570c8d8bead5..2a9a2ebde74734805bd245b46a1e3d7c4bfee22b 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1405,11 +1405,12 @@ Frame* FrameLoader::findFrameForNavigation(const AtomicString& name, Document* a
void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoadType, ResourceRequestCachePolicy cachePolicy)
{
+ // The frame may have been detached by a pageshow/popstate event handler.
+ if (!m_client)
+ return;
+
m_provisionalItem = item;
if (historyLoadType == HistorySameDocumentLoad) {
- // loadInSameDocument() might (indirectly) dispatch events, which could lead to the frame being
- // detached, so protect it.
- RefPtr<Frame> protect(m_frame);
loadInSameDocument(item->url(), item->stateObject(), DoNotUpdateBackForwardList, NotClientRedirect);
restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNavigation);
return;

Powered by Google App Engine
This is Rietveld 408576698