Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: remoting/test/protocol_perftest.cc

Issue 609923004: Cleanup usage of scoped_ptr<> in remoting for C++11 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 FakePortAllocator::Create(fake_network_dispatcher_)); 230 FakePortAllocator::Create(fake_network_dispatcher_));
231 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, 231 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth,
232 GetParam().max_buffers); 232 GetParam().max_buffers);
233 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, 233 port_allocator->socket_factory()->SetLatency(GetParam().latency_average,
234 GetParam().latency_stddev); 234 GetParam().latency_stddev);
235 port_allocator->socket_factory()->set_out_of_order_rate( 235 port_allocator->socket_factory()->set_out_of_order_rate(
236 GetParam().out_of_order_rate); 236 GetParam().out_of_order_rate);
237 scoped_ptr<protocol::TransportFactory> host_transport_factory( 237 scoped_ptr<protocol::TransportFactory> host_transport_factory(
238 new protocol::LibjingleTransportFactory( 238 new protocol::LibjingleTransportFactory(
239 host_signaling_.get(), 239 host_signaling_.get(),
240 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), 240 port_allocator.Pass(),
241 network_settings)); 241 network_settings));
242 242
243 scoped_ptr<protocol::SessionManager> session_manager( 243 scoped_ptr<protocol::SessionManager> session_manager(
244 new protocol::JingleSessionManager(host_transport_factory.Pass())); 244 new protocol::JingleSessionManager(host_transport_factory.Pass()));
245 245
246 // Encoder runs on a separate thread, main thread is used for everything 246 // Encoder runs on a separate thread, main thread is used for everything
247 // else. 247 // else.
248 host_.reset(new ChromotingHost(host_signaling_.get(), 248 host_.reset(new ChromotingHost(host_signaling_.get(),
249 &desktop_environment_factory_, 249 &desktop_environment_factory_,
250 session_manager.Pass(), 250 session_manager.Pass(),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 FakePortAllocator::Create(fake_network_dispatcher_)); 301 FakePortAllocator::Create(fake_network_dispatcher_));
302 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth, 302 port_allocator->socket_factory()->SetBandwidth(GetParam().bandwidth,
303 GetParam().max_buffers); 303 GetParam().max_buffers);
304 port_allocator->socket_factory()->SetLatency(GetParam().latency_average, 304 port_allocator->socket_factory()->SetLatency(GetParam().latency_average,
305 GetParam().latency_stddev); 305 GetParam().latency_stddev);
306 port_allocator->socket_factory()->set_out_of_order_rate( 306 port_allocator->socket_factory()->set_out_of_order_rate(
307 GetParam().out_of_order_rate); 307 GetParam().out_of_order_rate);
308 scoped_ptr<protocol::TransportFactory> client_transport_factory( 308 scoped_ptr<protocol::TransportFactory> client_transport_factory(
309 new protocol::LibjingleTransportFactory( 309 new protocol::LibjingleTransportFactory(
310 client_signaling_.get(), 310 client_signaling_.get(),
311 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), 311 port_allocator.Pass(),
312 network_settings)); 312 network_settings));
313 313
314 std::vector<protocol::AuthenticationMethod> auth_methods; 314 std::vector<protocol::AuthenticationMethod> auth_methods;
315 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( 315 auth_methods.push_back(protocol::AuthenticationMethod::Spake2(
316 protocol::AuthenticationMethod::NONE)); 316 protocol::AuthenticationMethod::NONE));
317 scoped_ptr<protocol::Authenticator> client_authenticator( 317 scoped_ptr<protocol::Authenticator> client_authenticator(
318 new protocol::NegotiatingClientAuthenticator( 318 new protocol::NegotiatingClientAuthenticator(
319 std::string(), // client_pairing_id 319 std::string(), // client_pairing_id
320 std::string(), // client_pairing_secret 320 std::string(), // client_pairing_secret
321 std::string(), // authentication_tag 321 std::string(), // authentication_tag
322 base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)), 322 base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)),
323 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>(), 323 nullptr,
324 auth_methods)); 324 auth_methods));
325 client_.reset(new ChromotingClient( 325 client_.reset(
326 client_context_.get(), this, this, scoped_ptr<AudioPlayer>())); 326 new ChromotingClient(client_context_.get(), this, this, nullptr));
327 client_->SetProtocolConfigForTests(protocol_config_->Clone()); 327 client_->SetProtocolConfigForTests(protocol_config_->Clone());
328 client_->Start( 328 client_->Start(
329 client_signaling_.get(), client_authenticator.Pass(), 329 client_signaling_.get(), client_authenticator.Pass(),
330 client_transport_factory.Pass(), kHostJid, std::string()); 330 client_transport_factory.Pass(), kHostJid, std::string());
331 } 331 }
332 332
333 void FetchPin( 333 void FetchPin(
334 bool pairing_supported, 334 bool pairing_supported,
335 const protocol::SecretFetchedCallback& secret_fetched_callback) { 335 const protocol::SecretFetchedCallback& secret_fetched_callback) {
336 secret_fetched_callback.Run("123456"); 336 secret_fetched_callback.Run("123456");
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 << "ms Encode: " << last_video_packet_->encode_time_ms() 489 << "ms Encode: " << last_video_packet_->encode_time_ms()
490 << "ms Capture: " << last_video_packet_->capture_time_ms() 490 << "ms Capture: " << last_video_packet_->capture_time_ms()
491 << "ms"; 491 << "ms";
492 sum += latency; 492 sum += latency;
493 } 493 }
494 494
495 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); 495 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF();
496 } 496 }
497 497
498 } // namespace remoting 498 } // namespace remoting
OLDNEW
« remoting/host/client_session.cc ('K') | « remoting/signaling/iq_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698