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

Side by Side Diff: remoting/host/audio_capturer_linux.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 4 years, 12 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 | « no previous file | remoting/host/audio_capturer_win.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/audio_capturer_linux.h" 5 #include "remoting/host/audio_capturer_linux.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility>
8 9
9 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
10 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "remoting/proto/audio.pb.h" 13 #include "remoting/proto/audio.pb.h"
13 14
14 namespace remoting { 15 namespace remoting {
15 16
16 namespace { 17 namespace {
17 18
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 data->data().size() / sizeof(int16_t))) { 60 data->data().size() / sizeof(int16_t))) {
60 return; 61 return;
61 } 62 }
62 63
63 scoped_ptr<AudioPacket> packet(new AudioPacket()); 64 scoped_ptr<AudioPacket> packet(new AudioPacket());
64 packet->add_data(data->data()); 65 packet->add_data(data->data());
65 packet->set_encoding(AudioPacket::ENCODING_RAW); 66 packet->set_encoding(AudioPacket::ENCODING_RAW);
66 packet->set_sampling_rate(AudioPipeReader::kSamplingRate); 67 packet->set_sampling_rate(AudioPipeReader::kSamplingRate);
67 packet->set_bytes_per_sample(AudioPipeReader::kBytesPerSample); 68 packet->set_bytes_per_sample(AudioPipeReader::kBytesPerSample);
68 packet->set_channels(AudioPipeReader::kChannels); 69 packet->set_channels(AudioPipeReader::kChannels);
69 callback_.Run(packet.Pass()); 70 callback_.Run(std::move(packet));
70 } 71 }
71 72
72 bool AudioCapturer::IsSupported() { 73 bool AudioCapturer::IsSupported() {
73 return g_pulseaudio_pipe_sink_reader.Get().get() != nullptr; 74 return g_pulseaudio_pipe_sink_reader.Get().get() != nullptr;
74 } 75 }
75 76
76 scoped_ptr<AudioCapturer> AudioCapturer::Create() { 77 scoped_ptr<AudioCapturer> AudioCapturer::Create() {
77 scoped_refptr<AudioPipeReader> reader = 78 scoped_refptr<AudioPipeReader> reader =
78 g_pulseaudio_pipe_sink_reader.Get(); 79 g_pulseaudio_pipe_sink_reader.Get();
79 if (!reader.get()) 80 if (!reader.get())
80 return nullptr; 81 return nullptr;
81 return make_scoped_ptr(new AudioCapturerLinux(reader)); 82 return make_scoped_ptr(new AudioCapturerLinux(reader));
82 } 83 }
83 84
84 } // namespace remoting 85 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698