Commit cd5449fe authored by Min Qin's avatar Min Qin Committed by Commit Bot

Fix an issue that download service is not working in reduced mode

DownloadDriverImpl::IsReady() checks for whether all downloads are
loaded or kUseInProgressDownloadManagerForDownloadService
is enabled.
However, if the flag is not enabled, we should still allow download
service to work in reduced mode. This CL changes the logic to just
check whether SimpleDownloadManagerCoordinator is initialized, so that
in reduced mode only in-progress download manager initialization
is needed.

BUG=942770

Change-Id: I556b5ccffabcabb710ef81891b59108906a1ac00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635773Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664531}
parent 9957e588
......@@ -151,9 +151,7 @@ void DownloadDriverImpl::HardRecover() {
bool DownloadDriverImpl::IsReady() const {
return client_ && download_manager_coordinator_ &&
(download_manager_coordinator_->has_all_history_downloads() ||
base::FeatureList::IsEnabled(
features::kUseInProgressDownloadManagerForDownloadService));
download_manager_coordinator_->initialized();
}
void DownloadDriverImpl::Start(
......
......@@ -70,6 +70,9 @@ class COMPONENTS_DOWNLOAD_EXPORT SimpleDownloadManagerCoordinator
// Returns a non-empty notifier to be used for observing download events.
AllDownloadEventNotifier* GetNotifier();
// Whether this object is initialized.
bool initialized() const { return initialized_; }
bool has_all_history_downloads() const { return has_all_history_downloads_; }
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment