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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 bool curtain_required_; | 270 bool curtain_required_; |
| 271 | 271 |
| 272 scoped_ptr<XmppSignalStrategy> signal_strategy_; | 272 scoped_ptr<XmppSignalStrategy> signal_strategy_; |
| 273 scoped_ptr<SignalingConnector> signaling_connector_; | 273 scoped_ptr<SignalingConnector> signaling_connector_; |
| 274 scoped_ptr<HeartbeatSender> heartbeat_sender_; | 274 scoped_ptr<HeartbeatSender> heartbeat_sender_; |
| 275 scoped_ptr<HostChangeNotificationListener> host_change_notification_listener_; | 275 scoped_ptr<HostChangeNotificationListener> host_change_notification_listener_; |
| 276 scoped_ptr<LogToServer> log_to_server_; | 276 scoped_ptr<LogToServer> log_to_server_; |
| 277 scoped_ptr<HostEventLogger> host_event_logger_; | 277 scoped_ptr<HostEventLogger> host_event_logger_; |
| 278 | 278 |
| 279 // Created on the UI thread and used on the network thread. | 279 // Created on the UI thread and used on the network thread. |
| 280 scoped_ptr<HostUserInterface> host_user_interface_; | 280 scoped_ptr<HostUserInterface> host_user_interface_; |
|
Sergey Ulanov
2013/04/04 00:10:03
I think you can remove it from here now. It doesn'
alexeypa (please no reviews)
2013/04/04 16:56:40
Done.
| |
| 281 | 281 |
| 282 scoped_refptr<ChromotingHost> host_; | 282 scoped_refptr<ChromotingHost> host_; |
| 283 | 283 |
| 284 // Used to keep this HostProcess alive until it is shutdown. | 284 // Used to keep this HostProcess alive until it is shutdown. |
| 285 scoped_refptr<HostProcess> self_; | 285 scoped_refptr<HostProcess> self_; |
| 286 | 286 |
| 287 #if defined(REMOTING_MULTI_PROCESS) | 287 #if defined(REMOTING_MULTI_PROCESS) |
| 288 DesktopSessionConnector* desktop_session_connector_; | 288 DesktopSessionConnector* desktop_session_connector_; |
| 289 #endif // defined(REMOTING_MULTI_PROCESS) | 289 #endif // defined(REMOTING_MULTI_PROCESS) |
| 290 | 290 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 // If an audio pipe is specific on the command-line then initialize | 544 // If an audio pipe is specific on the command-line then initialize |
| 545 // AudioCapturerLinux to capture from it. | 545 // AudioCapturerLinux to capture from it. |
| 546 base::FilePath audio_pipe_name = CommandLine::ForCurrentProcess()-> | 546 base::FilePath audio_pipe_name = CommandLine::ForCurrentProcess()-> |
| 547 GetSwitchValuePath(kAudioPipeSwitchName); | 547 GetSwitchValuePath(kAudioPipeSwitchName); |
| 548 if (!audio_pipe_name.empty()) { | 548 if (!audio_pipe_name.empty()) { |
| 549 remoting::AudioCapturerLinux::InitializePipeReader( | 549 remoting::AudioCapturerLinux::InitializePipeReader( |
| 550 context_->audio_task_runner(), audio_pipe_name); | 550 context_->audio_task_runner(), audio_pipe_name); |
| 551 } | 551 } |
| 552 #endif // defined(OS_LINUX) | 552 #endif // defined(OS_LINUX) |
| 553 | 553 |
| 554 // TODO(alexeypa): Localize the UI strings. See http://crbug.com/155204. | |
| 555 UiStrings ui_strings; | |
| 556 | |
| 554 // Create a desktop environment factory appropriate to the build type & | 557 // Create a desktop environment factory appropriate to the build type & |
| 555 // platform. | 558 // platform. |
| 556 #if defined(OS_WIN) | 559 #if defined(OS_WIN) |
| 557 | 560 |
| 558 #if defined(REMOTING_MULTI_PROCESS) | 561 #if defined(REMOTING_MULTI_PROCESS) |
| 559 IpcDesktopEnvironmentFactory* desktop_environment_factory = | 562 IpcDesktopEnvironmentFactory* desktop_environment_factory = |
| 560 new IpcDesktopEnvironmentFactory( | 563 new IpcDesktopEnvironmentFactory( |
| 561 context_->audio_task_runner(), | 564 context_->audio_task_runner(), |
| 562 context_->network_task_runner(), | 565 context_->network_task_runner(), |
| 563 context_->video_capture_task_runner(), | 566 context_->video_capture_task_runner(), |
| 564 context_->network_task_runner(), | 567 context_->network_task_runner(), |
| 565 daemon_channel_.get()); | 568 daemon_channel_.get()); |
| 566 desktop_session_connector_ = desktop_environment_factory; | 569 desktop_session_connector_ = desktop_environment_factory; |
| 567 #else // !defined(REMOTING_MULTI_PROCESS) | 570 #else // !defined(REMOTING_MULTI_PROCESS) |
| 568 DesktopEnvironmentFactory* desktop_environment_factory = | 571 DesktopEnvironmentFactory* desktop_environment_factory = |
| 569 new SessionDesktopEnvironmentFactory( | 572 new SessionDesktopEnvironmentFactory( |
| 570 context_->network_task_runner(), | 573 context_->network_task_runner(), |
| 571 context_->input_task_runner(), | 574 context_->input_task_runner(), |
| 572 context_->ui_task_runner(), | 575 context_->ui_task_runner(), |
| 576 ui_strings, | |
| 573 base::Bind(&HostProcess::SendSasToConsole, this)); | 577 base::Bind(&HostProcess::SendSasToConsole, this)); |
| 574 #endif // !defined(REMOTING_MULTI_PROCESS) | 578 #endif // !defined(REMOTING_MULTI_PROCESS) |
| 575 | 579 |
| 576 #else // !defined(OS_WIN) | 580 #else // !defined(OS_WIN) |
| 577 DesktopEnvironmentFactory* desktop_environment_factory = | 581 DesktopEnvironmentFactory* desktop_environment_factory = |
| 578 new Me2MeDesktopEnvironmentFactory( | 582 new Me2MeDesktopEnvironmentFactory( |
| 579 context_->network_task_runner(), | 583 context_->network_task_runner(), |
| 580 context_->input_task_runner(), | 584 context_->input_task_runner(), |
| 581 context_->ui_task_runner()); | 585 context_->ui_task_runner(), |
| 586 ui_strings); | |
| 582 #endif // !defined(OS_WIN) | 587 #endif // !defined(OS_WIN) |
| 583 | 588 |
| 584 desktop_environment_factory_.reset(desktop_environment_factory); | 589 desktop_environment_factory_.reset(desktop_environment_factory); |
| 585 | 590 |
| 586 // The host UI should be created on the UI thread. | 591 // The host UI should be created on the UI thread. |
| 587 bool want_user_interface = true; | 592 bool want_user_interface = true; |
| 588 #if defined(OS_LINUX) || defined(REMOTING_MULTI_PROCESS) | 593 #if defined(OS_LINUX) || defined(REMOTING_MULTI_PROCESS) |
| 589 want_user_interface = false; | 594 want_user_interface = false; |
| 590 #elif defined(OS_MACOSX) | 595 #elif defined(OS_MACOSX) |
| 591 // Don't try to display any UI on top of the system's login screen as this | 596 // Don't try to display any UI on top of the system's login screen as this |
| 592 // is rejected by the Window Server on OS X 10.7.4, and prevents the | 597 // is rejected by the Window Server on OS X 10.7.4, and prevents the |
| 593 // capturer from working (http://crbug.com/140984). | 598 // capturer from working (http://crbug.com/140984). |
| 594 | 599 |
| 595 // TODO(lambroslambrou): Use a better technique of detecting whether we're | 600 // TODO(lambroslambrou): Use a better technique of detecting whether we're |
| 596 // running in the LoginWindow context, and refactor this into a separate | 601 // running in the LoginWindow context, and refactor this into a separate |
| 597 // function to be used here and in CurtainMode::ActivateCurtain(). | 602 // function to be used here and in CurtainMode::ActivateCurtain(). |
| 598 want_user_interface = getuid() != 0; | 603 want_user_interface = getuid() != 0; |
| 599 #endif // OS_MACOSX | 604 #endif // OS_MACOSX |
| 600 | 605 |
| 601 if (want_user_interface) { | 606 if (want_user_interface) { |
| 602 UiStrings ui_strings; | |
| 603 host_user_interface_.reset( | 607 host_user_interface_.reset( |
| 604 new HostUserInterface(context_->network_task_runner(), | 608 new HostUserInterface(context_->network_task_runner(), |
| 605 context_->ui_task_runner(), ui_strings)); | 609 context_->ui_task_runner(), ui_strings)); |
| 606 host_user_interface_->Init(); | 610 host_user_interface_->Init(); |
| 607 } | 611 } |
| 608 | 612 |
| 609 context_->network_task_runner()->PostTask( | 613 context_->network_task_runner()->PostTask( |
| 610 FROM_HERE, | 614 FROM_HERE, |
| 611 base::Bind(&HostProcess::StartOnNetworkThread, this)); | 615 base::Bind(&HostProcess::StartOnNetworkThread, this)); |
| 612 } | 616 } |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1117 return exit_code; | 1121 return exit_code; |
| 1118 } | 1122 } |
| 1119 | 1123 |
| 1120 } // namespace remoting | 1124 } // namespace remoting |
| 1121 | 1125 |
| 1122 #if !defined(OS_WIN) | 1126 #if !defined(OS_WIN) |
| 1123 int main(int argc, char** argv) { | 1127 int main(int argc, char** argv) { |
| 1124 return remoting::HostMain(argc, argv); | 1128 return remoting::HostMain(argc, argv); |
| 1125 } | 1129 } |
| 1126 #endif // !defined(OS_WIN) | 1130 #endif // !defined(OS_WIN) |
| OLD | NEW |