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 @@ ...@@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/bind.h"
#include "base/file_path.h" #include "base/file_path.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -33,6 +34,9 @@ ...@@ -33,6 +34,9 @@
using content::BrowserThread; using content::BrowserThread;
// The component updater is designed to live until process shutdown, so
// base::Bind() calls are not refcounted.
namespace { namespace {
// Extends an omaha compatible update check url |query| string. Does // Extends an omaha compatible update check url |query| string. Does
// not mutate the string if it would be longer than |limit| chars. // not mutate the string if it would be longer than |limit| chars.
...@@ -323,10 +327,6 @@ class CrxUpdateService : public ComponentUpdateService { ...@@ -323,10 +327,6 @@ class CrxUpdateService : public ComponentUpdateService {
DISALLOW_COPY_AND_ASSIGN(CrxUpdateService); 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( CrxUpdateService::CrxUpdateService(
...@@ -693,8 +693,10 @@ void CrxUpdateService::OnURLFetchComplete(const content::URLFetcher* source, ...@@ -693,8 +693,10 @@ void CrxUpdateService::OnURLFetchComplete(const content::URLFetcher* source,
content::Source<std::string>(&context->id), content::Source<std::string>(&context->id),
content::NotificationService::NoDetails()); content::NotificationService::NoDetails());
// Why unretained? See comment at top of file.
BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &CrxUpdateService::Install, base::Bind(&CrxUpdateService::Install,
base::Unretained(this),
context, context,
temp_crx_path), temp_crx_path),
config_->StepDelay()); config_->StepDelay());
...@@ -714,8 +716,9 @@ void CrxUpdateService::Install(const CRXContext* context, ...@@ -714,8 +716,9 @@ void CrxUpdateService::Install(const CRXContext* context,
if (!file_util::Delete(crx_path, false)) { if (!file_util::Delete(crx_path, false)) {
NOTREACHED() << crx_path.value(); NOTREACHED() << crx_path.value();
} }
// Why unretained? See comment at top of file.
BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &CrxUpdateService::DoneInstalling, base::Bind(&CrxUpdateService::DoneInstalling, base::Unretained(this),
context->id, unpacker.error()), context->id, unpacker.error()),
config_->StepDelay()); config_->StepDelay());
delete context; 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