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

Side by Side Diff: remoting/host/client_session.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
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/host/client_session_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/client_session.h" 5 #include "remoting/host/client_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "remoting/base/capabilities.h" 10 #include "remoting/base/capabilities.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 base::MessageLoopProxy::current())); 487 base::MessageLoopProxy::current()));
488 } 488 }
489 489
490 // TODO(sergeyu): Move this to SessionManager? 490 // TODO(sergeyu): Move this to SessionManager?
491 // static 491 // static
492 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( 492 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder(
493 const protocol::SessionConfig& config) { 493 const protocol::SessionConfig& config) {
494 const protocol::ChannelConfig& video_config = config.video_config(); 494 const protocol::ChannelConfig& video_config = config.video_config();
495 495
496 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { 496 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
497 return remoting::VideoEncoderVpx::CreateForVP8().PassAs<VideoEncoder>(); 497 return remoting::VideoEncoderVpx::CreateForVP8().Pass();
498 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { 498 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) {
499 return remoting::VideoEncoderVpx::CreateForVP9().PassAs<VideoEncoder>(); 499 return remoting::VideoEncoderVpx::CreateForVP9().Pass();
500 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { 500 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
501 return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVerbatim()); 501 return make_scoped_ptr(new remoting::VideoEncoderVerbatim());
rmsousa 2014/09/27 01:49:20 Isn't this returning a different scoped_ptr type (
Sergey Ulanov 2014/09/29 17:33:24 Yes, upcast is automatic now (that's why PassAs()
502 } 502 }
503 503
504 NOTREACHED(); 504 NOTREACHED();
505 return scoped_ptr<VideoEncoder>(); 505 return nullptr;
506 } 506 }
507 507
508 // static 508 // static
509 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( 509 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder(
510 const protocol::SessionConfig& config) { 510 const protocol::SessionConfig& config) {
511 const protocol::ChannelConfig& audio_config = config.audio_config(); 511 const protocol::ChannelConfig& audio_config = config.audio_config();
512 512
513 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { 513 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
514 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); 514 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim());
515 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { 515 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) {
516 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); 516 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus());
517 } 517 }
518 518
519 NOTREACHED(); 519 NOTREACHED();
520 return scoped_ptr<AudioEncoder>(); 520 return nullptr;
521 } 521 }
522 522
523 } // namespace remoting 523 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/host/client_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698