When declaring a lambda with a value-capture default `[=, ...]`, the
this pointer is implicitly captured by value as well. This results
in potentially-unintuitive behavior and has been deprecated in C++20.
It produces a warning in newer versions of clang
(https://reviews.llvm.org/D142639).
Unfortunately, the preferred C++20 pattern `[=, this, ...]` is not compatible with previous C++ versions. To maintain compatibility with C++14, 17, and 20, this CL modifies all lambdas which capture `this` to explicitly capture all the necessary variables, with no capture-default.
Bug: chromium:351004963
Change-Id: I10c4a9669f340efba75a3e4016f0988a2d606d1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357322
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
Cr-Commit-Position: refs/heads/main@{#42886}