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 is an application of a minimal host process in a Chromoting | 5 // This is an application of a minimal host process in a Chromoting |
6 // system. It serves the purpose of gluing different pieces together | 6 // system. It serves the purpose of gluing different pieces together |
7 // to make a functional host process for testing. | 7 // to make a functional host process for testing. |
8 // | 8 // |
9 // It peforms the following functionality: | 9 // It peforms the following functionality: |
10 // 1. Connect to the GTalk network and register the machine as a host. | 10 // 1. Connect to the GTalk network and register the machine as a host. |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/environment.h" | 24 #include "base/environment.h" |
25 #include "base/file_path.h" | 25 #include "base/file_path.h" |
26 #include "base/logging.h" | 26 #include "base/logging.h" |
27 #include "base/message_loop.h" | 27 #include "base/message_loop.h" |
28 #include "base/path_service.h" | 28 #include "base/path_service.h" |
29 #include "base/string_number_conversions.h" | 29 #include "base/string_number_conversions.h" |
30 #include "base/utf_string_conversions.h" | 30 #include "base/utf_string_conversions.h" |
31 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
32 #include "crypto/nss_util.h" | 32 #include "crypto/nss_util.h" |
33 #include "net/base/network_change_notifier.h" | 33 #include "net/base/network_change_notifier.h" |
| 34 #include "net/socket/ssl_server_socket.h" |
34 #include "remoting/base/constants.h" | 35 #include "remoting/base/constants.h" |
35 #include "remoting/host/capturer_fake.h" | 36 #include "remoting/host/capturer_fake.h" |
36 #include "remoting/host/chromoting_host.h" | 37 #include "remoting/host/chromoting_host.h" |
37 #include "remoting/host/chromoting_host_context.h" | 38 #include "remoting/host/chromoting_host_context.h" |
38 #include "remoting/host/constants.h" | 39 #include "remoting/host/constants.h" |
39 #include "remoting/host/desktop_environment.h" | 40 #include "remoting/host/desktop_environment.h" |
40 #include "remoting/host/event_executor.h" | 41 #include "remoting/host/event_executor.h" |
41 #include "remoting/host/heartbeat_sender.h" | 42 #include "remoting/host/heartbeat_sender.h" |
42 #include "remoting/host/host_key_pair.h" | 43 #include "remoting/host/host_key_pair.h" |
43 #include "remoting/host/host_secret.h" | 44 #include "remoting/host/host_secret.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 CommandLine::Init(argc, argv); | 343 CommandLine::Init(argc, argv); |
343 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 344 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
344 | 345 |
345 base::AtExitManager exit_manager; | 346 base::AtExitManager exit_manager; |
346 crypto::EnsureNSPRInit(); | 347 crypto::EnsureNSPRInit(); |
347 | 348 |
348 #if defined(TOOLKIT_GTK) | 349 #if defined(TOOLKIT_GTK) |
349 gfx::GtkInitFromCommandLine(*cmd_line); | 350 gfx::GtkInitFromCommandLine(*cmd_line); |
350 #endif // TOOLKIT_GTK | 351 #endif // TOOLKIT_GTK |
351 | 352 |
| 353 // Enable support for SSL server sockets, which must be done while still |
| 354 // single-threaded. |
| 355 net::EnableSSLServerSockets(); |
| 356 |
352 remoting::SimpleHost simple_host; | 357 remoting::SimpleHost simple_host; |
353 | 358 |
354 if (cmd_line->HasSwitch(kConfigSwitchName)) { | 359 if (cmd_line->HasSwitch(kConfigSwitchName)) { |
355 simple_host.set_config_path( | 360 simple_host.set_config_path( |
356 cmd_line->GetSwitchValuePath(kConfigSwitchName)); | 361 cmd_line->GetSwitchValuePath(kConfigSwitchName)); |
357 } | 362 } |
358 simple_host.set_fake(cmd_line->HasSwitch(kFakeSwitchName)); | 363 simple_host.set_fake(cmd_line->HasSwitch(kFakeSwitchName)); |
359 simple_host.set_is_it2me(cmd_line->HasSwitch(kIT2MeSwitchName)); | 364 simple_host.set_is_it2me(cmd_line->HasSwitch(kIT2MeSwitchName)); |
360 | 365 |
361 if (cmd_line->HasSwitch(kVideoSwitchName)) { | 366 if (cmd_line->HasSwitch(kVideoSwitchName)) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 max_port < 0 || max_port > 65535) { | 412 max_port < 0 || max_port > 65535) { |
408 LOG(ERROR) << "Invalid max-port value: " << max_port | 413 LOG(ERROR) << "Invalid max-port value: " << max_port |
409 << ". Expected integer in range [0, 65535]."; | 414 << ". Expected integer in range [0, 65535]."; |
410 return 1; | 415 return 1; |
411 } | 416 } |
412 simple_host.network_settings()->max_port = max_port; | 417 simple_host.network_settings()->max_port = max_port; |
413 } | 418 } |
414 | 419 |
415 return simple_host.Run(); | 420 return simple_host.Run(); |
416 } | 421 } |
OLD | NEW |