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

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

Issue 2889703002: Ensure that all code paths which call FrameTreeNode::ResetNavigationRequest set NavigationHandle::G… (Closed)
Patch Set: review comments Created 3 years, 7 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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 referrer, page_transition, global_request_id, 413 referrer, page_transition, global_request_id,
414 should_replace_current_entry, 414 should_replace_current_entry,
415 transfer_navigation_handle_->IsPost() ? "POST" : "GET", 415 transfer_navigation_handle_->IsPost() ? "POST" : "GET",
416 transfer_navigation_handle_->resource_request_body(), extra_headers); 416 transfer_navigation_handle_->resource_request_body(), extra_headers);
417 417
418 // If the navigation continued, the NavigationHandle should have been 418 // If the navigation continued, the NavigationHandle should have been
419 // transfered to a RenderFrameHost. In the other cases, it should be cleared. 419 // transfered to a RenderFrameHost. In the other cases, it should be cleared.
420 // If the NavigationHandle wasn't claimed, this will lead to the cancelation 420 // If the NavigationHandle wasn't claimed, this will lead to the cancelation
421 // of the request in the network stack. 421 // of the request in the network stack.
422 if (transfer_navigation_handle_) { 422 if (transfer_navigation_handle_) {
423 transfer_navigation_handle_->set_net_error_code(net::ERR_ABORTED);
423 transfer_navigation_handle_->set_is_transferring(false); 424 transfer_navigation_handle_->set_is_transferring(false);
424 transfer_navigation_handle_.reset(); 425 transfer_navigation_handle_.reset();
425 } 426 }
426 427
427 // If the navigation in the new renderer did not start, inform the 428 // If the navigation in the new renderer did not start, inform the
428 // FrameTreeNode that it stopped loading. 429 // FrameTreeNode that it stopped loading.
429 if (!frame_tree_node_->IsLoading() && frame_tree_node_was_loading) 430 if (!frame_tree_node_->IsLoading() && frame_tree_node_was_loading)
430 frame_tree_node_->DidStopLoading(); 431 frame_tree_node_->DidStopLoading();
431 } 432 }
432 433
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 GetRenderFrameProxyHost(instance)->set_render_frame_proxy_created(false); 1002 GetRenderFrameProxyHost(instance)->set_render_frame_proxy_created(false);
1002 } 1003 }
1003 1004
1004 void RenderFrameHostManager::CancelPendingIfNecessary( 1005 void RenderFrameHostManager::CancelPendingIfNecessary(
1005 RenderFrameHostImpl* render_frame_host) { 1006 RenderFrameHostImpl* render_frame_host) {
1006 if (render_frame_host == pending_render_frame_host_.get()) 1007 if (render_frame_host == pending_render_frame_host_.get())
1007 CancelPending(); 1008 CancelPending();
1008 else if (render_frame_host == speculative_render_frame_host_.get()) { 1009 else if (render_frame_host == speculative_render_frame_host_.get()) {
1009 // TODO(nasko, clamy): This should just clean up the speculative RFH 1010 // TODO(nasko, clamy): This should just clean up the speculative RFH
1010 // without canceling the request. See https://crbug.com/636119. 1011 // without canceling the request. See https://crbug.com/636119.
1012 if (frame_tree_node_->navigation_request() &&
1013 frame_tree_node_->navigation_request()->navigation_handle()) {
1014 frame_tree_node_->navigation_request()
1015 ->navigation_handle()
1016 ->set_net_error_code(net::ERR_ABORTED);
1017 }
1011 frame_tree_node_->ResetNavigationRequest(false, true); 1018 frame_tree_node_->ResetNavigationRequest(false, true);
1012 } 1019 }
1013 } 1020 }
1014 1021
1015 void RenderFrameHostManager::OnSetHasReceivedUserGesture() { 1022 void RenderFrameHostManager::OnSetHasReceivedUserGesture() {
1016 for (const auto& pair : proxy_hosts_) { 1023 for (const auto& pair : proxy_hosts_) {
1017 pair.second->Send( 1024 pair.second->Send(
1018 new FrameMsg_SetHasReceivedUserGesture(pair.second->GetRoutingID())); 1025 new FrameMsg_SetHasReceivedUserGesture(pair.second->GetRoutingID()));
1019 } 1026 }
1020 } 1027 }
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2828 delegate_->IsHidden()) { 2835 delegate_->IsHidden()) {
2829 if (delegate_->IsHidden()) { 2836 if (delegate_->IsHidden()) {
2830 render_frame_host_->GetView()->Hide(); 2837 render_frame_host_->GetView()->Hide();
2831 } else { 2838 } else {
2832 render_frame_host_->GetView()->Show(); 2839 render_frame_host_->GetView()->Show();
2833 } 2840 }
2834 } 2841 }
2835 } 2842 }
2836 2843
2837 } // namespace content 2844 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698