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

Unified Diff: remoting/host/audio_pump.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: include <utility> Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | remoting/host/audio_pump_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/audio_pump.cc
diff --git a/remoting/host/audio_pump.cc b/remoting/host/audio_pump.cc
index a6e22d4af73800c0d90269110efa03d370668e25..d6b799d331e1cb03cd7a570fdfda823b1ac9c294 100644
--- a/remoting/host/audio_pump.cc
+++ b/remoting/host/audio_pump.cc
@@ -4,6 +4,8 @@
#include "remoting/host/audio_pump.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
@@ -58,8 +60,8 @@ AudioPump::Core::Core(base::WeakPtr<AudioPump> pump,
scoped_ptr<AudioEncoder> audio_encoder)
: pump_(pump),
pump_task_runner_(base::ThreadTaskRunnerHandle::Get()),
- audio_capturer_(audio_capturer.Pass()),
- audio_encoder_(audio_encoder.Pass()),
+ audio_capturer_(std::move(audio_capturer)),
+ audio_encoder_(std::move(audio_encoder)),
enabled_(true),
bytes_pending_(0) {
thread_checker_.DetachFromThread();
@@ -99,7 +101,7 @@ void AudioPump::Core::EncodeAudioPacket(scoped_ptr<AudioPacket> packet) {
return;
scoped_ptr<AudioPacket> encoded_packet =
- audio_encoder_->Encode(packet.Pass());
+ audio_encoder_->Encode(std::move(packet));
// The audio encoder returns a null audio packet if there's no audio to send.
if (!encoded_packet)
@@ -123,8 +125,8 @@ AudioPump::AudioPump(
weak_factory_(this) {
DCHECK(audio_stub_);
- core_.reset(new Core(weak_factory_.GetWeakPtr(), audio_capturer.Pass(),
- audio_encoder.Pass()));
+ core_.reset(new Core(weak_factory_.GetWeakPtr(), std::move(audio_capturer),
+ std::move(audio_encoder)));
audio_task_runner_->PostTask(
FROM_HERE, base::Bind(&Core::Start, base::Unretained(core_.get())));
@@ -149,7 +151,7 @@ void AudioPump::SendAudioPacket(scoped_ptr<AudioPacket> packet, int size) {
DCHECK(packet);
audio_stub_->ProcessAudioPacket(
- packet.Pass(),
+ std::move(packet),
base::Bind(&AudioPump::OnPacketSent, weak_factory_.GetWeakPtr(), size));
}
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | remoting/host/audio_pump_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698