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/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/files/file_path_watcher.h" | 15 #include "base/files/file_path_watcher.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.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 "net/base/network_change_notifier.h" | 23 #include "net/base/network_change_notifier.h" |
| 24 #include "net/socket/ssl_server_socket.h" |
24 #include "remoting/base/breakpad.h" | 25 #include "remoting/base/breakpad.h" |
25 #include "remoting/base/constants.h" | 26 #include "remoting/base/constants.h" |
26 #include "remoting/host/branding.h" | 27 #include "remoting/host/branding.h" |
27 #include "remoting/host/breakpad.h" | 28 #include "remoting/host/breakpad.h" |
28 #include "remoting/host/constants.h" | 29 #include "remoting/host/constants.h" |
29 #include "remoting/host/capturer.h" | 30 #include "remoting/host/capturer.h" |
30 #include "remoting/host/chromoting_host.h" | 31 #include "remoting/host/chromoting_host.h" |
31 #include "remoting/host/chromoting_host_context.h" | 32 #include "remoting/host/chromoting_host_context.h" |
32 #include "remoting/host/desktop_environment.h" | 33 #include "remoting/host/desktop_environment.h" |
33 #include "remoting/host/event_executor.h" | 34 #include "remoting/host/event_executor.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 540 |
540 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 541 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
541 | 542 |
542 #if defined(TOOLKIT_GTK) | 543 #if defined(TOOLKIT_GTK) |
543 // Required for any calls into GTK functions, such as the Disconnect and | 544 // Required for any calls into GTK functions, such as the Disconnect and |
544 // Continue windows, though these should not be used for the Me2Me case | 545 // Continue windows, though these should not be used for the Me2Me case |
545 // (crbug.com/104377). | 546 // (crbug.com/104377). |
546 gfx::GtkInitFromCommandLine(*cmd_line); | 547 gfx::GtkInitFromCommandLine(*cmd_line); |
547 #endif // TOOLKIT_GTK | 548 #endif // TOOLKIT_GTK |
548 | 549 |
| 550 // Enable support for SSL server sockets, which must be done while still |
| 551 // single-threaded. |
| 552 net::EnableSSLServerSockets(); |
| 553 |
549 remoting::HostProcess me2me_host; | 554 remoting::HostProcess me2me_host; |
550 me2me_host.InitWithCommandLine(cmd_line); | 555 me2me_host.InitWithCommandLine(cmd_line); |
551 | 556 |
552 return me2me_host.Run(); | 557 return me2me_host.Run(); |
553 } | 558 } |
554 | 559 |
555 #if defined(OS_WIN) | 560 #if defined(OS_WIN) |
556 HMODULE g_hModule = NULL; | 561 HMODULE g_hModule = NULL; |
557 | 562 |
558 int CALLBACK WinMain(HINSTANCE instance, | 563 int CALLBACK WinMain(HINSTANCE instance, |
(...skipping 15 matching lines...) Expand all Loading... |
574 | 579 |
575 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. | 580 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. |
576 SetProcessDPIAware(); | 581 SetProcessDPIAware(); |
577 | 582 |
578 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 583 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
579 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 584 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
580 return main(0, NULL); | 585 return main(0, NULL); |
581 } | 586 } |
582 | 587 |
583 #endif // defined(OS_WIN) | 588 #endif // defined(OS_WIN) |
OLD | NEW |