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

Side by Side Diff: remoting/host/host_service_win.h

Issue 10832068: Moving Windows-only files: remoting/host -> remoting/host/win. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « remoting/host/host_service_resource.h ('k') | remoting/host/host_service_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_HOST_SERVICE_WIN_H_
6 #define REMOTING_HOST_HOST_SERVICE_WIN_H_
7
8 #include <windows.h>
9
10 #include "base/file_path.h"
11 #include "base/memory/singleton.h"
12 #include "base/observer_list.h"
13 #include "base/synchronization/waitable_event.h"
14
15 #include "remoting/host/wts_console_monitor_win.h"
16
17 class CommandLine;
18 class MessageLoop;
19
20 namespace remoting {
21
22 class WtsConsoleObserver;
23
24 class HostService : public WtsConsoleMonitor {
25 public:
26 static HostService* GetInstance();
27
28 // This function parses the command line and selects the action routine.
29 bool InitWithCommandLine(const CommandLine* command_line);
30
31 // Invoke the choosen action routine.
32 int Run();
33
34 // WtsConsoleMonitor implementation
35 virtual void AddWtsConsoleObserver(WtsConsoleObserver* observer) OVERRIDE;
36 virtual void RemoveWtsConsoleObserver(
37 WtsConsoleObserver* observer) OVERRIDE;
38
39 private:
40 HostService();
41 ~HostService();
42
43 // Notifies the service of changes in session state.
44 void OnSessionChange();
45
46 // This is a common entry point to the main service loop called by both
47 // RunAsService() and RunInConsole().
48 void RunMessageLoop();
49
50 // This function handshakes with the service control manager and starts
51 // the service.
52 int RunAsService();
53
54 // This function starts the service in interactive mode (i.e. as a plain
55 // console application).
56 int RunInConsole();
57
58 static BOOL WINAPI ConsoleControlHandler(DWORD event);
59
60 // The control handler of the service.
61 static DWORD WINAPI ServiceControlHandler(DWORD control,
62 DWORD event_type,
63 LPVOID event_data,
64 LPVOID context);
65
66 // The main service entry point.
67 static VOID WINAPI ServiceMain(DWORD argc, WCHAR* argv[]);
68
69 static LRESULT CALLBACK SessionChangeNotificationProc(HWND hwnd,
70 UINT message,
71 WPARAM wparam,
72 LPARAM lparam);
73
74 // Current physical console session id.
75 uint32 console_session_id_;
76
77 // The list of observers receiving notifications about any session attached
78 // to the physical console.
79 ObserverList<WtsConsoleObserver> console_observers_;
80
81 // The host binary name.
82 FilePath host_binary_;
83
84 // Service message loop.
85 MessageLoop* message_loop_;
86
87 // The action routine to be executed.
88 int (HostService::*run_routine_)();
89
90 // The service name.
91 std::wstring service_name_;
92
93 // The service status handle.
94 SERVICE_STATUS_HANDLE service_status_handle_;
95
96 // True if the service is being stopped.
97 bool shutting_down_;
98
99 // A waitable event that is used to wait until the service is stopped.
100 base::WaitableEvent stopped_event_;
101
102 // Singleton.
103 friend struct DefaultSingletonTraits<HostService>;
104
105 DISALLOW_COPY_AND_ASSIGN(HostService);
106 };
107
108 } // namespace remoting
109
110 #endif // REMOTING_HOST_HOST_SERVICE_WIN_H_
OLDNEW
« no previous file with comments | « remoting/host/host_service_resource.h ('k') | remoting/host/host_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698