OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/base64.h" | 5 #include "base/base64.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 scoped_ptr<FakePortAllocator> port_allocator( | 228 scoped_ptr<FakePortAllocator> port_allocator( |
229 FakePortAllocator::Create(fake_network_dispatcher_)); | 229 FakePortAllocator::Create(fake_network_dispatcher_)); |
230 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, | 230 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, |
231 GetParam().max_buffers); | 231 GetParam().max_buffers); |
232 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, | 232 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, |
233 GetParam().latency_stddev); | 233 GetParam().latency_stddev); |
234 port_allocator->socket_factory()->set_out_of_order_rate( | 234 port_allocator->socket_factory()->set_out_of_order_rate( |
235 GetParam().out_of_order_rate); | 235 GetParam().out_of_order_rate); |
236 scoped_ptr<protocol::TransportFactory> host_transport_factory( | 236 scoped_ptr<protocol::TransportFactory> host_transport_factory( |
237 new protocol::LibjingleTransportFactory( | 237 new protocol::LibjingleTransportFactory( |
238 host_signaling_.get(), port_allocator.Pass(), network_settings, | 238 host_signaling_.get(), |
239 protocol::TransportRole::SERVER)); | 239 port_allocator.Pass(), |
| 240 network_settings)); |
240 | 241 |
241 scoped_ptr<protocol::SessionManager> session_manager( | 242 scoped_ptr<protocol::SessionManager> session_manager( |
242 new protocol::JingleSessionManager(host_transport_factory.Pass())); | 243 new protocol::JingleSessionManager(host_transport_factory.Pass())); |
243 | 244 |
244 // Encoder runs on a separate thread, main thread is used for everything | 245 // Encoder runs on a separate thread, main thread is used for everything |
245 // else. | 246 // else. |
246 host_.reset(new ChromotingHost(host_signaling_.get(), | 247 host_.reset(new ChromotingHost(host_signaling_.get(), |
247 &desktop_environment_factory_, | 248 &desktop_environment_factory_, |
248 session_manager.Pass(), | 249 session_manager.Pass(), |
249 host_thread_.message_loop_proxy(), | 250 host_thread_.message_loop_proxy(), |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 scoped_ptr<FakePortAllocator> port_allocator( | 299 scoped_ptr<FakePortAllocator> port_allocator( |
299 FakePortAllocator::Create(fake_network_dispatcher_)); | 300 FakePortAllocator::Create(fake_network_dispatcher_)); |
300 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, | 301 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, |
301 GetParam().max_buffers); | 302 GetParam().max_buffers); |
302 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, | 303 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, |
303 GetParam().latency_stddev); | 304 GetParam().latency_stddev); |
304 port_allocator->socket_factory()->set_out_of_order_rate( | 305 port_allocator->socket_factory()->set_out_of_order_rate( |
305 GetParam().out_of_order_rate); | 306 GetParam().out_of_order_rate); |
306 scoped_ptr<protocol::TransportFactory> client_transport_factory( | 307 scoped_ptr<protocol::TransportFactory> client_transport_factory( |
307 new protocol::LibjingleTransportFactory( | 308 new protocol::LibjingleTransportFactory( |
308 client_signaling_.get(), port_allocator.Pass(), network_settings, | 309 client_signaling_.get(), |
309 protocol::TransportRole::CLIENT)); | 310 port_allocator.Pass(), |
| 311 network_settings)); |
310 | 312 |
311 std::vector<protocol::AuthenticationMethod> auth_methods; | 313 std::vector<protocol::AuthenticationMethod> auth_methods; |
312 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( | 314 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( |
313 protocol::AuthenticationMethod::NONE)); | 315 protocol::AuthenticationMethod::NONE)); |
314 scoped_ptr<protocol::Authenticator> client_authenticator( | 316 scoped_ptr<protocol::Authenticator> client_authenticator( |
315 new protocol::NegotiatingClientAuthenticator( | 317 new protocol::NegotiatingClientAuthenticator( |
316 std::string(), // client_pairing_id | 318 std::string(), // client_pairing_id |
317 std::string(), // client_pairing_secret | 319 std::string(), // client_pairing_secret |
318 std::string(), // authentication_tag | 320 std::string(), // authentication_tag |
319 base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)), | 321 base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)), |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 << "ms Encode: " << last_video_packet_->encode_time_ms() | 489 << "ms Encode: " << last_video_packet_->encode_time_ms() |
488 << "ms Capture: " << last_video_packet_->capture_time_ms() | 490 << "ms Capture: " << last_video_packet_->capture_time_ms() |
489 << "ms"; | 491 << "ms"; |
490 sum += latency; | 492 sum += latency; |
491 } | 493 } |
492 | 494 |
493 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); | 495 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); |
494 } | 496 } |
495 | 497 |
496 } // namespace remoting | 498 } // namespace remoting |
OLD | NEW |