Chromium Code Reviews| 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" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/debug/alias.h" | 13 #include "base/debug/alias.h" |
| 14 #include "base/file_util.h" | |
| 15 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 18 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 19 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 22 #include "base/synchronization/waitable_event.h" | 21 #include "base/synchronization/waitable_event.h" |
| 23 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 24 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 #endif // defined(OS_LINUX) | 91 #endif // defined(OS_LINUX) |
| 93 | 92 |
| 94 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
| 95 #include <commctrl.h> | 94 #include <commctrl.h> |
| 96 #include "base/win/registry.h" | 95 #include "base/win/registry.h" |
| 97 #include "base/win/scoped_handle.h" | 96 #include "base/win/scoped_handle.h" |
| 98 #include "remoting/host/pairing_registry_delegate_win.h" | 97 #include "remoting/host/pairing_registry_delegate_win.h" |
| 99 #include "remoting/host/win/session_desktop_environment.h" | 98 #include "remoting/host/win/session_desktop_environment.h" |
| 100 #endif // defined(OS_WIN) | 99 #endif // defined(OS_WIN) |
| 101 | 100 |
| 102 #if defined(TOOLKIT_GTK) | |
| 103 #include "ui/gfx/gtk_util.h" | |
| 104 #endif // defined(TOOLKIT_GTK) | |
| 105 | |
| 106 using remoting::protocol::PairingRegistry; | 101 using remoting::protocol::PairingRegistry; |
| 107 | 102 |
| 108 namespace { | 103 namespace { |
| 109 | 104 |
| 110 // This is used for tagging system event logs. | 105 // This is used for tagging system event logs. |
| 111 const char kApplicationName[] = "chromoting"; | 106 const char kApplicationName[] = "chromoting"; |
| 112 | 107 |
| 113 #if defined(OS_LINUX) | 108 #if defined(OS_LINUX) |
| 114 // The command line switch used to pass name of the pipe to capture audio on | 109 // The command line switch used to pass name of the pipe to capture audio on |
| 115 // linux. | 110 // linux. |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1312 base::snprintf(message, sizeof(message), | 1307 base::snprintf(message, sizeof(message), |
| 1313 "Requested by %s at %s, line %d.", | 1308 "Requested by %s at %s, line %d.", |
| 1314 function_name.c_str(), file_name.c_str(), line_number); | 1309 function_name.c_str(), file_name.c_str(), line_number); |
| 1315 base::debug::Alias(message); | 1310 base::debug::Alias(message); |
| 1316 | 1311 |
| 1317 // The daemon requested us to crash the process. | 1312 // The daemon requested us to crash the process. |
| 1318 CHECK(false) << message; | 1313 CHECK(false) << message; |
| 1319 } | 1314 } |
| 1320 | 1315 |
| 1321 int HostProcessMain() { | 1316 int HostProcessMain() { |
| 1322 #if defined(TOOLKIT_GTK) | |
|
Sergey Ulanov
2014/06/10 05:29:39
This needs to changed to OS_LINUX, but we don't wo
Lei Zhang
2014/06/10 05:38:39
but ui/gfx/gtk_util.h doesn't exist anymore and gf
Sergey Ulanov
2014/06/10 06:05:55
We can't depend on src/chrome here. Please replace
Lei Zhang
2014/06/10 07:02:28
Done.
| |
| 1323 // Required for any calls into GTK functions, such as the Disconnect and | |
| 1324 // Continue windows, though these should not be used for the Me2Me case | |
| 1325 // (crbug.com/104377). | |
| 1326 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | |
| 1327 #endif // TOOLKIT_GTK | |
| 1328 | |
| 1329 // Enable support for SSL server sockets, which must be done while still | 1317 // Enable support for SSL server sockets, which must be done while still |
| 1330 // single-threaded. | 1318 // single-threaded. |
| 1331 net::EnableSSLServerSockets(); | 1319 net::EnableSSLServerSockets(); |
| 1332 | 1320 |
| 1333 // Ensures runtime specific CPU features are initialized. | 1321 // Ensures runtime specific CPU features are initialized. |
| 1334 media::InitializeCPUSpecificMediaFeatures(); | 1322 media::InitializeCPUSpecificMediaFeatures(); |
| 1335 | 1323 |
| 1336 // Create the main message loop and start helper threads. | 1324 // Create the main message loop and start helper threads. |
| 1337 base::MessageLoopForUI message_loop; | 1325 base::MessageLoopForUI message_loop; |
| 1338 scoped_ptr<ChromotingHostContext> context = | 1326 scoped_ptr<ChromotingHostContext> context = |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1353 return exit_code; | 1341 return exit_code; |
| 1354 } | 1342 } |
| 1355 | 1343 |
| 1356 } // namespace remoting | 1344 } // namespace remoting |
| 1357 | 1345 |
| 1358 #if !defined(OS_WIN) | 1346 #if !defined(OS_WIN) |
| 1359 int main(int argc, char** argv) { | 1347 int main(int argc, char** argv) { |
| 1360 return remoting::HostMain(argc, argv); | 1348 return remoting::HostMain(argc, argv); |
| 1361 } | 1349 } |
| 1362 #endif // !defined(OS_WIN) | 1350 #endif // !defined(OS_WIN) |
| OLD | NEW |