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

Unified Diff: remoting/host/host_service_win.cc

Issue 10048003: The Chromoting service should not start automatically unless it was configured from the webapp to d… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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
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();

Powered by Google App Engine
This is Rietveld 408576698