OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file implements a standalone host process for Me2Me, which is currently | 5 // This file implements a standalone host process for Me2Me, which is currently |
6 // used for the Linux-only Virtual Me2Me build. | 6 // used for the Linux-only Virtual Me2Me build. |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
17 #include "base/file_util.h" | 17 #include "base/file_util.h" |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/message_loop.h" | 19 #include "base/message_loop.h" |
20 #include "base/threading/thread.h" | 20 #include "base/threading/thread.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "crypto/nss_util.h" | 22 #include "crypto/nss_util.h" |
23 #include "remoting/base/constants.h" | 23 #include "remoting/base/constants.h" |
| 24 #include "remoting/host/capturer.h" |
24 #include "remoting/host/chromoting_host.h" | 25 #include "remoting/host/chromoting_host.h" |
25 #include "remoting/host/chromoting_host_context.h" | 26 #include "remoting/host/chromoting_host_context.h" |
26 #include "remoting/host/desktop_environment.h" | 27 #include "remoting/host/desktop_environment.h" |
27 #include "remoting/host/event_executor.h" | 28 #include "remoting/host/event_executor.h" |
28 #include "remoting/host/heartbeat_sender.h" | 29 #include "remoting/host/heartbeat_sender.h" |
29 #include "remoting/host/host_config.h" | 30 #include "remoting/host/host_config.h" |
30 #include "remoting/host/json_host_config.h" | 31 #include "remoting/host/json_host_config.h" |
31 | 32 |
32 #if defined(TOOLKIT_USES_GTK) | 33 #if defined(TOOLKIT_USES_GTK) |
33 #include "ui/gfx/gtk_util.h" | 34 #include "ui/gfx/gtk_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
60 auth_config_path_ = cmd_line->GetSwitchValuePath(kAuthConfigSwitchName); | 61 auth_config_path_ = cmd_line->GetSwitchValuePath(kAuthConfigSwitchName); |
61 } else { | 62 } else { |
62 auth_config_path_ = default_config_dir.Append(kDefaultAuthConfigFile); | 63 auth_config_path_ = default_config_dir.Append(kDefaultAuthConfigFile); |
63 } | 64 } |
64 | 65 |
65 if (cmd_line->HasSwitch(kHostConfigSwitchName)) { | 66 if (cmd_line->HasSwitch(kHostConfigSwitchName)) { |
66 host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName); | 67 host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName); |
67 } else { | 68 } else { |
68 host_config_path_ = default_config_dir.Append(kDefaultHostConfigFile); | 69 host_config_path_ = default_config_dir.Append(kDefaultHostConfigFile); |
69 } | 70 } |
| 71 |
| 72 #if defined(OS_LINUX) |
| 73 Capturer::EnableXDamage(true); |
| 74 #endif |
70 } | 75 } |
71 | 76 |
72 int Run() { | 77 int Run() { |
73 // |message_loop| is declared early so that any code we call into which | 78 // |message_loop| is declared early so that any code we call into which |
74 // requires a current message-loop won't complain. | 79 // requires a current message-loop won't complain. |
75 // It needs to be a UI message loop to keep runloops spinning on the Mac. | 80 // It needs to be a UI message loop to keep runloops spinning on the Mac. |
76 MessageLoop message_loop(MessageLoop::TYPE_UI); | 81 MessageLoop message_loop(MessageLoop::TYPE_UI); |
77 | 82 |
78 remoting::ChromotingHostContext context(base::MessageLoopProxy::current()); | 83 remoting::ChromotingHostContext context(base::MessageLoopProxy::current()); |
79 context.Start(); | 84 context.Start(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // Continue windows, though these should not be used for the Me2Me case | 188 // Continue windows, though these should not be used for the Me2Me case |
184 // (crbug.com/104377). | 189 // (crbug.com/104377). |
185 gfx::GtkInitFromCommandLine(*cmd_line); | 190 gfx::GtkInitFromCommandLine(*cmd_line); |
186 #endif // TOOLKIT_USES_GTK | 191 #endif // TOOLKIT_USES_GTK |
187 | 192 |
188 remoting::HostProcess me2me_host; | 193 remoting::HostProcess me2me_host; |
189 me2me_host.InitWithCommandLine(cmd_line); | 194 me2me_host.InitWithCommandLine(cmd_line); |
190 | 195 |
191 return me2me_host.Run(); | 196 return me2me_host.Run(); |
192 } | 197 } |
OLD | NEW |