Switch to compiling WebRTC -std=c++14 by default

This is a canary CL to check if using c++14 feature breaks any webrtc user.

Bug: webrtc:10945
Change-Id: Iabaf8c06414c1ac960791bcb7cc46f5f5a5e1f14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151600
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29119}
This commit is contained in:
Danil Chapovalov
2019-09-05 10:21:11 +02:00
committed by Commit Bot
parent a0e6ded9fc
commit 116ffe7e5b
2 changed files with 4 additions and 16 deletions

6
.gn
View File

@ -68,12 +68,6 @@ default_args = {
android32_ndk_api_level = 16
android64_ndk_api_level = 21
# WebRTC does not want to switch to C++14 yet.
use_cxx11 = true
# WebRTC relies on Chromium's Android test infrastructure.
use_cxx11_on_android = false
# WebRTC does not provide the gflags dependency. Because libyuv uses it only
# for unittests, it can be disabled (see third_party/libyuv/BUILD.gn)
libyuv_use_gflags = false

View File

@ -3900,17 +3900,11 @@ PeerConnection::GetFirstAudioTransceiver() const {
bool PeerConnection::StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) {
// TODO(eladalon): In C++14, this can be done with a lambda.
struct Functor {
bool operator()() {
return pc->StartRtcEventLog_w(std::move(output), output_period_ms);
}
PeerConnection* const pc;
std::unique_ptr<RtcEventLogOutput> output;
const int64_t output_period_ms;
};
return worker_thread()->Invoke<bool>(
RTC_FROM_HERE, Functor{this, std::move(output), output_period_ms});
RTC_FROM_HERE,
[this, output = std::move(output), output_period_ms]() mutable {
return StartRtcEventLog_w(std::move(output), output_period_ms);
});
}
bool PeerConnection::StartRtcEventLog(