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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 GetSwitchValuePath(kAuthSocknameSwitchName); | 887 GetSwitchValuePath(kAuthSocknameSwitchName); |
888 if (!gnubby_socket_name.empty()) | 888 if (!gnubby_socket_name.empty()) |
889 remoting::GnubbyAuthHandler::SetGnubbySocketName(gnubby_socket_name); | 889 remoting::GnubbyAuthHandler::SetGnubbySocketName(gnubby_socket_name); |
890 #endif // defined(OS_LINUX) | 890 #endif // defined(OS_LINUX) |
891 | 891 |
892 // Create a desktop environment factory appropriate to the build type & | 892 // Create a desktop environment factory appropriate to the build type & |
893 // platform. | 893 // platform. |
894 #if defined(REMOTING_MULTI_PROCESS) | 894 #if defined(REMOTING_MULTI_PROCESS) |
895 IpcDesktopEnvironmentFactory* desktop_environment_factory = | 895 IpcDesktopEnvironmentFactory* desktop_environment_factory = |
896 new IpcDesktopEnvironmentFactory( | 896 new IpcDesktopEnvironmentFactory( |
897 context_->audio_task_runner(), | 897 context_->audio_task_runner(), context_->network_task_runner(), |
898 context_->network_task_runner(), | 898 context_->network_task_runner(), daemon_channel_.get()); |
899 context_->video_capture_task_runner(), | |
900 context_->network_task_runner(), | |
901 daemon_channel_.get()); | |
902 desktop_session_connector_ = desktop_environment_factory; | 899 desktop_session_connector_ = desktop_environment_factory; |
903 #else // !defined(REMOTING_MULTI_PROCESS) | 900 #else // !defined(REMOTING_MULTI_PROCESS) |
904 BasicDesktopEnvironmentFactory* desktop_environment_factory; | 901 BasicDesktopEnvironmentFactory* desktop_environment_factory; |
905 if (enable_window_capture_) { | 902 if (enable_window_capture_) { |
906 desktop_environment_factory = | 903 desktop_environment_factory = new SingleWindowDesktopEnvironmentFactory( |
907 new SingleWindowDesktopEnvironmentFactory( | 904 context_->network_task_runner(), context_->video_capture_task_runner(), |
908 context_->network_task_runner(), | 905 context_->input_task_runner(), context_->ui_task_runner(), window_id_); |
909 context_->input_task_runner(), | |
910 context_->ui_task_runner(), | |
911 window_id_); | |
912 } else { | 906 } else { |
913 desktop_environment_factory = | 907 desktop_environment_factory = new Me2MeDesktopEnvironmentFactory( |
914 new Me2MeDesktopEnvironmentFactory( | 908 context_->network_task_runner(), context_->video_capture_task_runner(), |
915 context_->network_task_runner(), | 909 context_->input_task_runner(), context_->ui_task_runner()); |
916 context_->input_task_runner(), | |
917 context_->ui_task_runner()); | |
918 } | 910 } |
919 #endif // !defined(REMOTING_MULTI_PROCESS) | 911 #endif // !defined(REMOTING_MULTI_PROCESS) |
920 desktop_environment_factory->set_supports_touch_events( | 912 desktop_environment_factory->set_supports_touch_events( |
921 InputInjector::SupportsTouchEvents()); | 913 InputInjector::SupportsTouchEvents()); |
922 | 914 |
923 desktop_environment_factory_.reset(desktop_environment_factory); | 915 desktop_environment_factory_.reset(desktop_environment_factory); |
924 desktop_environment_factory_->SetEnableGnubbyAuth(enable_gnubby_auth_); | 916 desktop_environment_factory_->SetEnableGnubbyAuth(enable_gnubby_auth_); |
925 | 917 |
926 context_->network_task_runner()->PostTask( | 918 context_->network_task_runner()->PostTask( |
927 FROM_HERE, | 919 FROM_HERE, |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 if (!desktop_environment_factory_->SupportsAudioCapture()) | 1516 if (!desktop_environment_factory_->SupportsAudioCapture()) |
1525 protocol_config->DisableAudioChannel(); | 1517 protocol_config->DisableAudioChannel(); |
1526 if (enable_vp9_) | 1518 if (enable_vp9_) |
1527 protocol_config->set_vp9_experiment_enabled(true); | 1519 protocol_config->set_vp9_experiment_enabled(true); |
1528 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1520 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1529 kEnableWebrtcSwitchName)) { | 1521 kEnableWebrtcSwitchName)) { |
1530 protocol_config->set_webrtc_supported(true); | 1522 protocol_config->set_webrtc_supported(true); |
1531 } | 1523 } |
1532 session_manager->set_protocol_config(std::move(protocol_config)); | 1524 session_manager->set_protocol_config(std::move(protocol_config)); |
1533 | 1525 |
1534 host_.reset(new ChromotingHost( | 1526 host_.reset(new ChromotingHost(desktop_environment_factory_.get(), |
1535 desktop_environment_factory_.get(), std::move(session_manager), | 1527 std::move(session_manager), transport_context, |
1536 transport_context, context_->audio_task_runner(), | 1528 context_->audio_task_runner(), |
1537 context_->input_task_runner(), context_->video_capture_task_runner(), | 1529 context_->video_encode_task_runner())); |
1538 context_->video_encode_task_runner(), context_->network_task_runner(), | |
1539 context_->ui_task_runner())); | |
1540 | 1530 |
1541 if (frame_recorder_buffer_size_ > 0) { | 1531 if (frame_recorder_buffer_size_ > 0) { |
1542 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( | 1532 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( |
1543 new VideoFrameRecorderHostExtension()); | 1533 new VideoFrameRecorderHostExtension()); |
1544 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); | 1534 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); |
1545 host_->AddExtension(std::move(frame_recorder_extension)); | 1535 host_->AddExtension(std::move(frame_recorder_extension)); |
1546 } | 1536 } |
1547 | 1537 |
1548 // TODO(simonmorris): Get the maximum session duration from a policy. | 1538 // TODO(simonmorris): Get the maximum session duration from a policy. |
1549 #if defined(OS_LINUX) | 1539 #if defined(OS_LINUX) |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1729 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
1740 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); | 1730 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); |
1741 | 1731 |
1742 // Run the main (also UI) message loop until the host no longer needs it. | 1732 // Run the main (also UI) message loop until the host no longer needs it. |
1743 message_loop.Run(); | 1733 message_loop.Run(); |
1744 | 1734 |
1745 return exit_code; | 1735 return exit_code; |
1746 } | 1736 } |
1747 | 1737 |
1748 } // namespace remoting | 1738 } // namespace remoting |
OLD | NEW |