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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 config_(FilePath()), | 121 config_(FilePath()), |
| 122 #ifdef OFFICIAL_BUILD | 122 #ifdef OFFICIAL_BUILD |
| 123 oauth_use_official_client_id_(true), | 123 oauth_use_official_client_id_(true), |
| 124 #else | 124 #else |
| 125 oauth_use_official_client_id_(false), | 125 oauth_use_official_client_id_(false), |
| 126 #endif | 126 #endif |
| 127 allow_nat_traversal_(true), | 127 allow_nat_traversal_(true), |
| 128 restarting_(false), | 128 restarting_(false), |
| 129 shutting_down_(false), | 129 shutting_down_(false), |
| 130 #if defined(OS_WIN) | 130 #if defined(OS_WIN) |
| 131 desktop_environment_factory_(new SessionDesktopEnvironmentFactory()), | 131 desktop_environment_factory_(new SessionDesktopEnvironmentFactory()), |
|
alexeypa (please no reviews)
2012/10/01 18:31:34
SessionDesktopEnvironmentFactory is derived from D
Wez
2012/10/02 05:19:44
Done.
| |
| 132 #else // !defined(OS_WIN) | 132 #else // !defined(OS_WIN) |
| 133 desktop_environment_factory_(new DesktopEnvironmentFactory()), | 133 desktop_environment_factory_(new DesktopEnvironmentFactory( |
| 134 context_->input_task_runner(), context_->ui_task_runner())), | |
| 134 #endif // !defined(OS_WIN) | 135 #endif // !defined(OS_WIN) |
| 135 desktop_resizer_(DesktopResizer::Create()), | 136 desktop_resizer_(DesktopResizer::Create()), |
| 136 exit_code_(kSuccessExitCode) | 137 exit_code_(kSuccessExitCode) |
| 137 #if defined(OS_MACOSX) | 138 #if defined(OS_MACOSX) |
| 138 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, | 139 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, |
| 139 base::Unretained(this)), | 140 base::Unretained(this)), |
| 140 base::Bind(&HostProcess::OnDisconnectRequested, | 141 base::Bind(&HostProcess::OnDisconnectRequested, |
| 141 base::Unretained(this))) | 142 base::Unretained(this))) |
| 142 #endif | 143 #endif |
| 143 { | 144 { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 551 NetworkSettings network_settings( | 552 NetworkSettings network_settings( |
| 552 allow_nat_traversal_ ? | 553 allow_nat_traversal_ ? |
| 553 NetworkSettings::NAT_TRAVERSAL_ENABLED : | 554 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
| 554 NetworkSettings::NAT_TRAVERSAL_DISABLED); | 555 NetworkSettings::NAT_TRAVERSAL_DISABLED); |
| 555 if (!allow_nat_traversal_) { | 556 if (!allow_nat_traversal_) { |
| 556 network_settings.min_port = NetworkSettings::kDefaultMinPort; | 557 network_settings.min_port = NetworkSettings::kDefaultMinPort; |
| 557 network_settings.max_port = NetworkSettings::kDefaultMaxPort; | 558 network_settings.max_port = NetworkSettings::kDefaultMaxPort; |
| 558 } | 559 } |
| 559 | 560 |
| 560 host_ = new ChromotingHost( | 561 host_ = new ChromotingHost( |
| 561 context_.get(), signal_strategy_.get(), | 562 signal_strategy_.get(), |
| 562 desktop_environment_factory_.get(), | 563 desktop_environment_factory_.get(), |
| 563 CreateHostSessionManager(network_settings, | 564 CreateHostSessionManager(network_settings, |
| 564 context_->url_request_context_getter())); | 565 context_->url_request_context_getter()), |
| 566 context_->capture_task_runner(), | |
| 567 context_->encode_task_runner(), | |
| 568 context_->network_task_runner()); | |
| 565 | 569 |
| 566 // TODO(simonmorris): Get the maximum session duration from a policy. | 570 // TODO(simonmorris): Get the maximum session duration from a policy. |
| 567 #if defined(OS_LINUX) | 571 #if defined(OS_LINUX) |
| 568 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 572 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
| 569 #endif | 573 #endif |
| 570 | 574 |
| 571 heartbeat_sender_.reset(new HeartbeatSender( | 575 heartbeat_sender_.reset(new HeartbeatSender( |
| 572 this, host_id_, signal_strategy_.get(), &key_pair_)); | 576 this, host_id_, signal_strategy_.get(), &key_pair_)); |
| 573 | 577 |
| 574 log_to_server_.reset( | 578 log_to_server_.reset( |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 821 user32.GetFunctionPointer("SetProcessDPIAware")); | 825 user32.GetFunctionPointer("SetProcessDPIAware")); |
| 822 set_process_dpi_aware(); | 826 set_process_dpi_aware(); |
| 823 } | 827 } |
| 824 | 828 |
| 825 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 829 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 826 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 830 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 827 return main(0, NULL); | 831 return main(0, NULL); |
| 828 } | 832 } |
| 829 | 833 |
| 830 #endif // defined(OS_WIN) | 834 #endif // defined(OS_WIN) |
| OLD | NEW |