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

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

Issue 2884123002: PlzNavigate: blocked browser-initiated navigations should transfer processes sometimes (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // If the request was canceled by the user do not show an error page. 631 // If the request was canceled by the user do not show an error page.
632 if (net_error == net::ERR_ABORTED) { 632 if (net_error == net::ERR_ABORTED) {
633 frame_tree_node_->ResetNavigationRequest(false, true); 633 frame_tree_node_->ResetNavigationRequest(false, true);
634 return; 634 return;
635 } 635 }
636 636
637 // There are two types of error pages that need to be handled differently. 637 // There are two types of error pages that need to be handled differently.
638 // * Error pages resulting from blocking the request, because the original 638 // * Error pages resulting from blocking the request, because the original
639 // document wasn't even allowed to make the request. In such case, 639 // document wasn't even allowed to make the request. In such case,
640 // the error pages should be committed in the process of the original 640 // the error pages should be committed in the process of the original
641 // document, to avoid creating a process for the destination. 641 // document, to avoid creating a process for the destination.
Charlie Reis 2017/05/16 00:04:27 Let's add something like: This does not include br
642 // * Error pages resulting from either network outage (no network, DNS 642 // * Error pages resulting from either network outage (no network, DNS
643 // error, etc) or similar cases, where the user can reasonably expect that 643 // error, etc) or similar cases, where the user can reasonably expect that
644 // a reload at a later point in time can be successful. Such error pages 644 // a reload at a later point in time can be successful. Such error pages
645 // do belong to the process that will host the destination URL, as a 645 // do belong to the process that will host the destination URL, as a
646 // reload will end up committing in that process anyway. 646 // reload will end up committing in that process anyway.
647 RenderFrameHostImpl* render_frame_host = nullptr; 647 RenderFrameHostImpl* render_frame_host = nullptr;
648 if (net_error == net::ERR_BLOCKED_BY_CLIENT) { 648 if (net_error == net::ERR_BLOCKED_BY_CLIENT && !browser_initiated()) {
649 render_frame_host = frame_tree_node_->current_frame_host(); 649 render_frame_host = frame_tree_node_->current_frame_host();
650 } else { 650 } else {
651 render_frame_host = 651 render_frame_host =
652 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this); 652 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this);
653 } 653 }
654 654
655 // Don't ask the renderer to commit an URL if the browser will kill it when 655 // Don't ask the renderer to commit an URL if the browser will kill it when
656 // it does. 656 // it does.
657 DCHECK(render_frame_host->CanCommitURL(common_params_.url)); 657 DCHECK(render_frame_host->CanCommitURL(common_params_.url));
658 658
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 862 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
863 863
864 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 864 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
865 std::move(handle_), common_params_, 865 std::move(handle_), common_params_,
866 request_params_, is_view_source_); 866 request_params_, is_view_source_);
867 867
868 frame_tree_node_->ResetNavigationRequest(true, true); 868 frame_tree_node_->ResetNavigationRequest(true, true);
869 } 869 }
870 870
871 } // namespace content 871 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698