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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 scoped_ptr<PairingRegistryDelegateWin> delegate( | 793 scoped_ptr<PairingRegistryDelegateWin> delegate( |
794 new PairingRegistryDelegateWin()); | 794 new PairingRegistryDelegateWin()); |
795 bool result = delegate->SetRootKeys( | 795 bool result = delegate->SetRootKeys( |
796 reinterpret_cast<HKEY>( | 796 reinterpret_cast<HKEY>( |
797 IPC::PlatformFileForTransitToPlatformFile(privileged_key)), | 797 IPC::PlatformFileForTransitToPlatformFile(privileged_key)), |
798 reinterpret_cast<HKEY>( | 798 reinterpret_cast<HKEY>( |
799 IPC::PlatformFileForTransitToPlatformFile(unprivileged_key))); | 799 IPC::PlatformFileForTransitToPlatformFile(unprivileged_key))); |
800 if (!result) | 800 if (!result) |
801 return; | 801 return; |
802 | 802 |
803 pairing_registry_delegate_ = delegate.PassAs<PairingRegistry::Delegate>(); | 803 pairing_registry_delegate_ = delegate.Pass(); |
804 #else // !defined(OS_WIN) | 804 #else // !defined(OS_WIN) |
805 NOTREACHED(); | 805 NOTREACHED(); |
806 #endif // !defined(OS_WIN) | 806 #endif // !defined(OS_WIN) |
807 } | 807 } |
808 | 808 |
809 // Applies the host config, returning true if successful. | 809 // Applies the host config, returning true if successful. |
810 bool HostProcess::ApplyConfig(scoped_ptr<JsonHostConfig> config) { | 810 bool HostProcess::ApplyConfig(scoped_ptr<JsonHostConfig> config) { |
811 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 811 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
812 | 812 |
813 if (!config->GetString(kHostIdConfigPath, &host_id_)) { | 813 if (!config->GetString(kHostIdConfigPath, &host_id_)) { |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 scoped_ptr<protocol::CandidateSessionConfig> config = | 1271 scoped_ptr<protocol::CandidateSessionConfig> config = |
1272 host_->protocol_config()->Clone(); | 1272 host_->protocol_config()->Clone(); |
1273 config->EnableVideoCodec(protocol::ChannelConfig::CODEC_VP9); | 1273 config->EnableVideoCodec(protocol::ChannelConfig::CODEC_VP9); |
1274 host_->set_protocol_config(config.Pass()); | 1274 host_->set_protocol_config(config.Pass()); |
1275 } | 1275 } |
1276 | 1276 |
1277 if (frame_recorder_buffer_size_ > 0) { | 1277 if (frame_recorder_buffer_size_ > 0) { |
1278 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( | 1278 scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( |
1279 new VideoFrameRecorderHostExtension()); | 1279 new VideoFrameRecorderHostExtension()); |
1280 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); | 1280 frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); |
1281 host_->AddExtension(frame_recorder_extension.PassAs<HostExtension>()); | 1281 host_->AddExtension(frame_recorder_extension.Pass()); |
1282 } | 1282 } |
1283 | 1283 |
1284 // TODO(simonmorris): Get the maximum session duration from a policy. | 1284 // TODO(simonmorris): Get the maximum session duration from a policy. |
1285 #if defined(OS_LINUX) | 1285 #if defined(OS_LINUX) |
1286 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 1286 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
1287 #endif | 1287 #endif |
1288 | 1288 |
1289 heartbeat_sender_.reset(new HeartbeatSender( | 1289 heartbeat_sender_.reset(new HeartbeatSender( |
1290 this, host_id_, signal_strategy_.get(), key_pair_, | 1290 this, host_id_, signal_strategy_.get(), key_pair_, |
1291 directory_bot_jid_)); | 1291 directory_bot_jid_)); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 int exit_code = kSuccessExitCode; | 1448 int exit_code = kSuccessExitCode; |
1449 new HostProcess(context.Pass(), &exit_code); | 1449 new HostProcess(context.Pass(), &exit_code); |
1450 | 1450 |
1451 // Run the main (also UI) message loop until the host no longer needs it. | 1451 // Run the main (also UI) message loop until the host no longer needs it. |
1452 message_loop.Run(); | 1452 message_loop.Run(); |
1453 | 1453 |
1454 return exit_code; | 1454 return exit_code; |
1455 } | 1455 } |
1456 | 1456 |
1457 } // namespace remoting | 1457 } // namespace remoting |
OLD | NEW |