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

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

Issue 138213002: Fix crash when popstate handler detaches frame during history navigation (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
« no previous file with comments | « LayoutTests/fast/loader/stateobjects/resources/pushstate-in-iframe-child.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 8cf4eda5bef57170110d5b9ed49caa1632dcc949..5a1c11beb9ed99d0961872f6ede8e0e92527dae7 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1410,6 +1410,9 @@ void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad
{
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;
« no previous file with comments | « LayoutTests/fast/loader/stateobjects/resources/pushstate-in-iframe-child.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698