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

Unified Diff: chrome/browser/component_updater/crx_downloader.h

Issue 385013002: Componentize component_updater: Replace content::BrowserThread usage with task runners (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
Index: chrome/browser/component_updater/crx_downloader.h
diff --git a/chrome/browser/component_updater/crx_downloader.h b/chrome/browser/component_updater/crx_downloader.h
index fbe2259716e159230e285fc50cc309fb5dbe16aa..59851518885bb0051b7f6936052c855981928cbe 100644
--- a/chrome/browser/component_updater/crx_downloader.h
+++ b/chrome/browser/component_updater/crx_downloader.h
@@ -12,9 +12,14 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/sequenced_task_runner.h"
+#include "base/threading/thread_checker.h"
#include "url/gurl.h"
+namespace base {
+class SequencedTaskRunner;
+class SingleThreadTaskRunner;
+}
+
namespace net {
class URLRequestContextGetter;
}
@@ -30,7 +35,7 @@ namespace component_updater {
// When multiple urls and downloaders exists, first all the urls are tried, in
// the order they are provided in the StartDownload function argument. After
// that, the download request is routed to the next downloader in the chain.
-// The members of this class expect to be called from the UI thread only.
+// The members of this class expect to be called from the main thread only.
class CrxDownloader {
public:
struct DownloadMetrics {
@@ -87,7 +92,8 @@ class CrxDownloader {
static CrxDownloader* Create(
bool is_background_download,
net::URLRequestContextGetter* context_getter,
- scoped_refptr<base::SequencedTaskRunner> task_runner);
+ scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner,
blundell 2014/07/15 08:45:20 It would be good if these params could be given na
tommycli 2014/07/15 18:58:25 Done.
+ scoped_refptr<base::SingleThreadTaskRunner> single_thread_task_runner);
virtual ~CrxDownloader();
void set_progress_callback(const ProgressCallback& progress_callback);
@@ -127,6 +133,8 @@ class CrxDownloader {
private:
virtual void DoStartDownload(const GURL& url) = 0;
+ base::ThreadChecker thread_checker_;
+
std::vector<GURL> urls_;
scoped_ptr<CrxDownloader> successor_;
DownloadCallback download_callback_;

Powered by Google App Engine
This is Rietveld 408576698