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

Unified Diff: content/browser/download/download_resource_handler.cc

Issue 351863002: Added SERVER_UNAUTHORIZED download interrupt reason. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixup for history_unittest Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_resource_handler.cc
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index 0a19163c9c3f8ae40a9532e13780c89acac15fab..073e25ce16a5597c36c4c182ce30512b5872575b 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -383,7 +383,10 @@ void DownloadResourceHandler::OnResponseCompleted(
// to a user action.
// TODO(ahendrickson) -- Find a better set of codes to use here, as
// CANCELED/ERR_ABORTED can occur for reasons other than user cancel.
- reason = DOWNLOAD_INTERRUPT_REASON_USER_CANCELED;
+ if (net::IsCertStatusError(request()->ssl_info().cert_status))
+ reason = DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM;
+ else
+ reason = DOWNLOAD_INTERRUPT_REASON_USER_CANCELED;
}
if (status.is_success() &&
@@ -414,6 +417,10 @@ void DownloadResourceHandler::OnResponseCompleted(
// If we haven't received data when we get this error, we won't.
reason = DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE;
break;
+ case net::HTTP_UNAUTHORIZED:
+ // Server didn't authorize this request.
+ reason = DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED;
+ break;
default: // All other errors.
// Redirection and informational codes should have been handled earlier
// in the stack.
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/public/browser/download_interrupt_reason_values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698