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

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

Issue 2674973003: Adding a DownloadRestrictions group policy. (Closed)
Patch Set: Rebase 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 28a62099bb2f1dfa13d2608c71973fe7be66d07d..ebbd3a0eb4912df61e00c31b0878eb38f9b5bf44 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -632,11 +632,11 @@ std::string DownloadItemImpl::GetRemoteAddress() const {
bool DownloadItemImpl::HasUserGesture() const {
return has_user_gesture_;
-};
+}
ui::PageTransition DownloadItemImpl::GetTransitionType() const {
return transition_type_;
-};
+}
const std::string& DownloadItemImpl::GetLastModifiedTime() const {
return last_modified_time_;
@@ -826,7 +826,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());
@@ -840,6 +841,8 @@ 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);
asanka 2017/06/06 03:00:36 The only interrupt reasons that make sense here ar
MAD 2017/06/06 18:00:28 Héhé... Interestingly, I initially had a bool and
asanka 2017/06/06 18:34:18 LOL. Apologies for the runaround :). I'll defer to
MAD 2017/06/12 17:38:15 OK, thanks, I'll wait to see if the OWNERs prefer
David Trainor- moved to gerrit 2017/06/12 19:09:04 I'm ok leaving the interrupt reason here. Could w
MAD 2017/06/12 19:45:13 Done.
UpdateObservers();
}
@@ -935,7 +938,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