Index: content/browser/loader/navigation_resource_throttle.cc |
diff --git a/content/browser/loader/navigation_resource_throttle.cc b/content/browser/loader/navigation_resource_throttle.cc |
index b8787626e829a86be9c43a5583d41c5bfe093eab..cde679c5f4a3b7dc7930d6954cf82676059012a1 100644 |
--- a/content/browser/loader/navigation_resource_throttle.cc |
+++ b/content/browser/loader/navigation_resource_throttle.cc |
@@ -48,7 +48,7 @@ typedef base::Callback<void(NavigationThrottle::ThrottleCheckResult)> |
void SendCheckResultToIOThread(UIChecksPerformedCallback callback, |
NavigationThrottle::ThrottleCheckResult result) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
- DCHECK_NE(result, NavigationThrottle::DEFER); |
+ DCHECK_NE(result.action(), NavigationThrottle::DEFER); |
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
base::Bind(callback, result)); |
} |
@@ -344,19 +344,23 @@ void NavigationResourceThrottle::set_force_transfer_for_testing( |
void NavigationResourceThrottle::OnUIChecksPerformed( |
NavigationThrottle::ThrottleCheckResult result) { |
DCHECK_CURRENTLY_ON(BrowserThread::IO); |
- DCHECK_NE(NavigationThrottle::DEFER, result); |
+ DCHECK_NE(NavigationThrottle::DEFER, result.action()); |
if (in_cross_site_transition_) { |
on_transfer_done_result_ = result; |
return; |
} |
- if (result == NavigationThrottle::CANCEL_AND_IGNORE) { |
+ if (result.action() == NavigationThrottle::CANCEL_AND_IGNORE) { |
+ DCHECK_EQ(net::ERR_ABORTED, result.net_error_code()); |
CancelAndIgnore(); |
- } else if (result == NavigationThrottle::CANCEL) { |
+ } else if (result.action() == NavigationThrottle::CANCEL) { |
+ DCHECK_EQ(net::ERR_ABORTED, result.net_error_code()); |
Cancel(); |
- } else if (result == NavigationThrottle::BLOCK_REQUEST) { |
- CancelWithError(net::ERR_BLOCKED_BY_CLIENT); |
- } else if (result == NavigationThrottle::BLOCK_RESPONSE) { |
+ } else if (result.action() == NavigationThrottle::BLOCK_REQUEST) { |
+ DCHECK_NE(net::OK, result.net_error_code()); |
+ CancelWithError(result.net_error_code()); |
+ } else if (result.action() == NavigationThrottle::BLOCK_RESPONSE) { |
+ DCHECK_NE(net::OK, result.net_error_code()); |
// TODO(mkwst): If we cancel the main frame request with anything other than |
// 'net::ERR_ABORTED', we'll trigger some special behavior that might not be |
// desirable here (non-POSTs will reload the page, while POST has some logic |
@@ -365,7 +369,7 @@ void NavigationResourceThrottle::OnUIChecksPerformed( |
// block main frame navigations in the future, we'll need to carefully |
// consider the right thing to do here. |
DCHECK(!ResourceRequestInfo::ForRequest(request_)->IsMainFrame()); |
- CancelWithError(net::ERR_BLOCKED_BY_RESPONSE); |
+ CancelWithError(result.net_error_code()); |
} else { |
Resume(); |
} |
@@ -389,7 +393,7 @@ void NavigationResourceThrottle::OnTransferComplete() { |
// If the results of the checks on the UI thread are known, unblock the |
// navigation. Otherwise, wait until the callback has executed. |
- if (on_transfer_done_result_ != NavigationThrottle::DEFER) { |
+ if (on_transfer_done_result_.action() != NavigationThrottle::DEFER) { |
OnUIChecksPerformed(on_transfer_done_result_); |
on_transfer_done_result_ = NavigationThrottle::DEFER; |
} |