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

Unified Diff: components/update_client/background_downloader_win.cc

Issue 1880823002: Fix crash in update_client::BackgroundDownloader::EndDownload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « components/update_client/background_downloader_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/background_downloader_win.cc
diff --git a/components/update_client/background_downloader_win.cc b/components/update_client/background_downloader_win.cc
index 4361536dfecd35c2f40001b9eef67f29d5e53516..ea0b0ab440d121432d3b48e701460ad8b76bc393 100644
--- a/components/update_client/background_downloader_win.cc
+++ b/components/update_client/background_downloader_win.cc
@@ -444,6 +444,10 @@ void BackgroundDownloader::OnTimer() {
base::Bind(&BackgroundDownloader::OnDownloading, base::Unretained(this)));
}
+bool BackgroundDownloader::TimerIsRunning() const {
+ return timer_.get() && timer_->IsRunning();
+}
+
void BackgroundDownloader::DoStartDownload(const GURL& url) {
DCHECK(thread_checker_.CalledOnValidThread());
task_runner()->PostTask(FROM_HERE,
@@ -566,7 +570,7 @@ void BackgroundDownloader::OnDownloading() {
void BackgroundDownloader::EndDownload(HRESULT error) {
DCHECK(task_runner()->RunsTasksOnCurrentThread());
- DCHECK(!timer_->IsRunning());
+ DCHECK(!TimerIsRunning());
const base::Time download_end_time(base::Time::Now());
const base::TimeDelta download_time =
« no previous file with comments | « components/update_client/background_downloader_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698