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" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
| 23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
| 24 #include "base/threading/thread.h" | 24 #include "base/threading/thread.h" |
| 25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
| 26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 27 #include "crypto/nss_util.h" | 27 #include "crypto/nss_util.h" |
| 28 #include "ipc/ipc_channel.h" | 28 #include "ipc/ipc_channel.h" |
| 29 #include "ipc/ipc_channel_proxy.h" | 29 #include "ipc/ipc_channel_proxy.h" |
| 30 #include "ipc/ipc_listener.h" | 30 #include "ipc/ipc_listener.h" |
| 31 #include "media/base/media.h" | |
| 31 #include "net/base/network_change_notifier.h" | 32 #include "net/base/network_change_notifier.h" |
| 32 #include "net/socket/ssl_server_socket.h" | 33 #include "net/socket/ssl_server_socket.h" |
| 33 #include "net/url_request/url_fetcher.h" | 34 #include "net/url_request/url_fetcher.h" |
| 34 #include "remoting/base/auto_thread_task_runner.h" | 35 #include "remoting/base/auto_thread_task_runner.h" |
| 35 #include "remoting/base/breakpad.h" | 36 #include "remoting/base/breakpad.h" |
| 36 #include "remoting/base/constants.h" | 37 #include "remoting/base/constants.h" |
| 37 #include "remoting/base/rsa_key_pair.h" | 38 #include "remoting/base/rsa_key_pair.h" |
| 38 #include "remoting/base/util.h" | 39 #include "remoting/base/util.h" |
| 39 #include "remoting/host/branding.h" | 40 #include "remoting/host/branding.h" |
| 40 #include "remoting/host/chromoting_host.h" | 41 #include "remoting/host/chromoting_host.h" |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 // Required for any calls into GTK functions, such as the Disconnect and | 1039 // Required for any calls into GTK functions, such as the Disconnect and |
| 1039 // Continue windows, though these should not be used for the Me2Me case | 1040 // Continue windows, though these should not be used for the Me2Me case |
| 1040 // (crbug.com/104377). | 1041 // (crbug.com/104377). |
| 1041 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 1042 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
| 1042 #endif // TOOLKIT_GTK | 1043 #endif // TOOLKIT_GTK |
| 1043 | 1044 |
| 1044 // Enable support for SSL server sockets, which must be done while still | 1045 // Enable support for SSL server sockets, which must be done while still |
| 1045 // single-threaded. | 1046 // single-threaded. |
| 1046 net::EnableSSLServerSockets(); | 1047 net::EnableSSLServerSockets(); |
| 1047 | 1048 |
| 1049 // Ensures runtime specific CPU features are initialized. | |
| 1050 media::InitializeCPUSpecificMediaFeatures(); | |
|
Wez
2013/05/30 17:17:29
This looks reasonable given the bug description, b
alexeypa (please no reviews)
2013/05/30 17:35:01
I just mirrored the corresponding change in remoti
| |
| 1051 | |
| 1048 // Create the main message loop and start helper threads. | 1052 // Create the main message loop and start helper threads. |
| 1049 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); | 1053 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); |
| 1050 scoped_ptr<ChromotingHostContext> context = | 1054 scoped_ptr<ChromotingHostContext> context = |
| 1051 ChromotingHostContext::Create(new AutoThreadTaskRunner( | 1055 ChromotingHostContext::Create(new AutoThreadTaskRunner( |
| 1052 message_loop.message_loop_proxy(), base::MessageLoop::QuitClosure())); | 1056 message_loop.message_loop_proxy(), base::MessageLoop::QuitClosure())); |
| 1053 if (!context) | 1057 if (!context) |
| 1054 return kInitializationFailed; | 1058 return kInitializationFailed; |
| 1055 | 1059 |
| 1056 // Create & start the HostProcess using these threads. | 1060 // Create & start the HostProcess using these threads. |
| 1057 // TODO(wez): The HostProcess holds a reference to itself until Shutdown(). | 1061 // TODO(wez): The HostProcess holds a reference to itself until Shutdown(). |
| 1058 // Remove this hack as part of the multi-process refactoring. | 1062 // Remove this hack as part of the multi-process refactoring. |
| 1059 int exit_code = kSuccessExitCode; | 1063 int exit_code = kSuccessExitCode; |
| 1060 new HostProcess(context.Pass(), &exit_code); | 1064 new HostProcess(context.Pass(), &exit_code); |
| 1061 | 1065 |
| 1062 // Run the main (also UI) message loop until the host no longer needs it. | 1066 // Run the main (also UI) message loop until the host no longer needs it. |
| 1063 message_loop.Run(); | 1067 message_loop.Run(); |
| 1064 | 1068 |
| 1065 return exit_code; | 1069 return exit_code; |
| 1066 } | 1070 } |
| 1067 | 1071 |
| 1068 } // namespace remoting | 1072 } // namespace remoting |
| 1069 | 1073 |
| 1070 #if !defined(OS_WIN) | 1074 #if !defined(OS_WIN) |
| 1071 int main(int argc, char** argv) { | 1075 int main(int argc, char** argv) { |
| 1072 return remoting::HostMain(argc, argv); | 1076 return remoting::HostMain(argc, argv); |
| 1073 } | 1077 } |
| 1074 #endif // !defined(OS_WIN) | 1078 #endif // !defined(OS_WIN) |
| OLD | NEW |