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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: Rebase, flip was_loading 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 | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 5240 matching lines...) Expand 10 before | Expand all | Expand 10 after
5251 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { 5251 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
5252 // The browser expects this frame to be loading an error page. Inform it 5252 // The browser expects this frame to be loading an error page. Inform it
5253 // that the load stopped. 5253 // that the load stopped.
5254 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 5254 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5255 browser_side_navigation_pending_ = false; 5255 browser_side_navigation_pending_ = false;
5256 return; 5256 return;
5257 } 5257 }
5258 5258
5259 // On load failure, a frame can ask its owner to render fallback content. 5259 // On load failure, a frame can ask its owner to render fallback content.
5260 // When that happens, don't load an error page. 5260 // When that happens, don't load an error page.
5261 bool was_loading = frame_->IsLoading();
5261 if (frame_->MaybeRenderFallbackContent(error)) { 5262 if (frame_->MaybeRenderFallbackContent(error)) {
5263 // If the frame wasn't loading but was fallback-elligible, the fallback
Charlie Reis 2017/04/11 21:08:40 nit: eligible
5264 // content won't be shown. However, showing an error page isn't right
5265 // either, as the frame has already been populated with something unrelated
5266 // to this navigation failure. In that case, just send a stop IPC to the
5267 // browser to unwind its state, and leave the frame as-is.
Charlie Reis 2017/04/11 21:08:40 Sorry, I'm getting confused by this comment and me
Nate Chapin 2017/04/12 21:58:01 I don't really like having two separate public/ AP
5268 if (!was_loading)
5269 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5262 browser_side_navigation_pending_ = false; 5270 browser_side_navigation_pending_ = false;
5263 return; 5271 return;
5264 } 5272 }
5265 5273
5266 // Make sure errors are not shown in view source mode. 5274 // Make sure errors are not shown in view source mode.
5267 frame_->EnableViewSourceMode(false); 5275 frame_->EnableViewSourceMode(false);
5268 5276
5269 // Replace the current history entry in reloads, and loads of the same url. 5277 // Replace the current history entry in reloads, and loads of the same url.
5270 // This corresponds to Blink's notion of a standard commit. 5278 // This corresponds to Blink's notion of a standard commit.
5271 // Also replace the current history entry if the browser asked for it 5279 // Also replace the current history entry if the browser asked for it
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
6961 policy(info.default_policy), 6969 policy(info.default_policy),
6962 replaces_current_history_item(info.replaces_current_history_item), 6970 replaces_current_history_item(info.replaces_current_history_item),
6963 history_navigation_in_new_child_frame( 6971 history_navigation_in_new_child_frame(
6964 info.is_history_navigation_in_new_child_frame), 6972 info.is_history_navigation_in_new_child_frame),
6965 client_redirect(info.is_client_redirect), 6973 client_redirect(info.is_client_redirect),
6966 cache_disabled(info.is_cache_disabled), 6974 cache_disabled(info.is_cache_disabled),
6967 form(info.form), 6975 form(info.form),
6968 source_location(info.source_location) {} 6976 source_location(info.source_location) {}
6969 6977
6970 } // namespace content 6978 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698