OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/frame_host/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 565 |
566 // If the request was canceled by the user do not show an error page. | 566 // If the request was canceled by the user do not show an error page. |
567 if (net_error == net::ERR_ABORTED) { | 567 if (net_error == net::ERR_ABORTED) { |
568 frame_tree_node_->ResetNavigationRequest(false); | 568 frame_tree_node_->ResetNavigationRequest(false); |
569 return; | 569 return; |
570 } | 570 } |
571 | 571 |
572 // Select an appropriate renderer to show the error page. | 572 // Select an appropriate renderer to show the error page. |
573 RenderFrameHostImpl* render_frame_host = | 573 RenderFrameHostImpl* render_frame_host = |
574 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this); | 574 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this); |
| 575 |
| 576 // Don't ask the renderer to commit an URL if the browser will kill it when |
| 577 // it does. |
| 578 if (!render_frame_host->CanCommitURL(common_params_.url)) { |
| 579 // TODO(alexmos, mkwst, arthursonzogni): This code should be replaced by |
| 580 // UNREACHED() once the error pages are refactored. |
| 581 // See crbug.com/588314 and crbug.com/622385. |
| 582 common_params_.url = GURL(kUnreachableWebDataURL); |
| 583 } |
| 584 |
575 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, | 585 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, |
576 common_params_.url); | 586 common_params_.url); |
577 | 587 |
578 TransferNavigationHandleOwnership(render_frame_host); | 588 TransferNavigationHandleOwnership(render_frame_host); |
579 render_frame_host->navigation_handle()->ReadyToCommitNavigation( | 589 render_frame_host->navigation_handle()->ReadyToCommitNavigation( |
580 render_frame_host); | 590 render_frame_host); |
581 render_frame_host->FailedNavigation(common_params_, request_params_, | 591 render_frame_host->FailedNavigation(common_params_, request_params_, |
582 has_stale_copy_in_cache, net_error); | 592 has_stale_copy_in_cache, net_error); |
583 } | 593 } |
584 | 594 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 773 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
764 | 774 |
765 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 775 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
766 common_params_, request_params_, | 776 common_params_, request_params_, |
767 is_view_source_); | 777 is_view_source_); |
768 | 778 |
769 frame_tree_node_->ResetNavigationRequest(true); | 779 frame_tree_node_->ResetNavigationRequest(true); |
770 } | 780 } |
771 | 781 |
772 } // namespace content | 782 } // namespace content |
OLD | NEW |