| Index: content/browser/frame_host/navigation_handle_impl.cc
|
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
|
| index ae93eee9f77a981de15ff9d82434a3fe7141a09b..7c62aa429f8cd250a2092f50d8745d0cd9cea10e 100644
|
| --- a/content/browser/frame_host/navigation_handle_impl.cc
|
| +++ b/content/browser/frame_host/navigation_handle_impl.cc
|
| @@ -317,6 +317,18 @@ void NavigationHandleImpl::Resume() {
|
| result = CheckWillStartRequest();
|
| } else if (state_ == DEFERRING_REDIRECT) {
|
| result = CheckWillRedirectRequest();
|
| + if (!IsBrowserSideNavigationEnabled() &&
|
| + result != NavigationThrottle::PROCEED &&
|
| + result != NavigationThrottle::DEFER) {
|
| + // The renderer will not be informed of the redirect, as the navigation
|
| + // will have been cancelled before sending the
|
| + // ResourceMsg_ReceivedRedirect IPC. Reset the URL of the NavigationHandle
|
| + // to the URL it had prior to the redirect, to match the commit of an
|
| + // error page.
|
| + redirect_chain_.pop_back();
|
| + DCHECK(!redirect_chain_.empty());
|
| + url_ = redirect_chain_.back();
|
| + }
|
| } else {
|
| result = CheckWillProcessResponse();
|
|
|
| @@ -563,14 +575,27 @@ void NavigationHandleImpl::WillRedirectRequest(
|
| state_ = WILL_REDIRECT_REQUEST;
|
| complete_callback_ = callback;
|
|
|
| + // Notify each throttle of the request.
|
| + NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
|
| if (IsSelfReferentialURL()) {
|
| state_ = CANCELING;
|
| - RunCompleteCallback(NavigationThrottle::CANCEL);
|
| - return;
|
| + result = NavigationThrottle::CANCEL;
|
| + } else {
|
| + result = CheckWillRedirectRequest();
|
| }
|
|
|
| - // Notify each throttle of the request.
|
| - NavigationThrottle::ThrottleCheckResult result = CheckWillRedirectRequest();
|
| + if (!IsBrowserSideNavigationEnabled() &&
|
| + result != NavigationThrottle::PROCEED &&
|
| + result != NavigationThrottle::DEFER) {
|
| + // The renderer will not be informed of the redirect, as the navigation
|
| + // will have been cancelled before sending the
|
| + // ResourceMsg_ReceivedRedirect IPC. Reset the URL of the NavigationHandle
|
| + // to the URL it had prior to the redirect, to match the commit of an
|
| + // error page.
|
| + redirect_chain_.pop_back();
|
| + DCHECK(!redirect_chain_.empty());
|
| + url_ = redirect_chain_.back();
|
| + }
|
|
|
| // If the navigation is not deferred, run the callback.
|
| if (result != NavigationThrottle::DEFER)
|
| @@ -681,9 +706,9 @@ NavigationHandleImpl::CheckWillStartRequest() {
|
| case NavigationThrottle::PROCEED:
|
| continue;
|
|
|
| + case NavigationThrottle::BLOCK_REQUEST:
|
| case NavigationThrottle::CANCEL:
|
| case NavigationThrottle::CANCEL_AND_IGNORE:
|
| - case NavigationThrottle::BLOCK_REQUEST:
|
| state_ = CANCELING;
|
| return result;
|
|
|
| @@ -713,6 +738,7 @@ NavigationHandleImpl::CheckWillRedirectRequest() {
|
| case NavigationThrottle::PROCEED:
|
| continue;
|
|
|
| + case NavigationThrottle::BLOCK_REQUEST:
|
| case NavigationThrottle::CANCEL:
|
| case NavigationThrottle::CANCEL_AND_IGNORE:
|
| state_ = CANCELING;
|
| @@ -723,7 +749,6 @@ NavigationHandleImpl::CheckWillRedirectRequest() {
|
| next_index_ = i + 1;
|
| return result;
|
|
|
| - case NavigationThrottle::BLOCK_REQUEST:
|
| case NavigationThrottle::BLOCK_RESPONSE:
|
| NOTREACHED();
|
| }
|
|
|