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

Unified Diff: remoting/host/chromoting_host.cc

Issue 8493020: Move code in src/remoting to the new callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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 | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index fe54f78561c5ce69cd4d3f7a66a1c7d35b76a467..434552f7c6178730200d1deb5a05acb25fad9b89 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -104,7 +104,7 @@ void ChromotingHost::Start() {
}
// This method is called when we need to destroy the host process.
-void ChromotingHost::Shutdown(Task* shutdown_task) {
+void ChromotingHost::Shutdown(const base::Closure& shutdown_task) {
if (MessageLoop::current() != context_->main_message_loop()) {
context_->main_message_loop()->PostTask(
FROM_HERE,
@@ -121,7 +121,7 @@ void ChromotingHost::Shutdown(Task* shutdown_task) {
context_->main_message_loop()->PostTask(FROM_HERE, shutdown_task);
return;
}
- if (shutdown_task)
+ if (!shutdown_task.is_null())
shutdown_tasks_.push_back(shutdown_task);
if (state_ == kStopping)
return;
@@ -263,7 +263,7 @@ void ChromotingHost::OnIncomingSession(
*response = protocol::SessionManager::DECLINE;
// Close existing sessions and shutdown the host.
- Shutdown(NULL);
+ Shutdown(base::Closure());
return;
}
@@ -331,10 +331,7 @@ void ChromotingHost::LocalMouseMoved(const SkIPoint& new_pos) {
void ChromotingHost::PauseSession(bool pause) {
if (context_->main_message_loop() != MessageLoop::current()) {
context_->main_message_loop()->PostTask(
- FROM_HERE,
- NewRunnableMethod(this,
- &ChromotingHost::PauseSession,
- pause));
+ FROM_HERE, base::Bind(&ChromotingHost::PauseSession, this, pause));
return;
}
ClientList::iterator client;
@@ -610,10 +607,9 @@ void ChromotingHost::ShutdownFinish() {
(*it)->OnShutdown();
}
- for (std::vector<Task*>::iterator it = shutdown_tasks_.begin();
+ for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin();
it != shutdown_tasks_.end(); ++it) {
- (*it)->Run();
- delete *it;
+ it->Run();
}
shutdown_tasks_.clear();
}
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698