Commit a471d4bda963f533bda9922bc3e83c3c359068b8

Roman Lavrov 2022-06-15T14:33:22

Ensure ANGLERenderTest.mTestParams lifetime using unique_ptr Passing a reference is fragile, this currently works because factory outlives the test and so do captures: https://crsrc.org/c/third_party/angle/src/tests/perf_tests/TracePerfTest.cpp;drc=54e08a5af1f7ca50d5c154a09cc056166a9e49fa;l=2143 but if a temporary or a scoped object is passed to the constructor in the same spot then this blows up due to use after free, which is easy to run into accidentally as it is uncommon that f(const T&) would hold onto the reference and expect it to outlive the function call. In most cases ANGLERenderTest.mTestParams is initialized with GetParam() which comes from a base class and that Bug: angleproject:7410 Change-Id: I32ea8b79ad746129d4088d44fef2a37cc9c81b80 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697436 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>