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 #include "remoting/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "remoting/protocol/input_stub.h" | 24 #include "remoting/protocol/input_stub.h" |
25 #include "remoting/protocol/session_config.h" | 25 #include "remoting/protocol/session_config.h" |
26 | 26 |
27 using remoting::protocol::ConnectionToClient; | 27 using remoting::protocol::ConnectionToClient; |
28 using remoting::protocol::InputStub; | 28 using remoting::protocol::InputStub; |
29 | 29 |
30 namespace remoting { | 30 namespace remoting { |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 const char kEnableVp9SwitchName[] = "enable-vp9"; | |
35 | |
36 const net::BackoffEntry::Policy kDefaultBackoffPolicy = { | 34 const net::BackoffEntry::Policy kDefaultBackoffPolicy = { |
37 // Number of initial errors (in sequence) to ignore before applying | 35 // Number of initial errors (in sequence) to ignore before applying |
38 // exponential back-off rules. | 36 // exponential back-off rules. |
39 0, | 37 0, |
40 | 38 |
41 // Initial delay for exponential back-off in ms. | 39 // Initial delay for exponential back-off in ms. |
42 2000, | 40 2000, |
43 | 41 |
44 // Factor by which the waiting time will be multiplied. | 42 // Factor by which the waiting time will be multiplied. |
45 2, | 43 2, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 login_backoff_(&kDefaultBackoffPolicy), | 83 login_backoff_(&kDefaultBackoffPolicy), |
86 authenticating_client_(false), | 84 authenticating_client_(false), |
87 reject_authenticating_client_(false), | 85 reject_authenticating_client_(false), |
88 enable_curtaining_(false), | 86 enable_curtaining_(false), |
89 weak_factory_(this) { | 87 weak_factory_(this) { |
90 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 88 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
91 DCHECK(signal_strategy); | 89 DCHECK(signal_strategy); |
92 | 90 |
93 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 91 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
94 | 92 |
95 // Enable VP9 if specified on the command-line. | |
96 if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableVp9SwitchName)) { | |
97 protocol_config_->EnableVideoCodec(protocol::ChannelConfig::CODEC_VP9); | |
98 } | |
99 | |
100 if (!desktop_environment_factory_->SupportsAudioCapture()) { | 93 if (!desktop_environment_factory_->SupportsAudioCapture()) { |
101 protocol_config_->DisableAudioChannel(); | 94 protocol_config_->DisableAudioChannel(); |
102 } | 95 } |
103 } | 96 } |
104 | 97 |
105 ChromotingHost::~ChromotingHost() { | 98 ChromotingHost::~ChromotingHost() { |
106 DCHECK(CalledOnValidThread()); | 99 DCHECK(CalledOnValidThread()); |
107 | 100 |
108 // Disconnect all of the clients. | 101 // Disconnect all of the clients. |
109 while (!clients_.empty()) { | 102 while (!clients_.empty()) { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 DCHECK(CalledOnValidThread()); | 352 DCHECK(CalledOnValidThread()); |
360 | 353 |
361 while (!clients_.empty()) { | 354 while (!clients_.empty()) { |
362 size_t size = clients_.size(); | 355 size_t size = clients_.size(); |
363 clients_.front()->DisconnectSession(); | 356 clients_.front()->DisconnectSession(); |
364 CHECK_EQ(clients_.size(), size - 1); | 357 CHECK_EQ(clients_.size(), size - 1); |
365 } | 358 } |
366 } | 359 } |
367 | 360 |
368 } // namespace remoting | 361 } // namespace remoting |
OLD | NEW |