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

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

Issue 2674973003: Adding a DownloadRestrictions group policy. (Closed)
Patch Set: Missed one... :-( Created 3 years, 6 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_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index 77157b0ae71f296cc4e8328d894c5a3e1ae9383b..0363259c5fb07e6e87a4412c337473eefd9fa8a4 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -890,7 +890,8 @@ WebContents* DownloadItemImpl::GetWebContents() const {
return nullptr;
}
-void DownloadItemImpl::OnContentCheckCompleted(DownloadDangerType danger_type) {
+void DownloadItemImpl::OnContentCheckCompleted(DownloadDangerType danger_type,
+ DownloadInterruptReason reason) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(AllDataSaved());
@@ -904,6 +905,10 @@ void DownloadItemImpl::OnContentCheckCompleted(DownloadDangerType danger_type) {
DVLOG(20) << __func__ << "() danger_type=" << danger_type
<< " download=" << DebugString(true);
SetDangerType(danger_type);
+ if (reason != DOWNLOAD_INTERRUPT_REASON_NONE) {
+ InterruptAndDiscardPartialState(reason);
+ DCHECK_EQ(RESUME_MODE_INVALID, GetResumeMode());
+ }
UpdateObservers();
}
@@ -999,7 +1004,7 @@ DownloadItemImpl::ResumeMode DownloadItemImpl::GetResumeMode() const {
bool user_action_required =
(auto_resume_count_ >= kMaxAutoResumeAttempts || IsPaused());
- switch(last_reason_) {
+ switch (last_reason_) {
case DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR:
case DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT:
case DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH:

Powered by Google App Engine
This is Rietveld 408576698