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

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: Remove extraneous includes 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..f1ffa7b0ce398ac00a9f0e52c13684125f0fbeb7 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 {
@@ -84,10 +89,14 @@ class CrxDownloader {
// Factory method to create an instance of this class and build the
// chain of responsibility. |is_background_download| specifies that a
// background downloader be used, if the platform supports it.
+ // |url_fetcher_task_runner| should be an IO capable task runner able to
+ // support UrlFetcherDownloader. |background_task_runner| should be an
+ // IO capable thread able to support BackgroundDownloader.
static CrxDownloader* Create(
bool is_background_download,
net::URLRequestContextGetter* context_getter,
- scoped_refptr<base::SequencedTaskRunner> task_runner);
+ scoped_refptr<base::SequencedTaskRunner> url_fetcher_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> background_task_runner);
virtual ~CrxDownloader();
void set_progress_callback(const ProgressCallback& progress_callback);
@@ -127,6 +136,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_;
« no previous file with comments | « chrome/browser/component_updater/component_updater_service.cc ('k') | chrome/browser/component_updater/crx_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698