| Index: remoting/host/daemon_process.h
|
| diff --git a/remoting/host/daemon_process.h b/remoting/host/daemon_process.h
|
| index ed5f4cba1fc4a37598baa350fe6ec8f124ff1885..823bf89e1ffac65bc7a545fa067b4917efd092fc 100644
|
| --- a/remoting/host/daemon_process.h
|
| +++ b/remoting/host/daemon_process.h
|
| @@ -12,22 +12,24 @@
|
| #include "ipc/ipc_channel.h"
|
| #include "ipc/ipc_channel_proxy.h"
|
| #include "remoting/base/stoppable.h"
|
| +#include "remoting/host/config_file_watcher.h"
|
| +#include "remoting/host/worker_process_ipc_delegate.h"
|
| +
|
| +class FilePath;
|
|
|
| namespace base {
|
| class SingleThreadTaskRunner;
|
| -class Thread;
|
| } // namespace base
|
|
|
| -namespace IPC {
|
| -class Message;
|
| -} // namespace IPC
|
| -
|
| namespace remoting {
|
|
|
| // This class implements core of the daemon process. It manages the networking
|
| // process running at lower privileges and maintains the list of virtual
|
| // terminals.
|
| -class DaemonProcess : public Stoppable, public IPC::Listener {
|
| +class DaemonProcess
|
| + : public Stoppable,
|
| + public ConfigFileWatcher::Delegate,
|
| + public WorkerProcessIpcDelegate {
|
| public:
|
| virtual ~DaemonProcess();
|
|
|
| @@ -37,33 +39,52 @@ class DaemonProcess : public Stoppable, public IPC::Listener {
|
| scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
| const base::Closure& stopped_callback);
|
|
|
| - // IPC::Listener implementation.
|
| + // ConfigFileWatcher::Delegate
|
| + virtual void OnConfigUpdated(const std::string& config) OVERRIDE;
|
| + virtual void OnConfigWatcherError() OVERRIDE;
|
| +
|
| + // WorkerProcessIpcDelegate implementation.
|
| + virtual void OnChannelConnected() OVERRIDE;
|
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
|
|
| + // Sends an IPC message to the network process. The message will be dropped
|
| + // unless the network process is connected over the IPC channel.
|
| + virtual void Send(IPC::Message* message) = 0;
|
| +
|
| protected:
|
| DaemonProcess(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
| const base::Closure& stopped_callback);
|
|
|
| // Reads the host configuration and launches the networking process.
|
| - void Init();
|
| + void Initialize();
|
|
|
| // Stoppable implementation.
|
| virtual void DoStop() OVERRIDE;
|
|
|
| // Launches the network process and establishes an IPC channel with it.
|
| - virtual bool LaunchNetworkProcess() = 0;
|
| + virtual void LaunchNetworkProcess() = 0;
|
| +
|
| + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner() {
|
| + return main_task_runner_;
|
| + }
|
| +
|
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner() {
|
| + return io_task_runner_;
|
| + }
|
|
|
| private:
|
| + // The configuration file contents.
|
| + std::string config_;
|
| +
|
| + scoped_ptr<ConfigFileWatcher> config_watcher_;
|
| +
|
| // The main task runner. Typically it is the UI message loop.
|
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
|
|
|
| // Handles IPC and background I/O tasks.
|
| scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
|
|
|
| - // The IPC channel connecting the daemon process to the networking process.
|
| - scoped_ptr<IPC::ChannelProxy> network_process_channel_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(DaemonProcess);
|
| };
|
|
|
|
|