Chromium Code Reviews| Index: remoting/host/win/host_service.h |
| diff --git a/remoting/host/win/host_service.h b/remoting/host/win/host_service.h |
| index aa1d9ab5f1505ca988fccb20778a065045631ee2..7ad5ca57f21215be5396343614f3a8048f5d642c 100644 |
| --- a/remoting/host/win/host_service.h |
| +++ b/remoting/host/win/host_service.h |
| @@ -11,6 +11,7 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/singleton.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "base/synchronization/waitable_event.h" |
| #include "net/base/ip_endpoint.h" |
| #include "remoting/host/win/message_window.h" |
| @@ -25,7 +26,7 @@ class SingleThreadTaskRunner; |
| namespace remoting { |
| class AutoThreadTaskRunner; |
| -class Stoppable; |
| +class DaemonProcess; |
| class WtsTerminalObserver; |
| class HostService : public win::MessageWindow::Delegate, |
| @@ -55,8 +56,6 @@ class HostService : public win::MessageWindow::Delegate, |
| // Creates the process launcher. |
| void CreateLauncher(scoped_refptr<AutoThreadTaskRunner> task_runner); |
| - void OnChildStopped(); |
| - |
| // This function handshakes with the service control manager and starts |
| // the service. |
| int RunAsService(); |
| @@ -70,6 +69,9 @@ class HostService : public win::MessageWindow::Delegate, |
| // console application). |
| int RunInConsole(); |
| + // Stops and deletes |daemon_process_|. |
| + void StopDaemonProcess(); |
| + |
| // win::MessageWindow::Delegate interface. |
| virtual bool HandleMessage(HWND hwnd, |
| UINT message, |
| @@ -105,7 +107,7 @@ class HostService : public win::MessageWindow::Delegate, |
| // The list of observers receiving session notifications. |
| std::list<RegisteredObserver> observers_; |
| - scoped_ptr<Stoppable> child_; |
| + scoped_ptr<DaemonProcess> daemon_process_; |
| // Service message loop. |
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
|
Wez
2013/06/07 17:48:24
nit: It's important that we're not clearing |main_
alexeypa (please no reviews)
2013/06/07 18:30:23
Done.
|
| @@ -119,6 +121,10 @@ class HostService : public win::MessageWindow::Delegate, |
| // A waitable event that is used to wait until the service is stopped. |
| base::WaitableEvent stopped_event_; |
| + // Used to post session change notifications and control events. |
| + base::WeakPtrFactory<HostService> weak_factory_; |
| + base::WeakPtr<HostService> weak_self_; |
|
Wez
2013/06/07 17:48:24
nit: Elsewhere we call this |weak_ptr_|.
alexeypa (please no reviews)
2013/06/07 18:30:23
Done.
|
| + |
| // Singleton. |
| friend struct DefaultSingletonTraits<HostService>; |