Commit 9267024e authored by sorin@chromium.org's avatar sorin@chromium.org

Reset is_completed_ before attempting a new crx component download.

When downloading a url, the state of the BackgroundDownloader must be
reset.

A better solution later on would be implementing a BitsFetcher that can
only do one download, similar to UrlFetcher. This avoids the situation
when dirty state post-download is carried over to a subsequent
download.

BUG=304354

Review URL: https://codereview.chromium.org/102993014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242108 0039d316-1c4b-4281-b951-d872f2087c98
parent 0c8937ef
...@@ -389,6 +389,10 @@ void BackgroundDownloader::BeginDownload(const GURL& url) { ...@@ -389,6 +389,10 @@ void BackgroundDownloader::BeginDownload(const GURL& url) {
DCHECK(!timer_); DCHECK(!timer_);
is_completed_ = false;
download_start_time_ = base::Time::Now();
job_stuck_begin_time_ = download_start_time_;
HRESULT hr = QueueBitsJob(url); HRESULT hr = QueueBitsJob(url);
if (FAILED(hr)) { if (FAILED(hr)) {
EndDownload(hr); EndDownload(hr);
...@@ -402,9 +406,6 @@ void BackgroundDownloader::BeginDownload(const GURL& url) { ...@@ -402,9 +406,6 @@ void BackgroundDownloader::BeginDownload(const GURL& url) {
base::TimeDelta::FromSeconds(kJobPollingIntervalSec), base::TimeDelta::FromSeconds(kJobPollingIntervalSec),
this, this,
&BackgroundDownloader::OnDownloading); &BackgroundDownloader::OnDownloading);
download_start_time_ = base::Time::Now();
job_stuck_begin_time_ = download_start_time_;
} }
// Called any time the timer fires. // Called any time the timer fires.
......
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