OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 #include "base/file_descriptor_posix.h" | 81 #include "base/file_descriptor_posix.h" |
82 #include "remoting/host/pam_authorization_factory_posix.h" | 82 #include "remoting/host/pam_authorization_factory_posix.h" |
83 #include "remoting/host/posix/signal_handler.h" | 83 #include "remoting/host/posix/signal_handler.h" |
84 #endif // defined(OS_POSIX) | 84 #endif // defined(OS_POSIX) |
85 | 85 |
86 #if defined(OS_MACOSX) | 86 #if defined(OS_MACOSX) |
87 #include "base/mac/scoped_cftyperef.h" | 87 #include "base/mac/scoped_cftyperef.h" |
88 #endif // defined(OS_MACOSX) | 88 #endif // defined(OS_MACOSX) |
89 | 89 |
90 #if defined(OS_LINUX) | 90 #if defined(OS_LINUX) |
| 91 #include <gtk/gtk.h> |
91 #include "remoting/host/audio_capturer_linux.h" | 92 #include "remoting/host/audio_capturer_linux.h" |
92 #endif // defined(OS_LINUX) | 93 #endif // defined(OS_LINUX) |
93 | 94 |
94 #if defined(OS_WIN) | 95 #if defined(OS_WIN) |
95 #include <commctrl.h> | 96 #include <commctrl.h> |
96 #include "base/win/registry.h" | 97 #include "base/win/registry.h" |
97 #include "base/win/scoped_handle.h" | 98 #include "base/win/scoped_handle.h" |
98 #include "remoting/host/pairing_registry_delegate_win.h" | 99 #include "remoting/host/pairing_registry_delegate_win.h" |
99 #include "remoting/host/win/session_desktop_environment.h" | 100 #include "remoting/host/win/session_desktop_environment.h" |
100 #endif // defined(OS_WIN) | 101 #endif // defined(OS_WIN) |
101 | |
102 #if defined(TOOLKIT_GTK) | |
103 #include "ui/gfx/gtk_util.h" | |
104 #endif // defined(TOOLKIT_GTK) | |
105 | |
106 using remoting::protocol::PairingRegistry; | 102 using remoting::protocol::PairingRegistry; |
107 | 103 |
108 namespace { | 104 namespace { |
109 | 105 |
110 // This is used for tagging system event logs. | 106 // This is used for tagging system event logs. |
111 const char kApplicationName[] = "chromoting"; | 107 const char kApplicationName[] = "chromoting"; |
112 | 108 |
113 #if defined(OS_LINUX) | 109 #if defined(OS_LINUX) |
114 // The command line switch used to pass name of the pipe to capture audio on | 110 // The command line switch used to pass name of the pipe to capture audio on |
115 // linux. | 111 // linux. |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 base::snprintf(message, sizeof(message), | 1315 base::snprintf(message, sizeof(message), |
1320 "Requested by %s at %s, line %d.", | 1316 "Requested by %s at %s, line %d.", |
1321 function_name.c_str(), file_name.c_str(), line_number); | 1317 function_name.c_str(), file_name.c_str(), line_number); |
1322 base::debug::Alias(message); | 1318 base::debug::Alias(message); |
1323 | 1319 |
1324 // The daemon requested us to crash the process. | 1320 // The daemon requested us to crash the process. |
1325 CHECK(false) << message; | 1321 CHECK(false) << message; |
1326 } | 1322 } |
1327 | 1323 |
1328 int HostProcessMain() { | 1324 int HostProcessMain() { |
1329 #if defined(TOOLKIT_GTK) | 1325 #if defined(OS_LINUX) |
1330 // Required for any calls into GTK functions, such as the Disconnect and | 1326 // Required for any calls into GTK functions, such as the Disconnect and |
1331 // Continue windows, though these should not be used for the Me2Me case | 1327 // Continue windows, though these should not be used for the Me2Me case |
1332 // (crbug.com/104377). | 1328 // (crbug.com/104377). |
1333 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 1329 gtk_init(NULL, NULL); |
1334 #endif // TOOLKIT_GTK | 1330 #endif |
1335 | 1331 |
1336 // Enable support for SSL server sockets, which must be done while still | 1332 // Enable support for SSL server sockets, which must be done while still |
1337 // single-threaded. | 1333 // single-threaded. |
1338 net::EnableSSLServerSockets(); | 1334 net::EnableSSLServerSockets(); |
1339 | 1335 |
1340 // Ensures runtime specific CPU features are initialized. | 1336 // Ensures runtime specific CPU features are initialized. |
1341 media::InitializeCPUSpecificMediaFeatures(); | 1337 media::InitializeCPUSpecificMediaFeatures(); |
1342 | 1338 |
1343 // Create the main message loop and start helper threads. | 1339 // Create the main message loop and start helper threads. |
1344 base::MessageLoopForUI message_loop; | 1340 base::MessageLoopForUI message_loop; |
(...skipping 15 matching lines...) Expand all Loading... |
1360 return exit_code; | 1356 return exit_code; |
1361 } | 1357 } |
1362 | 1358 |
1363 } // namespace remoting | 1359 } // namespace remoting |
1364 | 1360 |
1365 #if !defined(OS_WIN) | 1361 #if !defined(OS_WIN) |
1366 int main(int argc, char** argv) { | 1362 int main(int argc, char** argv) { |
1367 return remoting::HostMain(argc, argv); | 1363 return remoting::HostMain(argc, argv); |
1368 } | 1364 } |
1369 #endif // !defined(OS_WIN) | 1365 #endif // !defined(OS_WIN) |
OLD | NEW |