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

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

Issue 2549373004: PlzNavigate: Call NavigationHandle::WillProcessResponse for 204/205s (Closed)
Patch Set: Rebase + addressed comments Created 3 years, 12 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 | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include "base/debug/dump_without_crashing.h" 7 #include "base/debug/dump_without_crashing.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/appcache/appcache_navigation_handle.h" 9 #include "content/browser/appcache/appcache_navigation_handle.h"
10 #include "content/browser/appcache/appcache_service_impl.h" 10 #include "content/browser/appcache/appcache_service_impl.h"
(...skipping 10 matching lines...) Expand all
21 #include "content/browser/service_worker/service_worker_navigation_handle.h" 21 #include "content/browser/service_worker/service_worker_navigation_handle.h"
22 #include "content/common/frame_messages.h" 22 #include "content/common/frame_messages.h"
23 #include "content/common/resource_request_body_impl.h" 23 #include "content/common/resource_request_body_impl.h"
24 #include "content/common/site_isolation_policy.h" 24 #include "content/common/site_isolation_policy.h"
25 #include "content/public/browser/content_browser_client.h" 25 #include "content/public/browser/content_browser_client.h"
26 #include "content/public/browser/navigation_ui_data.h" 26 #include "content/public/browser/navigation_ui_data.h"
27 #include "content/public/browser/site_instance.h" 27 #include "content/public/browser/site_instance.h"
28 #include "content/public/common/browser_side_navigation_policy.h" 28 #include "content/public/common/browser_side_navigation_policy.h"
29 #include "content/public/common/content_client.h" 29 #include "content/public/common/content_client.h"
30 #include "content/public/common/url_constants.h" 30 #include "content/public/common/url_constants.h"
31 #include "net/base/net_errors.h"
31 #include "net/url_request/redirect_info.h" 32 #include "net/url_request/redirect_info.h"
32 #include "url/gurl.h" 33 #include "url/gurl.h"
33 #include "url/url_constants.h" 34 #include "url/url_constants.h"
34 35
35 namespace content { 36 namespace content {
36 37
37 namespace { 38 namespace {
38 39
39 void UpdateThrottleCheckResult( 40 void UpdateThrottleCheckResult(
40 NavigationThrottle::ThrottleCheckResult* to_update, 41 NavigationThrottle::ThrottleCheckResult* to_update,
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 bool NavigationHandleImpl::MaybeTransferAndProceed() { 671 bool NavigationHandleImpl::MaybeTransferAndProceed() {
671 DCHECK_EQ(WILL_PROCESS_RESPONSE, state_); 672 DCHECK_EQ(WILL_PROCESS_RESPONSE, state_);
672 673
673 // Check if the navigation should transfer. This may result in the 674 // Check if the navigation should transfer. This may result in the
674 // destruction of this NavigationHandle, and the cancellation of the request. 675 // destruction of this NavigationHandle, and the cancellation of the request.
675 if (!MaybeTransferAndProceedInternal()) 676 if (!MaybeTransferAndProceedInternal())
676 return false; 677 return false;
677 678
678 // Inform observers that the navigation is now ready to commit, unless a 679 // Inform observers that the navigation is now ready to commit, unless a
679 // transfer of the navigation failed. 680 // transfer of the navigation failed.
680 ReadyToCommitNavigation(render_frame_host_); 681 // PlzNavigate: when a navigation is not set to commit (204/205s/downloads) do
682 // not call ReadyToCommitNavigation.
683 DCHECK(!IsBrowserSideNavigationEnabled() || render_frame_host_ ||
684 net_error_code_ == net::ERR_ABORTED);
685 if (!IsBrowserSideNavigationEnabled() || render_frame_host_)
686 ReadyToCommitNavigation(render_frame_host_);
681 return true; 687 return true;
682 } 688 }
683 689
684 bool NavigationHandleImpl::MaybeTransferAndProceedInternal() { 690 bool NavigationHandleImpl::MaybeTransferAndProceedInternal() {
685 DCHECK(render_frame_host_); 691 DCHECK(render_frame_host_ || (IsBrowserSideNavigationEnabled() &&
692 net_error_code_ == net::ERR_ABORTED));
686 693
687 // PlzNavigate: the final RenderFrameHost handling this navigation has been 694 // PlzNavigate: the final RenderFrameHost handling this navigation has been
688 // decided before calling WillProcessResponse in 695 // decided before calling WillProcessResponse in
689 // NavigationRequest::OnResponseStarted. 696 // NavigationRequest::OnResponseStarted.
690 // TODO(clamy): See if PlzNavigate could use this code to check whether to 697 // TODO(clamy): See if PlzNavigate could use this code to check whether to
691 // use the RFH determined at the start of the navigation or to switch to 698 // use the RFH determined at the start of the navigation or to switch to
692 // another one. 699 // another one.
693 if (IsBrowserSideNavigationEnabled()) 700 if (IsBrowserSideNavigationEnabled())
694 return true; 701 return true;
695 702
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 throttles_.push_back(std::move(ancestor_throttle)); 801 throttles_.push_back(std::move(ancestor_throttle));
795 802
796 if (throttles_to_register.size() > 0) { 803 if (throttles_to_register.size() > 0) {
797 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), 804 throttles_.insert(throttles_.begin(), throttles_to_register.begin(),
798 throttles_to_register.end()); 805 throttles_to_register.end());
799 throttles_to_register.weak_clear(); 806 throttles_to_register.weak_clear();
800 } 807 }
801 } 808 }
802 809
803 } // namespace content 810 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698