stats: replace new with std::make_unique

apart from the certificate stats which need to update the
reference to the previous certificate stats in the chain.

BUG=None

Change-Id: I27f58084b849fd9afe236e5b57139bedb8eb1811
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274175
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38026}
This commit is contained in:
Philipp Hancke
2022-09-06 11:55:31 +02:00
committed by WebRTC LUCI CQ
parent 839439ae84
commit b5cf12d9e8
3 changed files with 26 additions and 22 deletions

View File

@ -158,7 +158,7 @@ class RTC_EXPORT RTCStats {
const char this_class::kType[] = type_str; \
\
std::unique_ptr<webrtc::RTCStats> this_class::copy() const { \
return std::unique_ptr<webrtc::RTCStats>(new this_class(*this)); \
return std::make_unique<this_class>(*this); \
} \
\
const char* this_class::type() const { return this_class::kType; } \
@ -189,7 +189,7 @@ class RTC_EXPORT RTCStats {
const char this_class::kType[] = type_str; \
\
std::unique_ptr<webrtc::RTCStats> this_class::copy() const { \
return std::unique_ptr<webrtc::RTCStats>(new this_class(*this)); \
return std::make_unique<this_class>(*this); \
} \
\
const char* this_class::type() const { return this_class::kType; } \