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

Unified Diff: remoting/host/daemon_process.h

Issue 10823062: Introducing the DaemonProcess class that will implements core of the daemon process functionality. … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 5 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
« no previous file with comments | « no previous file | remoting/host/daemon_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/daemon_process.h
diff --git a/remoting/host/daemon_process.h b/remoting/host/daemon_process.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b44c2aac9b06054c6f715c24f455ed9aa518ce2
--- /dev/null
+++ b/remoting/host/daemon_process.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_DAEMON_PROCESS_H_
+#define REMOTING_HOST_DAEMON_PROCESS_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "ipc/ipc_channel.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "remoting/base/stoppable.h"
+
+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 {
+ public:
+ virtual ~DaemonProcess();
+
+ // Creates a platform-specific implementation of the daemon process object.
+ static scoped_ptr<DaemonProcess> Create(
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
+ const base::Closure& stopped_callback);
+
+ // IPC::Listener implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ protected:
+ DaemonProcess(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
+ const base::Closure& stopped_callback);
+
+ // Reads the host configuration and launches the networking process.
+ void Init();
+
+ // Stoppable implementation.
+ virtual void DoStop() OVERRIDE;
+
+ // Launches the network process and establishes an IPC channel with it.
+ virtual bool LaunchNetworkProcess() = 0;
+
+ private:
+ // The main task runner. Typically it is the UI message loop.
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+
+ // A dedicated thread for handling IPC requests.
+ scoped_ptr<base::Thread> ipc_thread_;
+
+ // The IPC channel connecting the daemon process to the networking process.
+ scoped_ptr<IPC::ChannelProxy> network_process_channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(DaemonProcess);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_DAEMON_PROCESS_H_
« no previous file with comments | « no previous file | remoting/host/daemon_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698