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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2697713005: DCHECK: Browser asking renderer to commit URLs it is not allowed to. (Closed)
Patch Set: I forgot to remove the change in render_frame_impl Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 05bf13973d4ea29511853be2075fda1b88a4e29c..c0af6ad4e00cc10c1ad3e6e516a1941519e0d97f 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2765,8 +2765,22 @@ void RenderFrameHostImpl::FailedNavigation(
// completing an unload handler.
ResetWaitingState();
- Send(new FrameMsg_FailedNavigation(routing_id_, common_params, request_params,
- has_stale_copy_in_cache, error_code));
+ // Don't ask the renderer to commit an URL if the browser will decide to kill
clamy 2017/02/16 13:45:59 nit: s/will decide to kill it if it does/will kill
+ // it if it does.
+ if (!CanCommitURL(common_params.url)) {
+ // TODO(alexmos, mkwst, arthursonzogni): This code could be replaced by
+ // UNREACHED() once the error pages are refactored.
+ // See crbug.com/588314 and crbug.com/622385.
+ CommonNavigationParams new_common_params;
clamy 2017/02/16 13:45:59 These CommonNavigationParams are badly initialized
arthursonzogni 2017/02/17 09:33:19 I wanted to be sure that any traces of the previou
clamy 2017/02/21 15:32:25 I see. Then we should move this code to Navigation
+ new_common_params.url = GURL(kUnreachableWebDataURL);
+ Send(new FrameMsg_FailedNavigation(routing_id_, new_common_params,
+ RequestNavigationParams(), false,
+ error_code));
+ } else {
+ Send(new FrameMsg_FailedNavigation(routing_id_, common_params,
+ request_params, has_stale_copy_in_cache,
+ error_code));
+ }
// An error page is expected to commit, hence why is_loading_ is set to true.
is_loading_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698