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

Unified Diff: remoting/host/win/wts_console_session_process_driver.h

Issue 11040065: [Chromoting] Reimplemented the worker process launcher to take into account the encountered issues: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 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/win/wts_console_session_process_driver.h
diff --git a/remoting/host/win/wts_console_session_process_driver.h b/remoting/host/win/wts_console_session_process_driver.h
new file mode 100644
index 0000000000000000000000000000000000000000..90a8f3bd08250228c6852657909328f40c235df1
--- /dev/null
+++ b/remoting/host/win/wts_console_session_process_driver.h
@@ -0,0 +1,76 @@
+// 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_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
+#define REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
+
+#include "base/callback_forward.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "remoting/base/stoppable.h"
+#include "remoting/host/win/wts_console_observer.h"
+#include "remoting/host/worker_process_ipc_delegate.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
+namespace remoting {
+
+class WorkerProcessLauncher;
+class WtsConsoleMonitor;
+
+// Launches the host in the session attached to the console. When a new session
+// attaches to the console relaunches the host in it.
+class WtsConsoleSessionProcessDriver
+ : public Stoppable,
+ public WorkerProcessIpcDelegate,
+ public WtsConsoleObserver {
+ public:
+ // Constructs a WtsConsoleSessionProcessDriver object. |stopped_callback| will
+ // be invoked to notify the caller that the object is completely stopped. All
+ // public methods of this class must be invoked on the |caller_task_runner|
+ // thread. |monitor| will only be accessed from the |caller_task_runner|
+ // thread. |io_task_runner| must be an I/O message loop.
+ WtsConsoleSessionProcessDriver(
+ const base::Closure& stopped_callback,
+ WtsConsoleMonitor* monitor,
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
+
+ virtual ~WtsConsoleSessionProcessDriver();
+
+ // WorkerProcessIpcDelegate implementation.
+ virtual void OnChannelConnected() OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnPermanentError() OVERRIDE;
+
+ // WtsConsoleObserver implementation.
+ virtual void OnSessionAttached(uint32 session_id) OVERRIDE;
+ virtual void OnSessionDetached() OVERRIDE;
+
+ protected:
+ // Stoppable implementation.
+ virtual void DoStop() OVERRIDE;
+
+ private:
+ // Task runner on which public methods of this class must be called.
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
+
+ // Message loop used by the IPC channel.
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+
+ // Launches and monitors the worker process.
+ scoped_ptr<WorkerProcessLauncher> launcher_;
+
+ // Used to unsubscribe from session attach and detach events.
+ WtsConsoleMonitor* monitor_;
+
+ DISALLOW_COPY_AND_ASSIGN(WtsConsoleSessionProcessDriver);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
« no previous file with comments | « remoting/host/win/worker_process_launcher_unittest.cc ('k') | remoting/host/win/wts_console_session_process_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698