[clang-tidy] Apply performance-move-const-arg fixes (mutable lambdas).

This CL is a manual spin-off of [1], which tried to apply clang-tidy's
performance-move-const-arg [1] to the WebRTC codebase.

Since there were some wrong fixes to correct, this CL lands all the
manual fixes where std::move was actually fine but the lambda was not
mutable.

[1] - https://webrtc-review.googlesource.com/c/src/+/120350
[2] - https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html

Bug: webrtc:10252
Change-Id: I4602e3d4a63d2637dd389e775ffbf80fe95f40fc
Reviewed-on: https://webrtc-review.googlesource.com/c/120927
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26532}
This commit is contained in:
Mirko Bonadei
2019-02-04 15:01:43 +01:00
committed by Commit Bot
parent 817aec8eca
commit 80a8687082
4 changed files with 10 additions and 10 deletions

View File

@ -140,7 +140,7 @@ RTCError MediaTransportPair::LoopbackMediaTransport::SendVideoFrame(
MediaTransportEncodedVideoFrame frame_copy = frame;
frame_copy.Retain();
invoker_.AsyncInvoke<void>(
RTC_FROM_HERE, thread_, [this, channel_id, frame_copy] {
RTC_FROM_HERE, thread_, [this, channel_id, frame_copy]() mutable {
other_->OnData(channel_id, std::move(frame_copy));
});
return RTCError::OK();

View File

@ -1235,7 +1235,7 @@ void ChannelSend::SetFrameEncryptor(
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
rtc::CritScope cs(&encoder_queue_lock_);
if (encoder_queue_is_active_) {
encoder_queue_->PostTask([this, frame_encryptor]() {
encoder_queue_->PostTask([this, frame_encryptor]() mutable {
this->frame_encryptor_ = std::move(frame_encryptor);
});
} else {

View File

@ -39,7 +39,7 @@ VideoQualityAnalyzer::~VideoQualityAnalyzer() {
void VideoQualityAnalyzer::OnCapturedFrame(const VideoFrame& frame) {
VideoFrame copy = frame;
task_queue_.PostTask([this, copy] {
task_queue_.PostTask([this, copy]() mutable {
if (!first_capture_ntp_time_ms_)
first_capture_ntp_time_ms_ = copy.ntp_time_ms();
captured_frames_.push_back(std::move(copy));

View File

@ -513,8 +513,8 @@ void VideoSendStreamImpl::OnEncoderConfigurationChanged(
int min_transmit_bitrate_bps) {
if (!worker_queue_->IsCurrent()) {
rtc::WeakPtr<VideoSendStreamImpl> send_stream = weak_ptr_;
worker_queue_->PostTask(
[send_stream, streams, content_type, min_transmit_bitrate_bps]() {
worker_queue_->PostTask([send_stream, streams, content_type,
min_transmit_bitrate_bps]() mutable {
if (send_stream) {
send_stream->OnEncoderConfigurationChanged(
std::move(streams), content_type, min_transmit_bitrate_bps);