Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
This commit is contained in:
committed by
Commit Bot
parent
809198edff
commit
317a1f09ed
@ -50,7 +50,6 @@ rtc_static_library("goog_cc") {
|
||||
"../../../system_wrappers",
|
||||
"../../bitrate_controller",
|
||||
"../../remote_bitrate_estimator",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
@ -98,7 +97,6 @@ rtc_source_set("alr_detector") {
|
||||
"../../../rtc_base/experiments:alr_experiment",
|
||||
"../../../rtc_base/experiments:field_trial_parser",
|
||||
"../../pacing:interval_budget",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
@ -134,7 +132,6 @@ rtc_source_set("estimators") {
|
||||
"../../../rtc_base:safe_minmax",
|
||||
"../../../rtc_base/experiments:field_trial_parser",
|
||||
"../../remote_bitrate_estimator",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
@ -160,7 +157,6 @@ rtc_source_set("delay_based_bwe") {
|
||||
"../../../system_wrappers:metrics",
|
||||
"../../pacing",
|
||||
"../../remote_bitrate_estimator",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
@ -187,7 +183,6 @@ rtc_source_set("probe_controller") {
|
||||
"../../../rtc_base/experiments:field_trial_parser",
|
||||
"../../../rtc_base/system:unused",
|
||||
"../../../system_wrappers:metrics",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
@ -254,7 +249,6 @@ if (rtc_include_tests) {
|
||||
"../../../test/scenario",
|
||||
"../../pacing",
|
||||
"//testing/gmock",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@ -13,9 +13,9 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
|
||||
@ -25,7 +25,7 @@ AcknowledgedBitrateEstimator::AcknowledgedBitrateEstimator(
|
||||
const WebRtcKeyValueConfig* key_value_config)
|
||||
: AcknowledgedBitrateEstimator(
|
||||
key_value_config,
|
||||
absl::make_unique<BitrateEstimator>(key_value_config)) {}
|
||||
std::make_unique<BitrateEstimator>(key_value_config)) {}
|
||||
|
||||
AcknowledgedBitrateEstimator::~AcknowledgedBitrateEstimator() {}
|
||||
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
|
||||
#include "modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#include "rtc_base/fake_clock.h"
|
||||
#include "test/gmock.h"
|
||||
@ -50,10 +50,10 @@ struct AcknowledgedBitrateEstimatorTestStates {
|
||||
AcknowledgedBitrateEstimatorTestStates CreateTestStates() {
|
||||
AcknowledgedBitrateEstimatorTestStates states;
|
||||
auto mock_bitrate_estimator =
|
||||
absl::make_unique<MockBitrateEstimator>(&states.field_trial_config);
|
||||
std::make_unique<MockBitrateEstimator>(&states.field_trial_config);
|
||||
states.mock_bitrate_estimator = mock_bitrate_estimator.get();
|
||||
states.acknowledged_bitrate_estimator =
|
||||
absl::make_unique<AcknowledgedBitrateEstimator>(
|
||||
std::make_unique<AcknowledgedBitrateEstimator>(
|
||||
&states.field_trial_config, std::move(mock_bitrate_estimator));
|
||||
return states;
|
||||
}
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_alr_state.h"
|
||||
@ -93,7 +93,7 @@ void AlrDetector::OnBytesSent(size_t bytes_sent, int64_t send_time_ms) {
|
||||
}
|
||||
if (event_log_ && state_changed) {
|
||||
event_log_->Log(
|
||||
absl::make_unique<RtcEventAlrState>(alr_started_time_ms_.has_value()));
|
||||
std::make_unique<RtcEventAlrState>(alr_started_time_ms_.has_value()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h"
|
||||
@ -224,7 +224,7 @@ DelayBasedBwe::Result DelayBasedBwe::MaybeUpdateEstimate(
|
||||
BWE_TEST_LOGGING_PLOT(1, "target_bitrate_bps", at_time.ms(), bitrate.bps());
|
||||
|
||||
if (event_log_) {
|
||||
event_log_->Log(absl::make_unique<RtcEventBweUpdateDelayBased>(
|
||||
event_log_->Log(std::make_unique<RtcEventBweUpdateDelayBased>(
|
||||
bitrate.bps(), detector_state));
|
||||
}
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "modules/congestion_controller/goog_cc/delay_based_bwe.h"
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
@ -149,8 +149,7 @@ DelayBasedBweTest::DelayBasedBweTest()
|
||||
: field_trial(),
|
||||
clock_(100000000),
|
||||
acknowledged_bitrate_estimator_(
|
||||
absl::make_unique<AcknowledgedBitrateEstimator>(
|
||||
&field_trial_config_)),
|
||||
std::make_unique<AcknowledgedBitrateEstimator>(&field_trial_config_)),
|
||||
probe_bitrate_estimator_(new ProbeBitrateEstimator(nullptr)),
|
||||
bitrate_estimator_(
|
||||
new DelayBasedBwe(&field_trial_config_, nullptr, nullptr)),
|
||||
@ -161,11 +160,10 @@ DelayBasedBweTest::DelayBasedBweTest()
|
||||
|
||||
DelayBasedBweTest::DelayBasedBweTest(const std::string& field_trial_string)
|
||||
: field_trial(
|
||||
absl::make_unique<test::ScopedFieldTrials>(field_trial_string)),
|
||||
std::make_unique<test::ScopedFieldTrials>(field_trial_string)),
|
||||
clock_(100000000),
|
||||
acknowledged_bitrate_estimator_(
|
||||
absl::make_unique<AcknowledgedBitrateEstimator>(
|
||||
&field_trial_config_)),
|
||||
std::make_unique<AcknowledgedBitrateEstimator>(&field_trial_config_)),
|
||||
probe_bitrate_estimator_(new ProbeBitrateEstimator(nullptr)),
|
||||
bitrate_estimator_(
|
||||
new DelayBasedBwe(&field_trial_config_, nullptr, nullptr)),
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h"
|
||||
#include "modules/congestion_controller/goog_cc/alr_detector.h"
|
||||
@ -80,13 +79,13 @@ GoogCcNetworkController::GoogCcNetworkController(NetworkControllerConfig config,
|
||||
new ProbeController(key_value_config_, config.event_log)),
|
||||
congestion_window_pushback_controller_(
|
||||
rate_control_settings_.UseCongestionWindowPushback()
|
||||
? absl::make_unique<CongestionWindowPushbackController>(
|
||||
? std::make_unique<CongestionWindowPushbackController>(
|
||||
key_value_config_)
|
||||
: nullptr),
|
||||
bandwidth_estimation_(
|
||||
absl::make_unique<SendSideBandwidthEstimation>(event_log_)),
|
||||
std::make_unique<SendSideBandwidthEstimation>(event_log_)),
|
||||
alr_detector_(
|
||||
absl::make_unique<AlrDetector>(key_value_config_, config.event_log)),
|
||||
std::make_unique<AlrDetector>(key_value_config_, config.event_log)),
|
||||
probe_bitrate_estimator_(new ProbeBitrateEstimator(config.event_log)),
|
||||
network_estimator_(std::move(goog_cc_config.network_state_estimator)),
|
||||
network_state_predictor_(
|
||||
@ -95,7 +94,7 @@ GoogCcNetworkController::GoogCcNetworkController(NetworkControllerConfig config,
|
||||
event_log_,
|
||||
network_state_predictor_.get())),
|
||||
acknowledged_bitrate_estimator_(
|
||||
absl::make_unique<AcknowledgedBitrateEstimator>(key_value_config_)),
|
||||
std::make_unique<AcknowledgedBitrateEstimator>(key_value_config_)),
|
||||
initial_config_(config),
|
||||
last_raw_target_rate_(*config.constraints.starting_rate),
|
||||
last_pushback_target_rate_(last_raw_target_rate_),
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#include "modules/congestion_controller/goog_cc/probe_bitrate_estimator.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_failure.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_success.h"
|
||||
@ -112,7 +112,7 @@ absl::optional<DataRate> ProbeBitrateEstimator::HandleProbeAndEstimateBitrate(
|
||||
<< " [receive interval: " << ToString(receive_interval)
|
||||
<< "]";
|
||||
if (event_log_) {
|
||||
event_log_->Log(absl::make_unique<RtcEventProbeResultFailure>(
|
||||
event_log_->Log(std::make_unique<RtcEventProbeResultFailure>(
|
||||
cluster_id, ProbeFailureReason::kInvalidSendReceiveInterval));
|
||||
}
|
||||
return absl::nullopt;
|
||||
@ -145,7 +145,7 @@ absl::optional<DataRate> ProbeBitrateEstimator::HandleProbeAndEstimateBitrate(
|
||||
<< ToString(send_rate) << " = " << ratio
|
||||
<< " > kMaxValidRatio (" << kMaxValidRatio << ")]";
|
||||
if (event_log_) {
|
||||
event_log_->Log(absl::make_unique<RtcEventProbeResultFailure>(
|
||||
event_log_->Log(std::make_unique<RtcEventProbeResultFailure>(
|
||||
cluster_id, ProbeFailureReason::kInvalidSendReceiveRatio));
|
||||
}
|
||||
return absl::nullopt;
|
||||
@ -169,7 +169,7 @@ absl::optional<DataRate> ProbeBitrateEstimator::HandleProbeAndEstimateBitrate(
|
||||
}
|
||||
if (event_log_) {
|
||||
event_log_->Log(
|
||||
absl::make_unique<RtcEventProbeResultSuccess>(cluster_id, res.bps()));
|
||||
std::make_unique<RtcEventProbeResultSuccess>(cluster_id, res.bps()));
|
||||
}
|
||||
last_estimate_ = res;
|
||||
estimated_data_rate_ = res;
|
||||
|
||||
@ -12,9 +12,9 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "api/units/timestamp.h"
|
||||
@ -82,7 +82,7 @@ void MaybeLogProbeClusterCreated(RtcEventLog* event_log,
|
||||
|
||||
size_t min_bytes = static_cast<int32_t>(probe.target_data_rate.bps() *
|
||||
probe.target_duration.ms() / 8000);
|
||||
event_log->Log(absl::make_unique<RtcEventProbeClusterCreated>(
|
||||
event_log->Log(std::make_unique<RtcEventProbeClusterCreated>(
|
||||
probe.id, probe.target_data_rate.bps(), probe.target_probe_count,
|
||||
min_bytes));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user