Commit 44da56eb authored by dcheng@chromium.org's avatar dcheng@chromium.org

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
parent 7e34fa53
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment