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

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

Issue 1538933002: Enable download resumption by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot ChromeOS Created 5 years 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 cf4294485a94276b72f032e45cb5f579e315cf18..2826d31c227c9ecefb5ec602f20da6ba49265c54 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -27,7 +27,6 @@
#include "base/basictypes.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/logging.h"
@@ -49,7 +48,7 @@
#include "content/public/browser/download_danger_type.h"
#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/browser/download_url_parameters.h"
-#include "content/public/common/content_switches.h"
+#include "content/public/common/content_features.h"
#include "content/public/common/referrer.h"
#include "net/base/net_util.h"
@@ -93,8 +92,7 @@ static void DownloadFileCancel(scoped_ptr<DownloadFile> download_file) {
}
bool IsDownloadResumptionEnabled() {
- return base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableDownloadResumption);
+ return base::FeatureList::IsEnabled(features::kDownloadResumption);
}
} // namespace
@@ -1672,12 +1670,7 @@ void DownloadItemImpl::AutoResumeIfValid() {
void DownloadItemImpl::ResumeInterruptedDownload() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- // If the flag for downloads resumption isn't enabled, ignore
- // this request.
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kEnableDownloadResumption))
+ if (!IsDownloadResumptionEnabled())
return;
// If we're not interrupted, ignore the request; our caller is drunk.
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698