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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: enum-ify MaybeRenderFallbackContent 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f67f5c53fe22700e41cf783b81aad5be84e4d395..c3a0fea0f6168e7f72ad44cd8f21ced3910d10c2 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5258,7 +5258,17 @@ void RenderFrameImpl::OnFailedNavigation(
// On load failure, a frame can ask its owner to render fallback content.
// When that happens, don't load an error page.
- if (frame_->MaybeRenderFallbackContent(error)) {
+ WebLocalFrame::FallbackContentResult fallback_result =
+ frame_->MaybeRenderFallbackContent(error);
+ if (fallback_result != WebLocalFrame::NoFallbackContent) {
+ if (fallback_result == WebLocalFrame::NoLoadInProgress) {
+ // If the frame wasn't loading but was fallback-elligible, the fallback
Charlie Reis 2017/04/12 22:05:22 nit: eligible
Nate Chapin 2017/04/13 17:32:21 Done.
+ // content won't be shown. However, showing an error page isn't right
+ // either, as the frame has already been populated with something
+ // unrelated to this navigation failure. In that case, just send a stop
+ // IPC to the browser to unwind its state, and leave the frame as-is.
+ Send(new FrameHostMsg_DidStopLoading(routing_id_));
+ }
browser_side_navigation_pending_ = false;
return;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.h » ('j') | third_party/WebKit/public/web/WebLocalFrame.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698