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

Side by Side Diff: remoting/client/jni/chromoting_jni_instance.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/client/jni/chromoting_jni_instance.h" 5 #include "remoting/client/jni/chromoting_jni_instance.h"
6 6
7 #include <android/log.h> 7 #include <android/log.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 jni_runtime_->network_task_runner().get())); 393 jni_runtime_->network_task_runner().get()));
394 client_context_->Start(); 394 client_context_->Start();
395 395
396 SoftwareVideoRenderer* renderer = 396 SoftwareVideoRenderer* renderer =
397 new SoftwareVideoRenderer(client_context_->main_task_runner(), 397 new SoftwareVideoRenderer(client_context_->main_task_runner(),
398 client_context_->decode_task_runner(), 398 client_context_->decode_task_runner(),
399 frame_consumer_); 399 frame_consumer_);
400 view_->set_frame_producer(renderer); 400 view_->set_frame_producer(renderer);
401 video_renderer_.reset(renderer); 401 video_renderer_.reset(renderer);
402 402
403 client_.reset(new ChromotingClient(client_context_.get(), 403 client_.reset(new ChromotingClient(
404 this, 404 client_context_.get(), this, video_renderer_.get(), nullptr));
405 video_renderer_.get(),
406 scoped_ptr<AudioPlayer>()));
407 405
408 signaling_.reset(new XmppSignalStrategy( 406 signaling_.reset(new XmppSignalStrategy(
409 net::ClientSocketFactory::GetDefaultFactory(), 407 net::ClientSocketFactory::GetDefaultFactory(),
410 jni_runtime_->url_requester(), xmpp_config_)); 408 jni_runtime_->url_requester(), xmpp_config_));
411 409
412 client_status_logger_.reset( 410 client_status_logger_.reset(
413 new ClientStatusLogger(ServerLogEntry::ME2ME, 411 new ClientStatusLogger(ServerLogEntry::ME2ME,
414 signaling_.get(), 412 signaling_.get(),
415 ServiceUrls::GetInstance()->directory_bot_jid())); 413 ServiceUrls::GetInstance()->directory_bot_jid()));
416 414
417 protocol::NetworkSettings network_settings( 415 protocol::NetworkSettings network_settings(
418 protocol::NetworkSettings::NAT_TRAVERSAL_FULL); 416 protocol::NetworkSettings::NAT_TRAVERSAL_FULL);
419 417
420 // Use Chrome's network stack to allocate ports for peer-to-peer channels. 418 // Use Chrome's network stack to allocate ports for peer-to-peer channels.
421 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( 419 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator(
422 protocol::ChromiumPortAllocator::Create(jni_runtime_->url_requester(), 420 protocol::ChromiumPortAllocator::Create(jni_runtime_->url_requester(),
423 network_settings)); 421 network_settings));
424 422
425 scoped_ptr<protocol::TransportFactory> transport_factory( 423 scoped_ptr<protocol::TransportFactory> transport_factory(
426 new protocol::LibjingleTransportFactory( 424 new protocol::LibjingleTransportFactory(
427 signaling_.get(), 425 signaling_.get(), port_allocator.Pass(), network_settings));
428 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(),
429 network_settings));
430 426
431 client_->Start(signaling_.get(), authenticator_.Pass(), 427 client_->Start(signaling_.get(), authenticator_.Pass(),
432 transport_factory.Pass(), host_jid_, capabilities_); 428 transport_factory.Pass(), host_jid_, capabilities_);
433 } 429 }
434 430
435 void ChromotingJniInstance::DisconnectFromHostOnNetworkThread() { 431 void ChromotingJniInstance::DisconnectFromHostOnNetworkThread() {
436 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread()); 432 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
437 433
438 host_id_.clear(); 434 host_id_.clear();
439 435
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 stats->round_trip_ms()->Average()); 518 stats->round_trip_ms()->Average());
523 519
524 client_status_logger_->LogStatistics(stats); 520 client_status_logger_->LogStatistics(stats);
525 521
526 jni_runtime_->network_task_runner()->PostDelayedTask( 522 jni_runtime_->network_task_runner()->PostDelayedTask(
527 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), 523 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this),
528 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); 524 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
529 } 525 }
530 526
531 } // namespace remoting 527 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/client/plugin/chromoting_instance.cc » ('j') | remoting/host/client_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698