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

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

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: Fix comments 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.h » ('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 5252 matching lines...) Expand 10 before | Expand all | Expand 10 after
5263 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { 5263 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
5264 // The browser expects this frame to be loading an error page. Inform it 5264 // The browser expects this frame to be loading an error page. Inform it
5265 // that the load stopped. 5265 // that the load stopped.
5266 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 5266 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5267 browser_side_navigation_pending_ = false; 5267 browser_side_navigation_pending_ = false;
5268 return; 5268 return;
5269 } 5269 }
5270 5270
5271 // On load failure, a frame can ask its owner to render fallback content. 5271 // On load failure, a frame can ask its owner to render fallback content.
5272 // When that happens, don't load an error page. 5272 // When that happens, don't load an error page.
5273 if (frame_->MaybeRenderFallbackContent(error)) { 5273 WebLocalFrame::FallbackContentResult fallback_result =
5274 frame_->MaybeRenderFallbackContent(error);
5275 if (fallback_result != WebLocalFrame::NoFallbackContent) {
5276 if (fallback_result == WebLocalFrame::NoLoadInProgress) {
5277 // If the frame wasn't loading but was fallback-eligible, the fallback
5278 // content won't be shown. However, showing an error page isn't right
5279 // either, as the frame has already been populated with something
5280 // unrelated to this navigation failure. In that case, just send a stop
5281 // IPC to the browser to unwind its state, and leave the frame as-is.
5282 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5283 }
5274 browser_side_navigation_pending_ = false; 5284 browser_side_navigation_pending_ = false;
5275 return; 5285 return;
5276 } 5286 }
5277 5287
5278 // Make sure errors are not shown in view source mode. 5288 // Make sure errors are not shown in view source mode.
5279 frame_->EnableViewSourceMode(false); 5289 frame_->EnableViewSourceMode(false);
5280 5290
5281 // Replace the current history entry in reloads, and loads of the same url. 5291 // Replace the current history entry in reloads, and loads of the same url.
5282 // This corresponds to Blink's notion of a standard commit. 5292 // This corresponds to Blink's notion of a standard commit.
5283 // Also replace the current history entry if the browser asked for it 5293 // Also replace the current history entry if the browser asked for it
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
6973 policy(info.default_policy), 6983 policy(info.default_policy),
6974 replaces_current_history_item(info.replaces_current_history_item), 6984 replaces_current_history_item(info.replaces_current_history_item),
6975 history_navigation_in_new_child_frame( 6985 history_navigation_in_new_child_frame(
6976 info.is_history_navigation_in_new_child_frame), 6986 info.is_history_navigation_in_new_child_frame),
6977 client_redirect(info.is_client_redirect), 6987 client_redirect(info.is_client_redirect),
6978 cache_disabled(info.is_cache_disabled), 6988 cache_disabled(info.is_cache_disabled),
6979 form(info.form), 6989 form(info.form),
6980 source_location(info.source_location) {} 6990 source_location(info.source_location) {}
6981 6991
6982 } // namespace content 6992 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698