Chromium Code Reviews| Index: remoting/host/host_service_win.cc |
| diff --git a/remoting/host/host_service_win.cc b/remoting/host/host_service_win.cc |
| index 52cb90986d32249503f298808b95046fd0d8e1b3..ca6b73fa0bc00016291ef87d62432cd7bf9788a5 100644 |
| --- a/remoting/host/host_service_win.cc |
| +++ b/remoting/host/host_service_win.cc |
| @@ -117,6 +117,11 @@ void HostService::AddWtsConsoleObserver(WtsConsoleObserver* observer) { |
| void HostService::RemoveWtsConsoleObserver(WtsConsoleObserver* observer) { |
| console_observers_.RemoveObserver(observer); |
| + |
| + // Stop the service if there is no more observers. |
|
Wez
2012/04/10 21:26:20
typo: is -> are
alexeypa (please no reviews)
2012/04/10 22:18:16
Done.
|
| + if (!console_observers_.might_have_observers()) { |
|
Wez
2012/04/10 21:26:20
might_have_observers is reliable because our obser
alexeypa (please no reviews)
2012/04/10 22:18:16
I added a DCHECK.
|
| + message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| + } |
| } |
| void HostService::OnSessionChange() { |
| @@ -357,12 +362,15 @@ void HostService::RunMessageLoop() { |
| base::Thread io_thread(kIoThreadName); |
| base::Thread::Options io_thread_options(MessageLoop::TYPE_IO, 0); |
| if (!io_thread.StartWithOptions(io_thread_options)) { |
| + LOG(FATAL) << "Failed to start the I/O thread"; |
| shutting_down_ = true; |
| stopped_event_.Signal(); |
| return; |
| } |
| - WtsSessionProcessLauncher launcher(this, host_binary_, &io_thread); |
| + WtsSessionProcessLauncher launcher(this, host_binary_, |
| + message_loop_->message_loop_proxy(), |
| + io_thread.message_loop_proxy()); |
|
Wez
2012/04/10 21:26:20
Are these related to this CL? If so then mention
alexeypa (please no reviews)
2012/04/10 22:18:16
It is already mentioned. I have to pass message_lo
|
| // Run the service. |
| message_loop_->Run(); |