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

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

Issue 2674973003: Adding a DownloadRestrictions group policy. (Closed)
Patch Set: Some oups.... :-) 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 701f2385af127f1675a7dc62fc605e37971e293f..bbdd45cd7dc4d15f8495049a4a86bf865f53c50c 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:
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698