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

Unified Diff: chrome/browser/component_updater/update_checker.cc

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/update_checker.cc
diff --git a/chrome/browser/component_updater/update_checker.cc b/chrome/browser/component_updater/update_checker.cc
index 7fa828be2fadaf11b694d9352f03da70aff954a2..64adcaa358c5e51d875d523cc36d24862db8a10c 100644
--- a/chrome/browser/component_updater/update_checker.cc
+++ b/chrome/browser/component_updater/update_checker.cc
@@ -7,16 +7,14 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "base/threading/thread_checker.h"
#include "chrome/browser/component_updater/component_updater_configurator.h"
#include "chrome/browser/component_updater/component_updater_utils.h"
#include "chrome/browser/component_updater/crx_update_item.h"
-#include "content/public/browser/browser_thread.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
-using content::BrowserThread;
-
namespace component_updater {
// Builds an update check request for |components|. |additional_attributes| is
@@ -88,6 +86,8 @@ class UpdateCheckerImpl : public UpdateChecker, public net::URLFetcherDelegate {
scoped_ptr<net::URLFetcher> url_fetcher_;
+ base::ThreadChecker thread_checker_;
+
DISALLOW_COPY_AND_ASSIGN(UpdateCheckerImpl);
};
@@ -103,17 +103,16 @@ UpdateCheckerImpl::UpdateCheckerImpl(
const Configurator& config,
const UpdateCheckCallback& update_check_callback)
: config_(config), update_check_callback_(update_check_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
UpdateCheckerImpl::~UpdateCheckerImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(thread_checker_.CalledOnValidThread());
}
bool UpdateCheckerImpl::CheckForUpdates(
const std::vector<CrxUpdateItem*>& items_to_check,
const std::string& additional_attributes) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(thread_checker_.CalledOnValidThread());
if (url_fetcher_)
return false; // Another fetch is in progress.
@@ -128,7 +127,7 @@ bool UpdateCheckerImpl::CheckForUpdates(
}
void UpdateCheckerImpl::OnURLFetchComplete(const net::URLFetcher* source) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(url_fetcher_.get() == source);
int error = 0;
« no previous file with comments | « chrome/browser/component_updater/test/test_configurator.cc ('k') | chrome/browser/component_updater/url_fetcher_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698