Chromium Code Reviews| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 RenderFrameHostImpl* render_frame_host = nullptr; | 608 RenderFrameHostImpl* render_frame_host = nullptr; |
| 609 if (net_error == net::ERR_BLOCKED_BY_CLIENT) { | 609 if (net_error == net::ERR_BLOCKED_BY_CLIENT) { |
| 610 render_frame_host = frame_tree_node_->current_frame_host(); | 610 render_frame_host = frame_tree_node_->current_frame_host(); |
| 611 } else { | 611 } else { |
| 612 render_frame_host = | 612 render_frame_host = |
| 613 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this); | 613 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this); |
| 614 } | 614 } |
| 615 | 615 |
| 616 // Don't ask the renderer to commit an URL if the browser will kill it when | 616 // Don't ask the renderer to commit an URL if the browser will kill it when |
| 617 // it does. | 617 // it does. |
| 618 DCHECK(render_frame_host->CanCommitURL(common_params_.url)); | 618 if (!render_frame_host->CanCommitURL(common_params_.url)) { |
| 619 // TODO(arthursonzogni, alexmos): This code should be replaced by | |
| 620 // UNREACHED() once the error pages are refactored. | |
| 621 // See crbug.com/588314 and crbug.com/622385. | |
| 622 common_params_.url = GURL(kUnreachableWebDataURL); | |
|
nasko
2017/03/22 17:35:22
This is not something we should do. Charlie, Alex
| |
| 623 } | |
| 619 | 624 |
| 620 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, | 625 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, |
| 621 common_params_.url); | 626 common_params_.url); |
| 622 | 627 |
| 623 TransferNavigationHandleOwnership(render_frame_host); | 628 TransferNavigationHandleOwnership(render_frame_host); |
| 624 render_frame_host->navigation_handle()->ReadyToCommitNavigation( | 629 render_frame_host->navigation_handle()->ReadyToCommitNavigation( |
| 625 render_frame_host); | 630 render_frame_host); |
| 626 render_frame_host->FailedNavigation(common_params_, begin_params_, | 631 render_frame_host->FailedNavigation(common_params_, begin_params_, |
| 627 request_params_, has_stale_copy_in_cache, | 632 request_params_, has_stale_copy_in_cache, |
| 628 net_error); | 633 net_error); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 823 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 828 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
| 824 | 829 |
| 825 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 830 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 826 common_params_, request_params_, | 831 common_params_, request_params_, |
| 827 is_view_source_); | 832 is_view_source_); |
| 828 | 833 |
| 829 frame_tree_node_->ResetNavigationRequest(true); | 834 frame_tree_node_->ResetNavigationRequest(true); |
| 830 } | 835 } |
| 831 | 836 |
| 832 } // namespace content | 837 } // namespace content |
| OLD | NEW |