Replace _stricmp with absl::EqualsIgnoreCase
All uses check only for equality. Bug: webrtc:6424 Change-Id: I8755dde02370c89dbc2226bb703664c9e4f88bdb Reviewed-on: https://webrtc-review.googlesource.com/c/106383 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25274}
This commit is contained in:
parent
53347b7d66
commit
3c7d599750
4
BUILD.gn
4
BUILD.gn
@ -434,7 +434,11 @@ rtc_source_set("webrtc_common") {
|
|||||||
"api/video:video_bitrate_allocation",
|
"api/video:video_bitrate_allocation",
|
||||||
"rtc_base:checks",
|
"rtc_base:checks",
|
||||||
"rtc_base:deprecation",
|
"rtc_base:deprecation",
|
||||||
|
|
||||||
|
# TODO(nisse): Delete both of these together with STR_CASE_CMP and
|
||||||
|
# STR_NCASE_CMP.
|
||||||
"rtc_base:stringutils",
|
"rtc_base:stringutils",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!build_with_chromium && is_clang) {
|
if (!build_with_chromium && is_clang) {
|
||||||
|
|||||||
4
DEPS
4
DEPS
@ -1416,9 +1416,11 @@ include_rules = [
|
|||||||
"+test",
|
"+test",
|
||||||
"+rtc_tools",
|
"+rtc_tools",
|
||||||
|
|
||||||
# Abseil whitelist. Keep this in sync with abseil-in-webrtc-md.
|
# Abseil whitelist. Keep this in sync with abseil-in-webrtc.md.
|
||||||
"+absl/container/inlined_vector.h",
|
"+absl/container/inlined_vector.h",
|
||||||
"+absl/memory/memory.h",
|
"+absl/memory/memory.h",
|
||||||
|
"+absl/strings/ascii.h",
|
||||||
|
"+absl/strings/match.h",
|
||||||
"+absl/strings/string_view.h",
|
"+absl/strings/string_view.h",
|
||||||
"+absl/types/optional.h",
|
"+absl/types/optional.h",
|
||||||
"+absl/types/variant.h",
|
"+absl/types/variant.h",
|
||||||
|
|||||||
@ -15,6 +15,7 @@ adds the first use.
|
|||||||
* `absl::make_unique` and `absl::WrapUnique`
|
* `absl::make_unique` and `absl::WrapUnique`
|
||||||
* `absl::optional` and related stuff from `absl/types/optional.h`.
|
* `absl::optional` and related stuff from `absl/types/optional.h`.
|
||||||
* `absl::string_view`
|
* `absl::string_view`
|
||||||
|
* The functions in `absl/strings/ascii.h` and `absl/strings/match.h`
|
||||||
* `absl::variant` and related stuff from `absl/types/variant.h`.
|
* `absl::variant` and related stuff from `absl/types/variant.h`.
|
||||||
|
|
||||||
## **Disallowed**
|
## **Disallowed**
|
||||||
|
|||||||
@ -39,6 +39,7 @@ rtc_source_set("video_codecs_api") {
|
|||||||
"../video:encoded_image",
|
"../video:encoded_image",
|
||||||
"../video:video_bitrate_allocation",
|
"../video:video_bitrate_allocation",
|
||||||
"../video:video_frame",
|
"../video:video_frame",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,9 +16,9 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/strings/string_builder.h"
|
#include "rtc_base/strings/string_builder.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@ -118,8 +118,9 @@ static const char* kPayloadNameI420 = "I420";
|
|||||||
static const char* kPayloadNameGeneric = "Generic";
|
static const char* kPayloadNameGeneric = "Generic";
|
||||||
static const char* kPayloadNameMultiplex = "Multiplex";
|
static const char* kPayloadNameMultiplex = "Multiplex";
|
||||||
|
|
||||||
|
// TODO(nisse): Delete this wrapper.
|
||||||
static bool CodecNamesEq(const char* name1, const char* name2) {
|
static bool CodecNamesEq(const char* name1, const char* name2) {
|
||||||
return _stricmp(name1, name2) == 0;
|
return absl::EqualsIgnoreCase(name1, name2);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* CodecTypeToPayloadString(VideoCodecType type) {
|
const char* CodecTypeToPayloadString(VideoCodecType type) {
|
||||||
|
|||||||
@ -15,7 +15,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
// TODO(nisse): Delete include together with STR_CASE_CMP
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "api/array_view.h"
|
#include "api/array_view.h"
|
||||||
// TODO(sprang): Remove this include when all usage includes it directly.
|
// TODO(sprang): Remove this include when all usage includes it directly.
|
||||||
#include "api/video/video_bitrate_allocation.h"
|
#include "api/video/video_bitrate_allocation.h"
|
||||||
@ -30,13 +31,15 @@
|
|||||||
|
|
||||||
#define RTP_PAYLOAD_NAME_SIZE 32u
|
#define RTP_PAYLOAD_NAME_SIZE 32u
|
||||||
|
|
||||||
#if defined(WEBRTC_WIN) || defined(WIN32)
|
|
||||||
// Compares two strings without regard to case.
|
// Compares two strings without regard to case.
|
||||||
#define STR_CASE_CMP(s1, s2) ::_stricmp(s1, s2)
|
// TODO(nisse): Delete, implementation using EqualsIgnoreCase is misleading
|
||||||
|
// since this can't be used for sorting.
|
||||||
|
#define STR_CASE_CMP(s1, s2) (absl::EqualsIgnoreCase(s1, s2) ? 0 : 1)
|
||||||
|
|
||||||
|
#if defined(WEBRTC_WIN) || defined(WIN32)
|
||||||
// Compares characters of two strings without regard to case.
|
// Compares characters of two strings without regard to case.
|
||||||
#define STR_NCASE_CMP(s1, s2, n) ::_strnicmp(s1, s2, n)
|
#define STR_NCASE_CMP(s1, s2, n) ::_strnicmp(s1, s2, n)
|
||||||
#else
|
#else
|
||||||
#define STR_CASE_CMP(s1, s2) ::strcasecmp(s1, s2)
|
|
||||||
#define STR_NCASE_CMP(s1, s2, n) ::strncasecmp(s1, s2, n)
|
#define STR_NCASE_CMP(s1, s2, n) ::strncasecmp(s1, s2, n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -139,6 +139,7 @@ rtc_static_library("rtc_media_base") {
|
|||||||
"../rtc_base:rtc_base_approved",
|
"../rtc_base:rtc_base_approved",
|
||||||
"../rtc_base/system:rtc_export",
|
"../rtc_base/system:rtc_export",
|
||||||
"../rtc_base/third_party/sigslot",
|
"../rtc_base/third_party/sigslot",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -328,6 +329,7 @@ rtc_static_library("rtc_audio_video") {
|
|||||||
"../rtc_base:stringutils",
|
"../rtc_base:stringutils",
|
||||||
"../rtc_base/experiments:normalize_simulcast_size_experiment",
|
"../rtc_base/experiments:normalize_simulcast_size_experiment",
|
||||||
"../system_wrappers",
|
"../system_wrappers",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "media/base/h264_profile_level_id.h"
|
#include "media/base/h264_profile_level_id.h"
|
||||||
#include "media/base/vp9_profile.h"
|
#include "media/base/vp9_profile.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "rtc_base/stringencode.h"
|
#include "rtc_base/stringencode.h"
|
||||||
#include "rtc_base/strings/string_builder.h"
|
#include "rtc_base/strings/string_builder.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
|
|
||||||
@ -26,8 +26,8 @@ FeedbackParams::FeedbackParams() = default;
|
|||||||
FeedbackParams::~FeedbackParams() = default;
|
FeedbackParams::~FeedbackParams() = default;
|
||||||
|
|
||||||
bool FeedbackParam::operator==(const FeedbackParam& other) const {
|
bool FeedbackParam::operator==(const FeedbackParam& other) const {
|
||||||
return _stricmp(other.id().c_str(), id().c_str()) == 0 &&
|
return absl::EqualsIgnoreCase(other.id(), id()) &&
|
||||||
_stricmp(other.param().c_str(), param().c_str()) == 0;
|
absl::EqualsIgnoreCase(other.param(), param());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedbackParams::operator==(const FeedbackParams& other) const {
|
bool FeedbackParams::operator==(const FeedbackParams& other) const {
|
||||||
@ -97,7 +97,7 @@ bool Codec::Matches(const Codec& codec) const {
|
|||||||
const int kMaxStaticPayloadId = 95;
|
const int kMaxStaticPayloadId = 95;
|
||||||
return (id <= kMaxStaticPayloadId || codec.id <= kMaxStaticPayloadId)
|
return (id <= kMaxStaticPayloadId || codec.id <= kMaxStaticPayloadId)
|
||||||
? (id == codec.id)
|
? (id == codec.id)
|
||||||
: (_stricmp(name.c_str(), codec.name.c_str()) == 0);
|
: (absl::EqualsIgnoreCase(name, codec.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Codec::GetParam(const std::string& name, std::string* out) const {
|
bool Codec::GetParam(const std::string& name, std::string* out) const {
|
||||||
@ -235,7 +235,7 @@ VideoCodec& VideoCodec::operator=(const VideoCodec& c) = default;
|
|||||||
VideoCodec& VideoCodec::operator=(VideoCodec&& c) = default;
|
VideoCodec& VideoCodec::operator=(VideoCodec&& c) = default;
|
||||||
|
|
||||||
void VideoCodec::SetDefaultParameters() {
|
void VideoCodec::SetDefaultParameters() {
|
||||||
if (_stricmp(kH264CodecName, name.c_str()) == 0) {
|
if (absl::EqualsIgnoreCase(kH264CodecName, name)) {
|
||||||
// This default is set for all H.264 codecs created because
|
// This default is set for all H.264 codecs created because
|
||||||
// that was the default before packetization mode support was added.
|
// that was the default before packetization mode support was added.
|
||||||
// TODO(hta): Move this to the places that create VideoCodecs from
|
// TODO(hta): Move this to the places that create VideoCodecs from
|
||||||
@ -285,16 +285,16 @@ VideoCodec VideoCodec::CreateRtxCodec(int rtx_payload_type,
|
|||||||
|
|
||||||
VideoCodec::CodecType VideoCodec::GetCodecType() const {
|
VideoCodec::CodecType VideoCodec::GetCodecType() const {
|
||||||
const char* payload_name = name.c_str();
|
const char* payload_name = name.c_str();
|
||||||
if (_stricmp(payload_name, kRedCodecName) == 0) {
|
if (absl::EqualsIgnoreCase(payload_name, kRedCodecName)) {
|
||||||
return CODEC_RED;
|
return CODEC_RED;
|
||||||
}
|
}
|
||||||
if (_stricmp(payload_name, kUlpfecCodecName) == 0) {
|
if (absl::EqualsIgnoreCase(payload_name, kUlpfecCodecName)) {
|
||||||
return CODEC_ULPFEC;
|
return CODEC_ULPFEC;
|
||||||
}
|
}
|
||||||
if (_stricmp(payload_name, kFlexfecCodecName) == 0) {
|
if (absl::EqualsIgnoreCase(payload_name, kFlexfecCodecName)) {
|
||||||
return CODEC_FLEXFEC;
|
return CODEC_FLEXFEC;
|
||||||
}
|
}
|
||||||
if (_stricmp(payload_name, kRtxCodecName) == 0) {
|
if (absl::EqualsIgnoreCase(payload_name, kRtxCodecName)) {
|
||||||
return CODEC_RTX;
|
return CODEC_RTX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,12 +362,13 @@ bool HasTransportCc(const Codec& codec) {
|
|||||||
FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
|
FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(nisse): Delete these wrappers.
|
||||||
bool CodecNamesEq(const std::string& name1, const std::string& name2) {
|
bool CodecNamesEq(const std::string& name1, const std::string& name2) {
|
||||||
return CodecNamesEq(name1.c_str(), name2.c_str());
|
return CodecNamesEq(name1.c_str(), name2.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CodecNamesEq(const char* name1, const char* name2) {
|
bool CodecNamesEq(const char* name1, const char* name2) {
|
||||||
return _stricmp(name1, name2) == 0;
|
return absl::EqualsIgnoreCase(name1, name2);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VideoCodec* FindMatchingCodec(
|
const VideoCodec* FindMatchingCodec(
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
@ -128,7 +129,7 @@ bool FakeVoiceMediaChannel::CanInsertDtmf() {
|
|||||||
for (std::vector<AudioCodec>::const_iterator it = send_codecs_.begin();
|
for (std::vector<AudioCodec>::const_iterator it = send_codecs_.begin();
|
||||||
it != send_codecs_.end(); ++it) {
|
it != send_codecs_.end(); ++it) {
|
||||||
// Find the DTMF telephone event "codec".
|
// Find the DTMF telephone event "codec".
|
||||||
if (_stricmp(it->name.c_str(), "telephone-event") == 0) {
|
if (absl::EqualsIgnoreCase(it->name, "telephone-event")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "media/base/codec.h"
|
#include "media/base/codec.h"
|
||||||
#include "media/base/mediaconstants.h"
|
#include "media/base/mediaconstants.h"
|
||||||
#include "media/base/rtputils.h"
|
#include "media/base/rtputils.h"
|
||||||
@ -21,7 +22,6 @@
|
|||||||
#include "rtc_base/helpers.h"
|
#include "rtc_base/helpers.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "rtc_base/sanitizer.h"
|
#include "rtc_base/sanitizer.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ DataMediaChannel* RtpDataEngine::CreateChannel(const MediaConfig& config) {
|
|||||||
static const DataCodec* FindCodecByName(const std::vector<DataCodec>& codecs,
|
static const DataCodec* FindCodecByName(const std::vector<DataCodec>& codecs,
|
||||||
const std::string& name) {
|
const std::string& name) {
|
||||||
for (const DataCodec& codec : codecs) {
|
for (const DataCodec& codec : codecs) {
|
||||||
if (_stricmp(name.c_str(), codec.name.c_str()) == 0)
|
if (absl::EqualsIgnoreCase(name, codec.name))
|
||||||
return &codec;
|
return &codec;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "absl/strings/ascii.h"
|
||||||
#include "api/audio_codecs/audio_format.h"
|
#include "api/audio_codecs/audio_format.h"
|
||||||
#include "common_types.h" // NOLINT(build/include)
|
#include "common_types.h" // NOLINT(build/include)
|
||||||
#include "media/base/mediaconstants.h"
|
#include "media/base/mediaconstants.h"
|
||||||
@ -140,7 +141,8 @@ bool PayloadTypeMapper::SdpAudioFormatOrdering::operator()(
|
|||||||
const webrtc::SdpAudioFormat& b) const {
|
const webrtc::SdpAudioFormat& b) const {
|
||||||
if (a.clockrate_hz == b.clockrate_hz) {
|
if (a.clockrate_hz == b.clockrate_hz) {
|
||||||
if (a.num_channels == b.num_channels) {
|
if (a.num_channels == b.num_channels) {
|
||||||
int name_cmp = STR_CASE_CMP(a.name.c_str(), b.name.c_str());
|
int name_cmp =
|
||||||
|
absl::AsciiStrToLower(a.name).compare(absl::AsciiStrToLower(b.name));
|
||||||
if (name_cmp == 0)
|
if (name_cmp == 0)
|
||||||
return a.parameters < b.parameters;
|
return a.parameters < b.parameters;
|
||||||
return name_cmp < 0;
|
return name_cmp < 0;
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||||
#include "api/call/audio_sink.h"
|
#include "api/call/audio_sink.h"
|
||||||
#include "media/base/audiosource.h"
|
#include "media/base/audiosource.h"
|
||||||
@ -40,7 +41,6 @@
|
|||||||
#include "rtc_base/race_checker.h"
|
#include "rtc_base/race_checker.h"
|
||||||
#include "rtc_base/strings/audio_format_to_string.h"
|
#include "rtc_base/strings/audio_format_to_string.h"
|
||||||
#include "rtc_base/strings/string_builder.h"
|
#include "rtc_base/strings/string_builder.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
#include "rtc_base/third_party/base64/base64.h"
|
#include "rtc_base/third_party/base64/base64.h"
|
||||||
#include "rtc_base/trace_event.h"
|
#include "rtc_base/trace_event.h"
|
||||||
#include "system_wrappers/include/field_trial.h"
|
#include "system_wrappers/include/field_trial.h"
|
||||||
@ -109,7 +109,7 @@ std::string ToString(const AudioCodec& codec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsCodec(const AudioCodec& codec, const char* ref_name) {
|
bool IsCodec(const AudioCodec& codec, const char* ref_name) {
|
||||||
return (_stricmp(codec.name.c_str(), ref_name) == 0);
|
return absl::EqualsIgnoreCase(codec.name, ref_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FindCodec(const std::vector<AudioCodec>& codecs,
|
bool FindCodec(const std::vector<AudioCodec>& codecs,
|
||||||
|
|||||||
@ -101,6 +101,7 @@ rtc_static_library("rtc_p2p") {
|
|||||||
"../system_wrappers:field_trial",
|
"../system_wrappers:field_trial",
|
||||||
"../system_wrappers:metrics",
|
"../system_wrappers:metrics",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "p2p/base/portallocator.h"
|
#include "p2p/base/portallocator.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/crc32.h"
|
#include "rtc_base/crc32.h"
|
||||||
@ -27,7 +28,6 @@
|
|||||||
#include "rtc_base/network.h"
|
#include "rtc_base/network.h"
|
||||||
#include "rtc_base/numerics/safe_minmax.h"
|
#include "rtc_base/numerics/safe_minmax.h"
|
||||||
#include "rtc_base/stringencode.h"
|
#include "rtc_base/stringencode.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
#include "rtc_base/third_party/base64/base64.h"
|
#include "rtc_base/third_party/base64/base64.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -183,7 +183,7 @@ const char* ProtoToString(ProtocolType proto) {
|
|||||||
|
|
||||||
bool StringToProto(const char* value, ProtocolType* proto) {
|
bool StringToProto(const char* value, ProtocolType* proto) {
|
||||||
for (size_t i = 0; i <= PROTO_LAST; ++i) {
|
for (size_t i = 0; i <= PROTO_LAST; ++i) {
|
||||||
if (_stricmp(PROTO_NAMES[i], value) == 0) {
|
if (absl::EqualsIgnoreCase(PROTO_NAMES[i], value)) {
|
||||||
*proto = static_cast<ProtocolType>(i);
|
*proto = static_cast<ProtocolType>(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
#include "p2p/base/transportdescription.h"
|
#include "p2p/base/transportdescription.h"
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "p2p/base/p2pconstants.h"
|
#include "p2p/base/p2pconstants.h"
|
||||||
#include "rtc_base/arraysize.h"
|
#include "rtc_base/arraysize.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role) {
|
|||||||
CONNECTIONROLE_ACTPASS_STR, CONNECTIONROLE_HOLDCONN_STR};
|
CONNECTIONROLE_ACTPASS_STR, CONNECTIONROLE_HOLDCONN_STR};
|
||||||
|
|
||||||
for (size_t i = 0; i < arraysize(roles); ++i) {
|
for (size_t i = 0; i < arraysize(roles); ++i) {
|
||||||
if (_stricmp(roles[i], role_str.c_str()) == 0) {
|
if (absl::EqualsIgnoreCase(roles[i], role_str)) {
|
||||||
*role = static_cast<ConnectionRole>(CONNECTIONROLE_ACTIVE + i);
|
*role = static_cast<ConnectionRole>(CONNECTIONROLE_ACTIVE + i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,6 +87,7 @@ rtc_static_library("rtc_pc_base") {
|
|||||||
"../rtc_base/third_party/sigslot",
|
"../rtc_base/third_party/sigslot",
|
||||||
"../system_wrappers:metrics",
|
"../system_wrappers:metrics",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -14,10 +14,10 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "media/base/rtpdataengine.h"
|
#include "media/base/rtpdataengine.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "rtc_base/stringutils.h"
|
|
||||||
#include "rtc_base/trace_event.h"
|
#include "rtc_base/trace_event.h"
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
@ -95,7 +95,7 @@ void ChannelManager::GetSupportedVideoCodecs(
|
|||||||
std::vector<VideoCodec> video_codecs = media_engine_->video_codecs();
|
std::vector<VideoCodec> video_codecs = media_engine_->video_codecs();
|
||||||
for (const auto& video_codec : video_codecs) {
|
for (const auto& video_codec : video_codecs) {
|
||||||
if (!enable_rtx_ &&
|
if (!enable_rtx_ &&
|
||||||
_stricmp(kRtxCodecName, video_codec.name.c_str()) == 0) {
|
absl::EqualsIgnoreCase(kRtxCodecName, video_codec.name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
codecs->push_back(video_codec);
|
codecs->push_back(video_codec);
|
||||||
|
|||||||
@ -704,6 +704,7 @@ rtc_static_library("rtc_base") {
|
|||||||
"third_party/base64",
|
"third_party/base64",
|
||||||
"third_party/sigslot",
|
"third_party/sigslot",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
public_deps = [
|
public_deps = [
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#include <utility> // for pair
|
#include <utility> // for pair
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "absl/strings/match.h"
|
||||||
#include "rtc_base/arraysize.h"
|
#include "rtc_base/arraysize.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/cryptstring.h" // for CryptString
|
#include "rtc_base/cryptstring.h" // for CryptString
|
||||||
@ -265,7 +266,7 @@ HttpAuthResult HttpAuthenticate(const char* challenge,
|
|||||||
return HAR_IGNORE;
|
return HAR_IGNORE;
|
||||||
|
|
||||||
// BASIC
|
// BASIC
|
||||||
if (_stricmp(auth_method.c_str(), "basic") == 0) {
|
if (absl::EqualsIgnoreCase(auth_method, "basic")) {
|
||||||
if (context)
|
if (context)
|
||||||
return HAR_CREDENTIALS; // Bad credentials
|
return HAR_CREDENTIALS; // Bad credentials
|
||||||
if (username.empty())
|
if (username.empty())
|
||||||
@ -293,7 +294,7 @@ HttpAuthResult HttpAuthenticate(const char* challenge,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DIGEST
|
// DIGEST
|
||||||
if (_stricmp(auth_method.c_str(), "digest") == 0) {
|
if (absl::EqualsIgnoreCase(auth_method, "digest")) {
|
||||||
if (context)
|
if (context)
|
||||||
return HAR_CREDENTIALS; // Bad credentials
|
return HAR_CREDENTIALS; // Bad credentials
|
||||||
if (username.empty())
|
if (username.empty())
|
||||||
@ -360,8 +361,8 @@ HttpAuthResult HttpAuthenticate(const char* challenge,
|
|||||||
|
|
||||||
#if defined(WEBRTC_WIN)
|
#if defined(WEBRTC_WIN)
|
||||||
#if 1
|
#if 1
|
||||||
bool want_negotiate = (_stricmp(auth_method.c_str(), "negotiate") == 0);
|
bool want_negotiate = absl::EqualsIgnoreCase(auth_method, "negotiate");
|
||||||
bool want_ntlm = (_stricmp(auth_method.c_str(), "ntlm") == 0);
|
bool want_ntlm = absl::EqualsIgnoreCase(auth_method, "ntlm");
|
||||||
// SPNEGO & NTLM
|
// SPNEGO & NTLM
|
||||||
if (want_negotiate || want_ntlm) {
|
if (want_negotiate || want_ntlm) {
|
||||||
const size_t MAX_MESSAGE = 12000, MAX_SPN = 256;
|
const size_t MAX_MESSAGE = 12000, MAX_SPN = 256;
|
||||||
|
|||||||
@ -43,9 +43,6 @@
|
|||||||
|
|
||||||
#if defined(WEBRTC_POSIX)
|
#if defined(WEBRTC_POSIX)
|
||||||
|
|
||||||
inline int _stricmp(const char* s1, const char* s2) {
|
|
||||||
return strcasecmp(s1, s2);
|
|
||||||
}
|
|
||||||
inline int _strnicmp(const char* s1, const char* s2, size_t n) {
|
inline int _strnicmp(const char* s1, const char* s2, size_t n) {
|
||||||
return strncasecmp(s1, s2, n);
|
return strncasecmp(s1, s2, n);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user