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

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

Issue 8500008: base::Bind() conversion for ComponentUpdaterService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/component_updater_service.cc
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index c48b90fcfe7d9501c41d29b0931a85d6b21ddc1b..7e0333b40f6a8fbaab59cfce1be40285767454ce 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(
@@ -694,9 +694,10 @@ void CrxUpdateService::OnURLFetchComplete(const content::URLFetcher* source,
content::NotificationService::NoDetails());
BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(this, &CrxUpdateService::Install,
- context,
- temp_crx_path),
+ base::Bind(&CrxUpdateService::Install,
+ base::Unretained(this),
asargent_no_longer_on_chrome 2011/11/21 18:00:16 optional suggestion: add comment near the base:Unr
+ context,
+ temp_crx_path),
config_->StepDelay());
}
}
@@ -715,8 +716,8 @@ void CrxUpdateService::Install(const CRXContext* context,
NOTREACHED() << crx_path.value();
}
BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this, &CrxUpdateService::DoneInstalling,
- context->id, unpacker.error()),
+ base::Bind(&CrxUpdateService::DoneInstalling, base::Unretained(this),
asargent_no_longer_on_chrome 2011/11/21 18:00:16 same suggestion here
+ context->id, unpacker.error()),
config_->StepDelay());
delete context;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698