summaryrefslogtreecommitdiffstats
path: root/remoting/host/daemon_process.h
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-05 19:58:36 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-05 19:58:36 +0000
commitdf338b7db4dfebd184886fec55db969305c94f07 (patch)
tree8e0184e81556899615ffac2120efe0ea563a1cce /remoting/host/daemon_process.h
parente2206627c1f4f26425b7ba51a21e8d021956bea1 (diff)
downloadchromium_src-df338b7db4dfebd184886fec55db969305c94f07.zip
chromium_src-df338b7db4dfebd184886fec55db969305c94f07.tar.gz
chromium_src-df338b7db4dfebd184886fec55db969305c94f07.tar.bz2
[Chromoting] The daemon process now starts the networking process and passes the host configuration (and updates) over the IPC channel.
This CL also switches to FilePathWatcher (to detect the configuration file changes) on all platforms. BUG=123696,134694 Review URL: https://chromiumcodereview.appspot.com/10855249 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154999 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/daemon_process.h')
-rw-r--r--remoting/host/daemon_process.h45
1 files changed, 33 insertions, 12 deletions
diff --git a/remoting/host/daemon_process.h b/remoting/host/daemon_process.h
index ed5f4cb..a52be9e 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& serialized_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:
+ scoped_ptr<ConfigFileWatcher> config_watcher_;
+
+ // The configuration file contents.
+ std::string serialized_config_;
+
// 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);
};