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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2720543002: Fix headless_browsertests failures with PlzNavigate. (Closed)
Patch Set: review comments Created 3 years, 9 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
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/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 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 // also not stored in the FrameTreeNode. Therefore do not reset it, as this 2693 // also not stored in the FrameTreeNode. Therefore do not reset it, as this
2694 // could cancel an existing pending navigation. 2694 // could cancel an existing pending navigation.
2695 if (!IsRendererDebugURL(common_params.url)) { 2695 if (!IsRendererDebugURL(common_params.url)) {
2696 pending_commit_ = true; 2696 pending_commit_ = true;
2697 is_loading_ = true; 2697 is_loading_ = true;
2698 } 2698 }
2699 } 2699 }
2700 2700
2701 void RenderFrameHostImpl::FailedNavigation( 2701 void RenderFrameHostImpl::FailedNavigation(
2702 const CommonNavigationParams& common_params, 2702 const CommonNavigationParams& common_params,
2703 const BeginNavigationParams& begin_params,
2703 const RequestNavigationParams& request_params, 2704 const RequestNavigationParams& request_params,
2704 bool has_stale_copy_in_cache, 2705 bool has_stale_copy_in_cache,
2705 int error_code) { 2706 int error_code) {
2706 // Update renderer permissions even for failed commits, so that for example 2707 // Update renderer permissions even for failed commits, so that for example
2707 // the URL bar correctly displays privileged URLs instead of filtering them. 2708 // the URL bar correctly displays privileged URLs instead of filtering them.
2708 UpdatePermissionsForNavigation(common_params, request_params); 2709 UpdatePermissionsForNavigation(common_params, request_params);
2709 2710
2710 // Get back to a clean state, in case a new navigation started without 2711 // Get back to a clean state, in case a new navigation started without
2711 // completing an unload handler. 2712 // completing an unload handler.
2712 ResetWaitingState(); 2713 ResetWaitingState();
2713 2714
2714 Send(new FrameMsg_FailedNavigation(routing_id_, common_params, request_params, 2715 Send(new FrameMsg_FailedNavigation(routing_id_, common_params, request_params,
2715 has_stale_copy_in_cache, error_code)); 2716 has_stale_copy_in_cache, error_code));
2716 2717
2718 RenderFrameDevToolsAgentHost::OnFailedNavigation(
2719 this, common_params, begin_params, static_cast<net::Error>(error_code));
2720
2717 // An error page is expected to commit, hence why is_loading_ is set to true. 2721 // An error page is expected to commit, hence why is_loading_ is set to true.
2718 is_loading_ = true; 2722 is_loading_ = true;
2719 frame_tree_node_->ResetNavigationRequest(true); 2723 frame_tree_node_->ResetNavigationRequest(true);
2720 } 2724 }
2721 2725
2722 void RenderFrameHostImpl::SetUpMojoIfNeeded() { 2726 void RenderFrameHostImpl::SetUpMojoIfNeeded() {
2723 if (interface_registry_.get()) 2727 if (interface_registry_.get())
2724 return; 2728 return;
2725 2729
2726 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( 2730 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>(
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3447 // There is no pending NavigationEntry in these cases, so pass 0 as the 3451 // There is no pending NavigationEntry in these cases, so pass 0 as the
3448 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3452 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3449 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3453 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3450 return NavigationHandleImpl::Create( 3454 return NavigationHandleImpl::Create(
3451 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, 3455 params.url, params.redirects, frame_tree_node_, is_renderer_initiated,
3452 params.was_within_same_page, base::TimeTicks::Now(), 3456 params.was_within_same_page, base::TimeTicks::Now(),
3453 entry_id_for_data_nav, false); // started_from_context_menu 3457 entry_id_for_data_nav, false); // started_from_context_menu
3454 } 3458 }
3455 3459
3456 } // namespace content 3460 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | headless/lib/embedder_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698