Allow use of functions in absl/algorithms
Bug: None Change-Id: Id8311e6374228675cd34e413411611c77ed2d36d Reviewed-on: https://webrtc-review.googlesource.com/c/119963 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26427}
This commit is contained in:
parent
48c5493393
commit
e76ca61238
2
DEPS
2
DEPS
@ -1428,6 +1428,8 @@ include_rules = [
|
||||
"+rtc_tools",
|
||||
|
||||
# Abseil whitelist. Keep this in sync with abseil-in-webrtc.md.
|
||||
"+absl/algorithm/algorithm.h",
|
||||
"+absl/algorithm/container.h",
|
||||
"+absl/base/attributes.h",
|
||||
"+absl/container/inlined_vector.h",
|
||||
"+absl/memory/memory.h",
|
||||
|
||||
@ -20,6 +20,8 @@ adds the first use.
|
||||
`absl::is_trivially_copy_assignable`, and
|
||||
`absl::is_trivially_destructible` from `absl/meta/type_traits.h`.
|
||||
* `absl::variant` and related stuff from `absl/types/variant.h`.
|
||||
* The functions in `absl/algorithm/algorithm.h` and
|
||||
`absl/algorithm/container.h`
|
||||
|
||||
## **Disallowed**
|
||||
|
||||
|
||||
@ -102,6 +102,7 @@ rtc_static_library("rtc_p2p") {
|
||||
"../rtc_base/third_party/sigslot",
|
||||
"../system_wrappers:field_trial",
|
||||
"../system_wrappers:metrics",
|
||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
|
||||
@ -10,11 +10,11 @@
|
||||
|
||||
#include "p2p/base/p2p_transport_channel.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "api/candidate.h"
|
||||
#include "logging/rtc_event_log/ice_logger.h"
|
||||
#include "p2p/base/candidate_pair_interface.h"
|
||||
@ -1460,9 +1460,9 @@ void P2PTransportChannel::MaybeStartPinging() {
|
||||
}
|
||||
|
||||
int64_t now = rtc::TimeMillis();
|
||||
if (std::any_of(
|
||||
connections_.begin(), connections_.end(),
|
||||
[this, now](const Connection* c) { return IsPingable(c, now); })) {
|
||||
if (absl::c_any_of(connections_, [this, now](const Connection* c) {
|
||||
return IsPingable(c, now);
|
||||
})) {
|
||||
RTC_LOG(LS_INFO) << ToString()
|
||||
<< ": Have a pingable connection for the first time; "
|
||||
"starting to ping.";
|
||||
@ -1996,8 +1996,8 @@ void P2PTransportChannel::CheckAndPing() {
|
||||
// When the selected connection is not receiving or not writable, or any
|
||||
// active connection has not been pinged enough times, use the weak ping
|
||||
// interval.
|
||||
bool need_more_pings_at_weak_interval = std::any_of(
|
||||
connections_.begin(), connections_.end(), [](Connection* conn) {
|
||||
bool need_more_pings_at_weak_interval =
|
||||
absl::c_any_of(connections_, [](Connection* conn) {
|
||||
return conn->active() &&
|
||||
conn->num_pings_sent() < MIN_PINGS_AT_WEAK_PING_INTERVAL;
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user