diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 19:59:14 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 19:59:14 +0000 |
commit | 44da56eb4618a861a728c623c6081669216a798d (patch) | |
tree | c38067a7517cc938f94b2d9a23fffe1ab32039fe /chrome/browser/component_updater | |
parent | 7e34fa537fa0a5260e9b2a03478d271396db313a (diff) | |
download | chromium_src-44da56eb4618a861a728c623c6081669216a798d.zip chromium_src-44da56eb4618a861a728c623c6081669216a798d.tar.gz chromium_src-44da56eb4618a861a728c623c6081669216a798d.tar.bz2 |
base::Bind() conversion for ComponentUpdaterService.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8500008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/component_updater')
-rw-r--r-- | chrome/browser/component_updater/component_updater_service.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc index c48b90f..feaef13 100644 --- a/chrome/browser/component_updater/component_updater_service.cc +++ b/chrome/browser/component_updater/component_updater_service.cc @@ -8,6 +8,7 @@ #include <vector> #include "base/at_exit.h" +#include "base/bind.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" @@ -33,6 +34,9 @@ using content::BrowserThread; +// The component updater is designed to live until process shutdown, so +// base::Bind() calls are not refcounted. + namespace { // Extends an omaha compatible update check url |query| string. Does // not mutate the string if it would be longer than |limit| chars. @@ -323,10 +327,6 @@ class CrxUpdateService : public ComponentUpdateService { DISALLOW_COPY_AND_ASSIGN(CrxUpdateService); }; -// The component updater is designed to live until process shutdown, besides -// we can't be refcounted because we are a singleton. -DISABLE_RUNNABLE_METHOD_REFCOUNT(CrxUpdateService); - ////////////////////////////////////////////////////////////////////////////// CrxUpdateService::CrxUpdateService( @@ -693,10 +693,12 @@ void CrxUpdateService::OnURLFetchComplete(const content::URLFetcher* source, content::Source<std::string>(&context->id), content::NotificationService::NoDetails()); + // Why unretained? See comment at top of file. BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, - NewRunnableMethod(this, &CrxUpdateService::Install, - context, - temp_crx_path), + base::Bind(&CrxUpdateService::Install, + base::Unretained(this), + context, + temp_crx_path), config_->StepDelay()); } } @@ -714,9 +716,10 @@ void CrxUpdateService::Install(const CRXContext* context, if (!file_util::Delete(crx_path, false)) { NOTREACHED() << crx_path.value(); } + // Why unretained? See comment at top of file. BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, - NewRunnableMethod(this, &CrxUpdateService::DoneInstalling, - context->id, unpacker.error()), + base::Bind(&CrxUpdateService::DoneInstalling, base::Unretained(this), + context->id, unpacker.error()), config_->StepDelay()); delete context; } |