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

Side by Side Diff: chrome/browser/component_updater/background_downloader_win.cc

Issue 250383008: Refactor the interface for the CrxDownloader to take a callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/component_updater/background_downloader_win.h" 5 #include "chrome/browser/component_updater/background_downloader_win.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 9
10 #include <functional> 10 #include <functional>
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 return S_OK; 381 return S_OK;
382 } 382 }
383 383
384 } // namespace 384 } // namespace
385 385
386 BackgroundDownloader::BackgroundDownloader( 386 BackgroundDownloader::BackgroundDownloader(
387 scoped_ptr<CrxDownloader> successor, 387 scoped_ptr<CrxDownloader> successor,
388 net::URLRequestContextGetter* context_getter, 388 net::URLRequestContextGetter* context_getter,
389 scoped_refptr<base::SequencedTaskRunner> task_runner, 389 scoped_refptr<base::SequencedTaskRunner> task_runner)
390 const DownloadCallback& download_callback) 390 : CrxDownloader(successor.Pass()),
391 : CrxDownloader(successor.Pass(), download_callback),
392 context_getter_(context_getter), 391 context_getter_(context_getter),
393 task_runner_(task_runner), 392 task_runner_(task_runner),
394 is_completed_(false) { 393 is_completed_(false) {
395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 394 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
396 } 395 }
397 396
398 BackgroundDownloader::~BackgroundDownloader() { 397 BackgroundDownloader::~BackgroundDownloader() {
399 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
400 399
401 // The following objects have thread affinity and can't be destroyed on the 400 // The following objects have thread affinity and can't be destroyed on the
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 743 }
745 744
746 bool BackgroundDownloader::IsStuck() { 745 bool BackgroundDownloader::IsStuck() {
747 const base::TimeDelta job_stuck_timeout( 746 const base::TimeDelta job_stuck_timeout(
748 base::TimeDelta::FromMinutes(kJobStuckTimeoutMin)); 747 base::TimeDelta::FromMinutes(kJobStuckTimeoutMin));
749 return job_stuck_begin_time_ + job_stuck_timeout < base::Time::Now(); 748 return job_stuck_begin_time_ + job_stuck_timeout < base::Time::Now();
750 } 749 }
751 750
752 } // namespace component_updater 751 } // namespace component_updater
753 752
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698