OLD | NEW |
---|---|
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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2758 bool has_stale_copy_in_cache, | 2758 bool has_stale_copy_in_cache, |
2759 int error_code) { | 2759 int error_code) { |
2760 // Update renderer permissions even for failed commits, so that for example | 2760 // Update renderer permissions even for failed commits, so that for example |
2761 // the URL bar correctly displays privileged URLs instead of filtering them. | 2761 // the URL bar correctly displays privileged URLs instead of filtering them. |
2762 UpdatePermissionsForNavigation(common_params, request_params); | 2762 UpdatePermissionsForNavigation(common_params, request_params); |
2763 | 2763 |
2764 // Get back to a clean state, in case a new navigation started without | 2764 // Get back to a clean state, in case a new navigation started without |
2765 // completing an unload handler. | 2765 // completing an unload handler. |
2766 ResetWaitingState(); | 2766 ResetWaitingState(); |
2767 | 2767 |
2768 Send(new FrameMsg_FailedNavigation(routing_id_, common_params, request_params, | 2768 // 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
| |
2769 has_stale_copy_in_cache, error_code)); | 2769 // it if it does. |
2770 if (!CanCommitURL(common_params.url)) { | |
2771 // TODO(alexmos, mkwst, arthursonzogni): This code could be replaced by | |
2772 // UNREACHED() once the error pages are refactored. | |
2773 // See crbug.com/588314 and crbug.com/622385. | |
2774 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
| |
2775 new_common_params.url = GURL(kUnreachableWebDataURL); | |
2776 Send(new FrameMsg_FailedNavigation(routing_id_, new_common_params, | |
2777 RequestNavigationParams(), false, | |
2778 error_code)); | |
2779 } else { | |
2780 Send(new FrameMsg_FailedNavigation(routing_id_, common_params, | |
2781 request_params, has_stale_copy_in_cache, | |
2782 error_code)); | |
2783 } | |
2770 | 2784 |
2771 // An error page is expected to commit, hence why is_loading_ is set to true. | 2785 // An error page is expected to commit, hence why is_loading_ is set to true. |
2772 is_loading_ = true; | 2786 is_loading_ = true; |
2773 frame_tree_node_->ResetNavigationRequest(true); | 2787 frame_tree_node_->ResetNavigationRequest(true); |
2774 } | 2788 } |
2775 | 2789 |
2776 void RenderFrameHostImpl::SetUpMojoIfNeeded() { | 2790 void RenderFrameHostImpl::SetUpMojoIfNeeded() { |
2777 if (interface_registry_.get()) | 2791 if (interface_registry_.get()) |
2778 return; | 2792 return; |
2779 | 2793 |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3506 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3520 // There is no pending NavigationEntry in these cases, so pass 0 as the |
3507 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3521 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3508 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3522 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3509 return NavigationHandleImpl::Create( | 3523 return NavigationHandleImpl::Create( |
3510 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, | 3524 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, |
3511 params.was_within_same_page, base::TimeTicks::Now(), | 3525 params.was_within_same_page, base::TimeTicks::Now(), |
3512 entry_id_for_data_nav, false); // started_from_context_menu | 3526 entry_id_for_data_nav, false); // started_from_context_menu |
3513 } | 3527 } |
3514 | 3528 |
3515 } // namespace content | 3529 } // namespace content |
OLD | NEW |