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}
diff --git a/.gn b/.gn index 3ff65c1..09f1b65 100644 --- a/.gn +++ b/.gn
@@ -68,12 +68,6 @@ 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
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 47825dc..0b943b51 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc
@@ -3900,17 +3900,11 @@ 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(