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

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

Issue 2674973003: Adding a DownloadRestrictions group policy. (Closed)
Patch Set: Test compile fix Created 3 years, 10 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 47ad0ee6944fc98bafb52c0621adf81b0e10e239..acf58c8ed6626851323247e4282fadc4993df473 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -596,11 +596,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_;
@@ -777,7 +777,8 @@ WebContents* DownloadItemImpl::GetWebContents() const {
return NULL;
}
-void DownloadItemImpl::OnContentCheckCompleted(DownloadDangerType danger_type) {
+void DownloadItemImpl::OnContentCheckCompleted(DownloadDangerType danger_type,
+ bool block_file) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(AllDataSaved());
@@ -791,6 +792,8 @@ void DownloadItemImpl::OnContentCheckCompleted(DownloadDangerType danger_type) {
DVLOG(20) << __func__ << "() danger_type=" << danger_type
<< " download=" << DebugString(true);
SetDangerType(danger_type);
+ if (block_file)
+ InterruptAndDiscardPartialState(DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED);
UpdateObservers();
}
@@ -881,7 +884,7 @@ DownloadItemImpl::ResumeMode DownloadItemImpl::GetResumeMode() const {
bool user_action_required =
(auto_resume_count_ >= kMaxAutoResumeAttempts || is_paused_);
- switch(last_reason_) {
+ switch (last_reason_) {
case DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR:
case DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT:
break;
@@ -2104,7 +2107,7 @@ const char* DownloadItemImpl::DebugDownloadStateString(
return "RESUMING";
case MAX_DOWNLOAD_INTERNAL_STATE:
break;
- };
+ }
NOTREACHED() << "Unknown download state " << state;
return "unknown";
}

Powered by Google App Engine
This is Rietveld 408576698