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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 GetSwitchValuePath(kAuthSocknameSwitchName); | 890 GetSwitchValuePath(kAuthSocknameSwitchName); |
891 if (!gnubby_socket_name.empty()) | 891 if (!gnubby_socket_name.empty()) |
892 remoting::GnubbyAuthHandler::SetGnubbySocketName(gnubby_socket_name); | 892 remoting::GnubbyAuthHandler::SetGnubbySocketName(gnubby_socket_name); |
893 #endif // defined(OS_LINUX) | 893 #endif // defined(OS_LINUX) |
894 | 894 |
895 // Create a desktop environment factory appropriate to the build type & | 895 // Create a desktop environment factory appropriate to the build type & |
896 // platform. | 896 // platform. |
897 #if defined(REMOTING_MULTI_PROCESS) | 897 #if defined(REMOTING_MULTI_PROCESS) |
898 IpcDesktopEnvironmentFactory* desktop_environment_factory = | 898 IpcDesktopEnvironmentFactory* desktop_environment_factory = |
899 new IpcDesktopEnvironmentFactory( | 899 new IpcDesktopEnvironmentFactory( |
900 context_->audio_task_runner(), | 900 context_->audio_task_runner(), context_->network_task_runner(), |
901 context_->network_task_runner(), | 901 context_->network_task_runner(), daemon_channel_.get()); |
902 context_->video_capture_task_runner(), | |
903 context_->network_task_runner(), | |
904 daemon_channel_.get()); | |
905 desktop_session_connector_ = desktop_environment_factory; | 902 desktop_session_connector_ = desktop_environment_factory; |
906 #else // !defined(REMOTING_MULTI_PROCESS) | 903 #else // !defined(REMOTING_MULTI_PROCESS) |
907 BasicDesktopEnvironmentFactory* desktop_environment_factory; | 904 BasicDesktopEnvironmentFactory* desktop_environment_factory; |
908 if (enable_window_capture_) { | 905 if (enable_window_capture_) { |
909 desktop_environment_factory = | 906 desktop_environment_factory = new SingleWindowDesktopEnvironmentFactory( |
910 new SingleWindowDesktopEnvironmentFactory( | 907 context_->network_task_runner(), context_->video_capture_task_runner(), |
911 context_->network_task_runner(), | 908 context_->input_task_runner(), context_->ui_task_runner(), window_id_); |
912 context_->input_task_runner(), | |
913 context_->ui_task_runner(), | |
914 window_id_); | |
915 } else { | 909 } else { |
916 desktop_environment_factory = | 910 desktop_environment_factory = new Me2MeDesktopEnvironmentFactory( |
917 new Me2MeDesktopEnvironmentFactory( | 911 context_->network_task_runner(), context_->video_capture_task_runner(), |
918 context_->network_task_runner(), | 912 context_->input_task_runner(), context_->ui_task_runner()); |
919 context_->input_task_runner(), | |
920 context_->ui_task_runner()); | |
921 } | 913 } |
922 #endif // !defined(REMOTING_MULTI_PROCESS) | 914 #endif // !defined(REMOTING_MULTI_PROCESS) |
923 desktop_environment_factory->set_supports_touch_events( | 915 desktop_environment_factory->set_supports_touch_events( |
924 InputInjector::SupportsTouchEvents()); | 916 InputInjector::SupportsTouchEvents()); |
925 | 917 |
926 desktop_environment_factory_.reset(desktop_environment_factory); | 918 desktop_environment_factory_.reset(desktop_environment_factory); |
927 desktop_environment_factory_->SetEnableGnubbyAuth(enable_gnubby_auth_); | 919 desktop_environment_factory_->SetEnableGnubbyAuth(enable_gnubby_auth_); |
928 | 920 |
929 context_->network_task_runner()->PostTask( | 921 context_->network_task_runner()->PostTask( |
930 FROM_HERE, | 922 FROM_HERE, |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 if (!desktop_environment_factory_->SupportsAudioCapture()) | 1528 if (!desktop_environment_factory_->SupportsAudioCapture()) |
1537 protocol_config->DisableAudioChannel(); | 1529 protocol_config->DisableAudioChannel(); |
1538 if (enable_vp9_) | 1530 if (enable_vp9_) |
1539 protocol_config->set_vp9_experiment_enabled(true); | 1531 protocol_config->set_vp9_experiment_enabled(true); |
1540 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1532 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1541 kEnableWebrtcSwitchName)) { | 1533 kEnableWebrtcSwitchName)) { |
1542 protocol_config->set_webrtc_supported(true); | 1534 protocol_config->set_webrtc_supported(true); |
1543 } | 1535 } |
1544 session_manager->set_protocol_config(std::move(protocol_config)); | 1536 session_manager->set_protocol_config(std::move(protocol_config)); |
1545 | 1537 |
1546 host_.reset(new ChromotingHost( | 1538 host_.reset(new ChromotingHost(desktop_environment_factory_.get(), |
1547 desktop_environment_factory_.get(), std::move(session_manager), | 1539 std::move(session_manager), transport_context, |
1548 transport_context, context_->audio_task_runner(), | 1540 context_->audio_task_runner(), |
1549 context_->input_task_runner(), context_->video_capture_task_runner(), | 1541 context_->video_encode_task_runner())); |
1550 context_->video_encode_task_runner(), context_->network_task_runner(), | |
1551 context_->ui_task_runner())); | |
1552 | 1542 |
1553 if (frame_recorder_buffer_size_ > 0) { | 1543 if (frame_recorder_buffer_size_ > 0) { |
1554 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( | 1544 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( |
1555 new VideoFrameRecorderHostExtension()); | 1545 new VideoFrameRecorderHostExtension()); |
1556 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); | 1546 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); |
1557 host_->AddExtension(std::move(frame_recorder_extension)); | 1547 host_->AddExtension(std::move(frame_recorder_extension)); |
1558 } | 1548 } |
1559 | 1549 |
1560 // TODO(simonmorris): Get the maximum session duration from a policy. | 1550 // TODO(simonmorris): Get the maximum session duration from a policy. |
1561 #if defined(OS_LINUX) | 1551 #if defined(OS_LINUX) |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1741 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
1752 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); | 1742 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); |
1753 | 1743 |
1754 // Run the main (also UI) message loop until the host no longer needs it. | 1744 // Run the main (also UI) message loop until the host no longer needs it. |
1755 message_loop.Run(); | 1745 message_loop.Run(); |
1756 | 1746 |
1757 return exit_code; | 1747 return exit_code; |
1758 } | 1748 } |
1759 | 1749 |
1760 } // namespace remoting | 1750 } // namespace remoting |
OLD | NEW |