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

Unified Diff: chrome/common/service_process_util_win.cc

Issue 8495039: NewRunnable* conversion to base::Bind for service process utils. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Could swear I build this on the Mac... 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 | « chrome/common/service_process_util_unittest.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/service_process_util_win.cc
diff --git a/chrome/common/service_process_util_win.cc b/chrome/common/service_process_util_win.cc
index 25ff7cf0074a9ab09dbef63250621a797b1b839e..cccb7a95c94c9ec1b8df3a0ba7bdaf011b0e8ae7 100644
--- a/chrome/common/service_process_util_win.cc
+++ b/chrome/common/service_process_util_win.cc
@@ -51,7 +51,7 @@ std::string GetObsoleteServiceProcessAutoRunKey() {
class ServiceProcessTerminateMonitor
: public base::win::ObjectWatcher::Delegate {
public:
- explicit ServiceProcessTerminateMonitor(Task* terminate_task)
+ explicit ServiceProcessTerminateMonitor(const base::Closure& terminate_task)
: terminate_task_(terminate_task) {
}
void Start() {
@@ -63,14 +63,16 @@ class ServiceProcessTerminateMonitor
// base::ObjectWatcher::Delegate implementation.
virtual void OnObjectSignaled(HANDLE object) {
- terminate_task_->Run();
- terminate_task_.reset();
+ if (!terminate_task_.is_null()) {
+ terminate_task_.Run();
+ terminate_task_.Reset();
+ }
}
private:
base::win::ScopedHandle terminate_event_;
base::win::ObjectWatcher watcher_;
- scoped_ptr<Task> terminate_task_;
+ base::Closure terminate_task_;
};
} // namespace
@@ -131,16 +133,16 @@ bool ServiceProcessState::TakeSingletonLock() {
}
bool ServiceProcessState::SignalReady(
- base::MessageLoopProxy* message_loop_proxy, Task* terminate_task) {
+ base::MessageLoopProxy* message_loop_proxy,
+ const base::Closure& terminate_task) {
DCHECK(state_);
DCHECK(state_->ready_event.IsValid());
- scoped_ptr<Task> scoped_terminate_task(terminate_task);
if (!SetEvent(state_->ready_event.Get())) {
return false;
}
- if (terminate_task) {
+ if (!terminate_task.is_null()) {
state_->terminate_monitor.reset(
- new ServiceProcessTerminateMonitor(scoped_terminate_task.release()));
+ new ServiceProcessTerminateMonitor(terminate_task));
state_->terminate_monitor->Start();
}
return true;
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698