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

Side by Side 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: Count the worker exiting too such as a failure. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
6 #define REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
7
8 #include "base/callback_forward.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "remoting/base/stoppable.h"
13 #include "remoting/host/win/wts_console_observer.h"
14 #include "remoting/host/worker_process_ipc_delegate.h"
15
16 namespace base {
17 class SingleThreadTaskRunner;
18 } // namespace base
19
20 namespace remoting {
21
22 class WorkerProcessLauncher;
23 class WtsConsoleMonitor;
24
25 // Launches the host in the session attached to the console. When a new session
26 // attaches to the console relaunches the host in it.
27 class WtsConsoleSessionProcessDriver
28 : public Stoppable,
29 public WorkerProcessIpcDelegate,
30 public WtsConsoleObserver {
31 public:
32 // Constructs a WtsConsoleSessionProcessDriver object. |stopped_callback| will
33 // be invoked to notify the caller that the object is completely stopped. All
34 // public methods of this class must be invoked on the |caller_task_runner|
35 // thread. |monitor| will only be accessed from the |caller_task_runner|
36 // thread. |io_task_runner| must be an I/O message loop.
37 WtsConsoleSessionProcessDriver(
38 const base::Closure& stopped_callback,
39 WtsConsoleMonitor* monitor,
40 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
41 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
42
43 virtual ~WtsConsoleSessionProcessDriver();
44
45 // WorkerProcessIpcDelegate implementation.
46 virtual void OnChannelConnected() OVERRIDE;
47 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
48 virtual void OnPermanentError() OVERRIDE;
49
50 // WtsConsoleObserver implementation.
51 virtual void OnSessionAttached(uint32 session_id) OVERRIDE;
52 virtual void OnSessionDetached() OVERRIDE;
53
54 protected:
55 // Stoppable implementation.
56 virtual void DoStop() OVERRIDE;
57
58 private:
59 // Task runner on which public methods of this class must be called.
60 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
61
62 // Message loop used by the IPC channel.
63 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
64
65 // Launches and monitors the worker process.
66 scoped_ptr<WorkerProcessLauncher> launcher_;
67
68 // Used to unsubscribe from session attach and detach events.
69 WtsConsoleMonitor* monitor_;
70
71 DISALLOW_COPY_AND_ASSIGN(WtsConsoleSessionProcessDriver);
72 };
73
74 } // namespace remoting
75
76 #endif // REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698