Remove redundant webrtc:: prefixes in rtc_base

Created by
tools_webrtc/remove_extra_namespace.py --namespace webrtc

and manual adjustments.

This CL was uploaded by git cl split.

R=eshr@webrtc.org

No-IWYU: Refactoring
Bug: webrtc:42232595
Change-Id: I4dffbcd86aa0993d735ca3bbcfe9f66a42ceff3c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396203
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44901}
This commit is contained in:
Harald Alvestrand 2025-06-11 10:06:33 +00:00 committed by WebRTC LUCI CQ
parent 84731ed471
commit f59fa1a615
46 changed files with 396 additions and 434 deletions

View File

@ -30,7 +30,7 @@ namespace {
#ifdef __native_client__
int ResolveHostname(absl::string_view hostname,
int family,
std::vector<webrtc::IPAddress>* addresses) {
std::vector<IPAddress>* addresses) {
RTC_DCHECK_NOTREACHED();
RTC_LOG(LS_WARNING) << "ResolveHostname() is not implemented for NaCl";
return -1;

View File

@ -21,7 +21,7 @@
namespace webrtc {
// This file contains a default implementation of
// webrtc::AsyncDnsResolverInterface, for use when there is no need for special
// AsyncDnsResolverInterface, for use when there is no need for special
// treatment.
class AsyncDnsResolverResultImpl : public AsyncDnsResolverResult {
@ -32,7 +32,7 @@ class AsyncDnsResolverResultImpl : public AsyncDnsResolverResult {
private:
friend class AsyncDnsResolver;
RTC_NO_UNIQUE_ADDRESS webrtc::SequenceChecker sequence_checker_;
RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_checker_;
SocketAddress addr_ RTC_GUARDED_BY(sequence_checker_);
std::vector<IPAddress> addresses_ RTC_GUARDED_BY(sequence_checker_);
int error_ RTC_GUARDED_BY(sequence_checker_);

View File

@ -61,10 +61,10 @@ struct RTC_EXPORT AsyncSocketPacketOptions {
// https://www.rfc-editor.org/rfc/rfc9331.html
bool ecn_1 = false;
// When used with RTP packets (for example, webrtc::PacketOptions), the value
// When used with RTP packets (for example, PacketOptions), the value
// should be 16 bits. A value of -1 represents "not set".
int64_t packet_id = -1;
webrtc::PacketTimeUpdateParams packet_time_params;
PacketTimeUpdateParams packet_time_params;
// PacketInfo is passed to SentPacket when signaling this packet is sent.
PacketInfo info_signaled_after_sent;
// True if this is a batchable packet. Batchable packets are collected at low
@ -127,12 +127,11 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> {
// Register a callback to be called when the socket is closed.
void SubscribeCloseEvent(
const void* removal_tag,
std::function<void(webrtc::AsyncPacketSocket*, int)> callback);
std::function<void(AsyncPacketSocket*, int)> callback);
void UnsubscribeCloseEvent(const void* removal_tag);
void RegisterReceivedPacketCallback(
absl::AnyInvocable<void(webrtc::AsyncPacketSocket*,
const webrtc::ReceivedIpPacket&)>
absl::AnyInvocable<void(AsyncPacketSocket*, const ReceivedIpPacket&)>
received_packet_callback);
void DeregisterReceivedPacketCallback();
@ -173,8 +172,7 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> {
private:
CallbackList<AsyncPacketSocket*, int> on_close_
RTC_GUARDED_BY(&network_checker_);
absl::AnyInvocable<void(webrtc::AsyncPacketSocket*,
const webrtc::ReceivedIpPacket&)>
absl::AnyInvocable<void(AsyncPacketSocket*, const ReceivedIpPacket&)>
received_packet_callback_ RTC_GUARDED_BY(&network_checker_);
};

View File

@ -21,7 +21,7 @@ namespace webrtc {
class AsyncTCPSocketTest : public ::testing::Test, public sigslot::has_slots<> {
public:
AsyncTCPSocketTest()
: vss_(new webrtc::VirtualSocketServer()),
: vss_(new VirtualSocketServer()),
socket_(vss_->CreateSocket(SOCK_STREAM)),
tcp_socket_(new AsyncTCPSocket(socket_, true)),
ready_to_send_(false) {
@ -29,9 +29,7 @@ class AsyncTCPSocketTest : public ::testing::Test, public sigslot::has_slots<> {
&AsyncTCPSocketTest::OnReadyToSend);
}
void OnReadyToSend(webrtc::AsyncPacketSocket* socket) {
ready_to_send_ = true;
}
void OnReadyToSend(AsyncPacketSocket* socket) { ready_to_send_ = true; }
protected:
std::unique_ptr<VirtualSocketServer> vss_;

View File

@ -25,7 +25,7 @@ namespace webrtc {
// Byte order is assumed big-endian/network.
class BitBufferWriter {
public:
static constexpr DataSize kMaxLeb128Length = webrtc::DataSize::Bytes(10);
static constexpr DataSize kMaxLeb128Length = DataSize::Bytes(10);
// Constructs a bit buffer for the writable buffer of `bytes`.
BitBufferWriter(uint8_t* bytes, size_t byte_count);

View File

@ -61,21 +61,21 @@ class ByteBufferWriterT {
WriteBytesInternal(reinterpret_cast<const value_type*>(&val), 1);
}
void WriteUInt16(uint16_t val) {
uint16_t v = webrtc::HostToNetwork16(val);
uint16_t v = HostToNetwork16(val);
WriteBytesInternal(reinterpret_cast<const value_type*>(&v), 2);
}
void WriteUInt24(uint32_t val) {
uint32_t v = webrtc::HostToNetwork32(val);
uint32_t v = HostToNetwork32(val);
value_type* start = reinterpret_cast<value_type*>(&v);
++start;
WriteBytesInternal(start, 3);
}
void WriteUInt32(uint32_t val) {
uint32_t v = webrtc::HostToNetwork32(val);
uint32_t v = HostToNetwork32(val);
WriteBytesInternal(reinterpret_cast<const value_type*>(&v), 4);
}
void WriteUInt64(uint64_t val) {
uint64_t v = webrtc::HostToNetwork64(val);
uint64_t v = HostToNetwork64(val);
WriteBytesInternal(reinterpret_cast<const value_type*>(&v), 8);
}
// Serializes an unsigned varint in the format described by

View File

@ -307,7 +307,7 @@ class RTC_EXPORT CopyOnWriteBuffer {
}
}
// buffer_ is either null, or points to an webrtc::Buffer with capacity > 0.
// buffer_ is either null, or points to an Buffer with capacity > 0.
scoped_refptr<RefCountedBuffer> buffer_;
// This buffer may represent a slice of a original data.
size_t offset_; // Offset of a current slice in the original data in buffer_.

View File

@ -42,7 +42,7 @@
namespace webrtc {
// NOTE: This class is deprecated. Please use webrtc::Mutex instead!
// NOTE: This class is deprecated. Please use Mutex instead!
// Search using https://www.google.com/?q=recursive+lock+considered+harmful
// to find the reasons.
//

View File

@ -55,10 +55,9 @@ void Event::Reset() {
bool Event::Wait(TimeDelta give_up_after, TimeDelta /*warn_after*/) {
ScopedYieldPolicy::YieldExecution();
const DWORD ms =
give_up_after.IsPlusInfinity()
? INFINITE
: give_up_after.RoundUpTo(webrtc::TimeDelta::Millis(1)).ms();
const DWORD ms = give_up_after.IsPlusInfinity()
? INFINITE
: give_up_after.RoundUpTo(TimeDelta::Millis(1)).ms();
return (WaitForSingleObject(event_handle_, ms) == WAIT_OBJECT_0);
}
@ -123,7 +122,7 @@ timespec GetTimespec(TimeDelta duration_from_now) {
timeval tv;
gettimeofday(&tv, nullptr);
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * webrtc::kNumNanosecsPerMicrosec;
ts.tv_nsec = tv.tv_usec * kNumNanosecsPerMicrosec;
#endif
// Add the specified number of milliseconds to it.

View File

@ -27,8 +27,8 @@ namespace webrtc {
// RTC_DISALLOW_WAIT() utility
//
// Sets a stack-scoped flag that disallows use of `webrtc::Event::Wait` by means
// of raising a DCHECK when a call to `webrtc::Event::Wait()` is made..
// Sets a stack-scoped flag that disallows use of `Event::Wait` by means
// of raising a DCHECK when a call to `Event::Wait()` is made..
// This is useful to guard synchronization-free scopes against regressions.
//
// Example of what this would catch (`ScopeToProtect` calls `Foo`):
@ -99,7 +99,7 @@ class Event {
};
// These classes are provided for compatibility with Chromium.
// The webrtc::Event implementation is overriden inside of Chromium for the
// The Event implementation is overriden inside of Chromium for the
// purposes of detecting when threads are blocked that shouldn't be as well as
// to use the more accurate event implementation that's there than is provided
// by default on some platforms (e.g. Windows).
@ -128,7 +128,7 @@ class ScopedDisallowWait {
public:
void YieldExecution() override { RTC_DCHECK_NOTREACHED(); }
} handler_;
webrtc::ScopedYieldPolicy policy{&handler_};
ScopedYieldPolicy policy{&handler_};
};
#endif

View File

@ -102,7 +102,7 @@ TEST(EventTest, DISABLED_PerformanceMultiThread) {
}
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
// Tests that we crash if we attempt to call webrtc::Event::Wait while we're
// Tests that we crash if we attempt to call Event::Wait while we're
// not allowed to (as per `RTC_DISALLOW_WAIT()`).
TEST(EventTestDeathTest, DisallowEventWait) {
Event event;

View File

@ -24,7 +24,7 @@ namespace webrtc {
// Fake clock for use with unit tests, which does not tick on its own.
// Starts at time 0.
//
// TODO(deadbeef): Unify with webrtc::SimulatedClock.
// TODO(deadbeef): Unify with SimulatedClock.
class FakeClock : public ClockInterface {
public:
FakeClock() = default;

View File

@ -109,7 +109,7 @@ class FakeNetworkManager : public NetworkManagerBase {
using NetworkManagerBase::set_default_local_addresses;
using NetworkManagerBase::set_enumeration_permission;
// webrtc::NetworkManager override.
// NetworkManager override.
MdnsResponderInterface* GetMdnsResponder() const override {
return mdns_responder_.get();
}
@ -131,8 +131,7 @@ class FakeNetworkManager : public NetworkManagerBase {
} else if (it->socket_address.ipaddr().family() == AF_INET6) {
prefix_length = kFakeIPv6NetworkPrefixLength;
}
IPAddress prefix =
webrtc::TruncateIP(it->socket_address.ipaddr(), prefix_length);
IPAddress prefix = TruncateIP(it->socket_address.ipaddr(), prefix_length);
auto net = std::make_unique<Network>(
it->socket_address.hostname(), it->socket_address.hostname(), prefix,
prefix_length, it->adapter_type);

View File

@ -24,7 +24,7 @@ namespace webrtc {
std::unique_ptr<SocketServer> CreateDefaultSocketServer() {
#if defined(__native_client__)
return std::unique_ptr<SocketServer>(new webrtc::NullSocketServer);
return std::unique_ptr<SocketServer>(new NullSocketServer);
#else
return std::unique_ptr<SocketServer>(new PhysicalSocketServer);
#endif

View File

@ -79,7 +79,7 @@ class RTC_EXPORT IPAddress {
explicit IPAddress(uint32_t ip_in_host_byte_order) : family_(AF_INET) {
memset(&u_, 0, sizeof(u_));
u_.ip4.s_addr = webrtc::HostToNetwork32(ip_in_host_byte_order);
u_.ip4.s_addr = HostToNetwork32(ip_in_host_byte_order);
}
IPAddress(const IPAddress& other) : family_(other.family_) {

View File

@ -24,7 +24,7 @@ namespace webrtc {
class MdnsResponderInterface {
public:
using NameCreatedCallback =
std::function<void(const webrtc::IPAddress&, absl::string_view)>;
std::function<void(const IPAddress&, absl::string_view)>;
using NameRemovedCallback = std::function<void(bool)>;
MdnsResponderInterface() = default;

View File

@ -84,11 +84,10 @@ class FifoBuffer final : public StreamInterface {
private:
void PostEvent(int events, int err) {
RTC_DCHECK_RUN_ON(owner_);
owner_->PostTask(
webrtc::SafeTask(task_safety_.flag(), [this, events, err]() {
RTC_DCHECK_RUN_ON(&callback_sequence_);
FireEvent(events, err);
}));
owner_->PostTask(SafeTask(task_safety_.flag(), [this, events, err]() {
RTC_DCHECK_RUN_ON(&callback_sequence_);
FireEvent(events, err);
}));
}
// Helper method that implements Read. Caller must acquire a lock

View File

@ -201,15 +201,14 @@ bool ShouldAdapterChangeTriggerNetworkChange(AdapterType old_type,
}
#if defined(WEBRTC_WIN)
bool IpAddressAttributesEnabled(const webrtc::FieldTrialsView* field_trials) {
bool IpAddressAttributesEnabled(const FieldTrialsView* field_trials) {
// Field trial key reserved in bugs.webrtc.org/14334
if (field_trials &&
field_trials->IsEnabled("WebRTC-IPv6NetworkResolutionFixes")) {
webrtc::FieldTrialParameter<bool> ip_address_attributes_enabled(
FieldTrialParameter<bool> ip_address_attributes_enabled(
"IpAddressAttributesEnabled", false);
webrtc::ParseFieldTrial(
{&ip_address_attributes_enabled},
field_trials->Lookup("WebRTC-IPv6NetworkResolutionFixes"));
ParseFieldTrial({&ip_address_attributes_enabled},
field_trials->Lookup("WebRTC-IPv6NetworkResolutionFixes"));
return ip_address_attributes_enabled;
}
return false;
@ -628,7 +627,7 @@ void BasicNetworkManager::ConvertIfAddrs(
continue;
}
// Convert to InterfaceAddress.
// TODO(webrtc:13114): Convert ConvertIfAddrs to use webrtc::Netmask.
// TODO(webrtc:13114): Convert ConvertIfAddrs to use Netmask.
if (!ifaddrs_converter->ConvertIfAddrsToIPAddress(cursor, &ip, &mask)) {
continue;
}
@ -887,7 +886,7 @@ bool BasicNetworkManager::CreateNetworks(
adapter_type = ADAPTER_TYPE_VPN;
}
if (adapter_type != ADAPTER_TYPE_VPN &&
IsVpnMacAddress(webrtc::ArrayView<const uint8_t>(
IsVpnMacAddress(ArrayView<const uint8_t>(
reinterpret_cast<const uint8_t*>(
adapter_addrs->PhysicalAddress),
adapter_addrs->PhysicalAddressLength))) {

View File

@ -52,7 +52,7 @@ extern const char kPublicIPv6Host[];
class Network;
// By default, ignore loopback interfaces on the host.
const int kDefaultNetworkIgnoreMask = webrtc::ADAPTER_TYPE_LOOPBACK;
const int kDefaultNetworkIgnoreMask = ADAPTER_TYPE_LOOPBACK;
namespace webrtc_network_internal {
bool CompareNetworks(const std::unique_ptr<Network>& a,
@ -201,7 +201,7 @@ class RTC_EXPORT Network {
description,
prefix,
prefix_length,
webrtc::ADAPTER_TYPE_UNKNOWN) {}
ADAPTER_TYPE_UNKNOWN) {}
Network(absl::string_view name,
absl::string_view description,
@ -213,7 +213,7 @@ class RTC_EXPORT Network {
~Network();
// This signal is fired whenever type() or underlying_type_for_vpn() changes.
// Mutable, to support connecting on the const Network passed to webrtc::Port
// Mutable, to support connecting on the const Network passed to Port
// constructor.
mutable sigslot::signal1<const Network*> SignalTypeChanged;
@ -314,8 +314,8 @@ class RTC_EXPORT Network {
return;
}
type_ = type;
if (type != webrtc::ADAPTER_TYPE_VPN) {
underlying_type_for_vpn_ = webrtc::ADAPTER_TYPE_UNKNOWN;
if (type != ADAPTER_TYPE_VPN) {
underlying_type_for_vpn_ = ADAPTER_TYPE_UNKNOWN;
}
SignalTypeChanged(this);
}
@ -328,17 +328,17 @@ class RTC_EXPORT Network {
SignalTypeChanged(this);
}
bool IsVpn() const { return type_ == webrtc::ADAPTER_TYPE_VPN; }
bool IsVpn() const { return type_ == ADAPTER_TYPE_VPN; }
bool IsCellular() const { return IsCellular(type_); }
static bool IsCellular(AdapterType type) {
switch (type) {
case webrtc::ADAPTER_TYPE_CELLULAR:
case webrtc::ADAPTER_TYPE_CELLULAR_2G:
case webrtc::ADAPTER_TYPE_CELLULAR_3G:
case webrtc::ADAPTER_TYPE_CELLULAR_4G:
case webrtc::ADAPTER_TYPE_CELLULAR_5G:
case ADAPTER_TYPE_CELLULAR:
case ADAPTER_TYPE_CELLULAR_2G:
case ADAPTER_TYPE_CELLULAR_3G:
case ADAPTER_TYPE_CELLULAR_4G:
case ADAPTER_TYPE_CELLULAR_5G:
return true;
default:
return false;
@ -398,7 +398,7 @@ class RTC_EXPORT Network {
int scope_id_;
bool ignored_;
AdapterType type_;
AdapterType underlying_type_for_vpn_ = webrtc::ADAPTER_TYPE_UNKNOWN;
AdapterType underlying_type_for_vpn_ = ADAPTER_TYPE_UNKNOWN;
int preference_;
bool active_ = true;
uint16_t id_ = 0;

View File

@ -38,24 +38,20 @@ class RTC_EXPORT ReceivedIpPacket {
// Caller must keep memory pointed to by payload and address valid for the
// lifetime of this ReceivedPacket.
ReceivedIpPacket(ArrayView<const uint8_t> payload,
const webrtc::SocketAddress& source_address,
std::optional<webrtc::Timestamp> arrival_time = std::nullopt,
const SocketAddress& source_address,
std::optional<Timestamp> arrival_time = std::nullopt,
EcnMarking ecn = EcnMarking::kNotEct,
DecryptionInfo decryption = kNotDecrypted);
ReceivedIpPacket CopyAndSet(DecryptionInfo decryption_info) const;
// Address/port of the packet sender.
const webrtc::SocketAddress& source_address() const {
return source_address_;
}
const SocketAddress& source_address() const { return source_address_; }
ArrayView<const uint8_t> payload() const { return payload_; }
// Timestamp when this packet was received. Not available on all socket
// implementations.
std::optional<webrtc::Timestamp> arrival_time() const {
return arrival_time_;
}
std::optional<Timestamp> arrival_time() const { return arrival_time_; }
// L4S Explicit Congestion Notification.
EcnMarking ecn() const { return ecn_; }
@ -66,7 +62,7 @@ class RTC_EXPORT ReceivedIpPacket {
const char* data,
size_t size,
int64_t packet_time_us,
const webrtc::SocketAddress& addr = webrtc::SocketAddress()) {
const SocketAddress& addr = SocketAddress()) {
return CreateFromLegacy(reinterpret_cast<const uint8_t*>(data), size,
packet_time_us, addr);
}
@ -75,12 +71,12 @@ class RTC_EXPORT ReceivedIpPacket {
const uint8_t* data,
size_t size,
int64_t packet_time_us,
const webrtc::SocketAddress& = webrtc::SocketAddress());
const SocketAddress& = SocketAddress());
private:
ArrayView<const uint8_t> payload_;
std::optional<webrtc::Timestamp> arrival_time_;
const webrtc::SocketAddress& source_address_;
std::optional<Timestamp> arrival_time_;
const SocketAddress& source_address_;
EcnMarking ecn_;
DecryptionInfo decryption_info_;
};

View File

@ -77,7 +77,7 @@ class NetworkMonitorInterface {
AdapterType adapter_type;
// Is ADAPTER_TYPE_UNKNOWN unless adapter_type == ADAPTER_TYPE_VPN.
AdapterType underlying_type_for_vpn = webrtc::ADAPTER_TYPE_UNKNOWN;
AdapterType underlying_type_for_vpn = ADAPTER_TYPE_UNKNOWN;
// The OS/firmware specific preference of this interface.
NetworkPreference network_preference = NetworkPreference::NEUTRAL;

View File

@ -42,7 +42,7 @@ class RouteEndpoint {
// Used by tests.
static RouteEndpoint CreateWithNetworkId(uint16_t network_id) {
return RouteEndpoint(webrtc::ADAPTER_TYPE_UNKNOWN,
return RouteEndpoint(ADAPTER_TYPE_UNKNOWN,
/* adapter_id = */ 0, network_id,
/* uses_turn = */ false);
}
@ -58,7 +58,7 @@ class RouteEndpoint {
bool operator==(const RouteEndpoint& other) const;
private:
AdapterType adapter_type_ = webrtc::ADAPTER_TYPE_UNKNOWN;
AdapterType adapter_type_ = ADAPTER_TYPE_UNKNOWN;
uint16_t adapter_id_ = 0;
uint16_t network_id_ = 0;
bool uses_turn_ = false;
@ -78,10 +78,10 @@ struct NetworkRoute {
StringBuilder oss;
oss << "[ connected: " << connected << " local: [ " << local.adapter_id()
<< "/" << local.network_id() << " "
<< webrtc::AdapterTypeToString(local.adapter_type())
<< AdapterTypeToString(local.adapter_type())
<< " turn: " << local.uses_turn() << " ] remote: [ "
<< remote.adapter_id() << "/" << remote.network_id() << " "
<< webrtc::AdapterTypeToString(remote.adapter_type())
<< AdapterTypeToString(remote.adapter_type())
<< " turn: " << remote.uses_turn()
<< " ] packet_overhead_bytes: " << packet_overhead << " ]";
return oss.Release();

View File

@ -401,7 +401,7 @@ TEST_F(NetworkTest, DISABLED_TestCreateNetworks) {
IPAddress ip = (*it)->GetBestIP();
SocketAddress bindaddress(ip, 0);
bindaddress.SetScopeID((*it)->scope_id());
// TODO(thaloun): Use webrtc::Socket once it supports IPv6.
// TODO(thaloun): Use Socket once it supports IPv6.
int fd = static_cast<int>(socket(ip.family(), SOCK_STREAM, IPPROTO_TCP));
if (fd > 0) {
size_t ipsize = bindaddress.ToSockAddrStorage(&storage);

View File

@ -258,8 +258,8 @@ void OpenSSLAdapter::SetIdentity(std::unique_ptr<SSLIdentity> identity) {
identity_ =
absl::WrapUnique(static_cast<BoringSSLIdentity*>(identity.release()));
#else
identity_ = absl::WrapUnique(
static_cast<webrtc::OpenSSLIdentity*>(identity.release()));
identity_ =
absl::WrapUnique(static_cast<OpenSSLIdentity*>(identity.release()));
#endif
}
@ -912,7 +912,7 @@ int OpenSSLAdapter::SSLVerifyInternal(int previous_status,
}
const BoringSSLCertificate cert(std::move(crypto_buffer));
#else
const webrtc::OpenSSLCertificate cert(X509_STORE_CTX_get_current_cert(store));
const OpenSSLCertificate cert(X509_STORE_CTX_get_current_cert(store));
#endif
if (!ssl_cert_verifier_->Verify(cert)) {
RTC_LOG(LS_INFO) << "Failed to verify certificate using custom callback";

View File

@ -148,7 +148,7 @@ class OpenSSLAdapter final : public SSLAdapter {
#ifdef OPENSSL_IS_BORINGSSL
std::unique_ptr<BoringSSLIdentity> identity_;
#else
std::unique_ptr<webrtc::OpenSSLIdentity> identity_;
std::unique_ptr<OpenSSLIdentity> identity_;
#endif
// Indicates whethere this is a client or a server.
SSLRole role_;
@ -211,8 +211,8 @@ class OpenSSLAdapterFactory : public SSLAdapterFactory {
private:
// Holds the SSLMode (DTLS,TLS) that will be used to set the session cache.
SSLMode ssl_mode_ = webrtc::SSL_MODE_TLS;
SSLRole ssl_role_ = webrtc::SSL_CLIENT;
SSLMode ssl_mode_ = SSL_MODE_TLS;
SSLRole ssl_role_ = SSL_CLIENT;
bool ignore_bad_cert_ = false;
std::unique_ptr<SSLIdentity> identity_;

View File

@ -115,9 +115,8 @@ std::unique_ptr<SSLIdentity> OpenSSLIdentity::CreateFromPEMStrings(
std::unique_ptr<SSLIdentity> OpenSSLIdentity::CreateFromPEMChainStrings(
absl::string_view private_key,
absl::string_view certificate_chain) {
BIO* bio =
BIO_new_mem_buf(certificate_chain.data(),
webrtc::dchecked_cast<int>(certificate_chain.size()));
BIO* bio = BIO_new_mem_buf(certificate_chain.data(),
dchecked_cast<int>(certificate_chain.size()));
if (!bio)
return nullptr;
BIO_set_mem_eof_return(bio, 0);

View File

@ -317,7 +317,7 @@ void OpenSSLStreamAdapter::SetIdentity(std::unique_ptr<SSLIdentity> identity) {
#ifdef OPENSSL_IS_BORINGSSL
identity_.reset(static_cast<BoringSSLIdentity*>(identity.release()));
#else
identity_.reset(static_cast<webrtc::OpenSSLIdentity*>(identity.release()));
identity_.reset(static_cast<OpenSSLIdentity*>(identity.release()));
#endif
}
@ -1203,7 +1203,7 @@ int OpenSSLStreamAdapter::SSLVerifyCallback(X509_STORE_CTX* store, void* arg) {
// Record the peer's certificate.
X509* cert = X509_STORE_CTX_get0_cert(store);
stream->peer_cert_chain_.reset(
new SSLCertChain(std::make_unique<webrtc::OpenSSLCertificate>(cert)));
new SSLCertChain(std::make_unique<OpenSSLCertificate>(cert)));
// If the peer certificate digest isn't known yet, we'll wait to verify
// until it's known, and for now just return a success status.

View File

@ -79,7 +79,7 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter {
SSLIdentity* GetIdentityForTesting() const override;
// Default argument is for compatibility
void SetServerRole(SSLRole role = webrtc::SSL_SERVER) override;
void SetServerRole(SSLRole role = SSL_SERVER) override;
SSLPeerCertificateDigestError SetPeerCertificateDigest(
absl::string_view digest_alg,
ArrayView<const uint8_t> digest_val) override;
@ -232,7 +232,7 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter {
#ifdef OPENSSL_IS_BORINGSSL
std::unique_ptr<BoringSSLIdentity> identity_;
#else
std::unique_ptr<webrtc::OpenSSLIdentity> identity_;
std::unique_ptr<OpenSSLIdentity> identity_;
#endif
// The certificate chain that the peer presented. Initially null, until the
// connection is established.

View File

@ -1825,7 +1825,7 @@ bool PhysicalSocketServer::WaitPoll(int cmsWait, bool process_io) {
int64_t msStop = -1;
if (cmsWait != kForeverMs) {
msWait = cmsWait;
msStop = webrtc::TimeAfter(cmsWait);
msStop = TimeAfter(cmsWait);
}
std::vector<pollfd> pollfds;
@ -1833,7 +1833,7 @@ bool PhysicalSocketServer::WaitPoll(int cmsWait, bool process_io) {
while (fWait_) {
{
webrtc::CritScope cr(&crit_);
CritScope cr(&crit_);
current_dispatcher_keys_.clear();
pollfds.clear();
pollfds.reserve(dispatcher_by_key_.size());
@ -1867,7 +1867,7 @@ bool PhysicalSocketServer::WaitPoll(int cmsWait, bool process_io) {
return true;
} else {
// We have signaled descriptors
webrtc::CritScope cr(&crit_);
CritScope cr(&crit_);
// Iterate only on the dispatchers whose file descriptors were passed into
// poll; this avoids the ABA problem (a socket being destroyed and a new
// one created with the same file descriptor).
@ -1880,7 +1880,7 @@ bool PhysicalSocketServer::WaitPoll(int cmsWait, bool process_io) {
}
if (cmsWait != kForeverMs) {
msWait = webrtc::TimeDiff(msStop, webrtc::TimeMillis());
msWait = TimeDiff(msStop, TimeMillis());
if (msWait < 0) {
// Return success on timeout.
return true;
@ -1896,8 +1896,7 @@ bool PhysicalSocketServer::WaitPoll(int cmsWait, bool process_io) {
#endif // WEBRTC_POSIX
#if defined(WEBRTC_WIN)
bool PhysicalSocketServer::Wait(webrtc::TimeDelta max_wait_duration,
bool process_io) {
bool PhysicalSocketServer::Wait(TimeDelta max_wait_duration, bool process_io) {
// We don't support reentrant waiting.
RTC_DCHECK(!waiting_);
ScopedSetTrue set(&waiting_);
@ -1905,7 +1904,7 @@ bool PhysicalSocketServer::Wait(webrtc::TimeDelta max_wait_duration,
int cmsWait = ToCmsWait(max_wait_duration);
int64_t cmsTotal = cmsWait;
int64_t cmsElapsed = 0;
int64_t msStart = webrtc::Time();
int64_t msStart = Time();
fWait_ = true;
while (fWait_) {
@ -1915,7 +1914,7 @@ bool PhysicalSocketServer::Wait(webrtc::TimeDelta max_wait_duration,
events.push_back(socket_ev_);
{
webrtc::CritScope cr(&crit_);
CritScope cr(&crit_);
// Get a snapshot of all current dispatchers; this is used to avoid the
// ABA problem (see later comment) and avoids the dispatcher_by_key_
// iterator being invalidated by calling CheckSignalClose, which may
@ -1971,7 +1970,7 @@ bool PhysicalSocketServer::Wait(webrtc::TimeDelta max_wait_duration,
return true;
} else {
// Figure out which one it is and call it
webrtc::CritScope cr(&crit_);
CritScope cr(&crit_);
int index = dw - WSA_WAIT_EVENT_0;
if (index > 0) {
--index; // The first event is the socket event
@ -2064,7 +2063,7 @@ bool PhysicalSocketServer::Wait(webrtc::TimeDelta max_wait_duration,
// Break?
if (!fWait_)
break;
cmsElapsed = webrtc::TimeSince(msStart);
cmsElapsed = TimeSince(msStart);
if ((cmsWait != kForeverMs) && (cmsElapsed >= cmsWait)) {
break;
}

View File

@ -54,7 +54,7 @@ class RefCountedObject : public T {
protected:
~RefCountedObject() override {}
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
mutable webrtc_impl::RefCounter ref_count_{0};
};
template <class T>
@ -81,7 +81,7 @@ class FinalRefCountedObject final : public T {
private:
~FinalRefCountedObject() = default;
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
mutable webrtc_impl::RefCounter ref_count_{0};
};
} // namespace webrtc

View File

@ -30,8 +30,7 @@ class RTCCertificateGeneratorInterface {
public:
// Functor that will be called when certificate is generated asynchroniosly.
// Called with nullptr as the parameter on failure.
using Callback =
absl::AnyInvocable<void(scoped_refptr<webrtc::RTCCertificate>) &&>;
using Callback = absl::AnyInvocable<void(scoped_refptr<RTCCertificate>) &&>;
virtual ~RTCCertificateGeneratorInterface() = default;

View File

@ -138,7 +138,7 @@ std::unique_ptr<SSLCertificate> SSLCertificate::FromPEMString(
#ifdef OPENSSL_IS_BORINGSSL
return BoringSSLCertificate::FromPEMString(pem_string);
#else
return webrtc::OpenSSLCertificate::FromPEMString(pem_string);
return OpenSSLCertificate::FromPEMString(pem_string);
#endif
}

View File

@ -125,8 +125,7 @@ class SSLStreamAdapter : public StreamInterface {
// Caller is responsible for freeing the returned object.
static std::unique_ptr<SSLStreamAdapter> Create(
std::unique_ptr<StreamInterface> stream,
absl::AnyInvocable<void(webrtc::SSLHandshakeError)> handshake_error =
nullptr,
absl::AnyInvocable<void(SSLHandshakeError)> handshake_error = nullptr,
const FieldTrialsView* field_trials = nullptr);
SSLStreamAdapter() = default;

File diff suppressed because it is too large Load Diff

View File

@ -140,7 +140,7 @@ class RTC_EXPORT StreamInterface {
}
RTC_NO_UNIQUE_ADDRESS SequenceChecker callback_sequence_{
webrtc::SequenceChecker::kDetached};
SequenceChecker::kDetached};
private:
absl::AnyInvocable<void(int, int)> callback_

View File

@ -75,7 +75,7 @@ template <typename T,
int>::type = 0>
static bool FromString(absl::string_view s, T* t) {
RTC_DCHECK(t);
std::optional<T> result = webrtc::StringToNumber<T>(s);
std::optional<T> result = StringToNumber<T>(s);
if (result)
*t = *result;

View File

@ -37,7 +37,7 @@ const size_t SIZE_UNKNOWN = static_cast<size_t>(-1);
// std::map that support heterogenous lookup.
//
// Example usage:
// std::map<std::string, int, webrtc::AbslStringViewCmp> my_map;
// std::map<std::string, int, AbslStringViewCmp> my_map;
struct AbslStringViewCmp {
using is_transparent = void;
bool operator()(absl::string_view a, absl::string_view b) const {

View File

@ -56,7 +56,7 @@ int64_t SystemTimeNanos() {
RTC_DCHECK_NE(b, 0);
RTC_DCHECK_LE(a, std::numeric_limits<int64_t>::max() / b)
<< "The multiplication " << a << " * " << b << " overflows";
return webrtc::dchecked_cast<int64_t>(a * b);
return dchecked_cast<int64_t>(a * b);
};
ticks = mul(mach_absolute_time(), timebase.numer) / timebase.denom;
#elif defined(WEBRTC_POSIX)
@ -90,7 +90,7 @@ int64_t SystemTimeNanos() {
ticks = now + (num_wrap_timegettime << 32);
// TODO(deadbeef): Calculate with nanosecond precision. Otherwise, we're
// just wasting a multiply and divide when doing Time() on Windows.
ticks = ticks * webrtc::kNumNanosecsPerMillisec;
ticks = ticks * kNumNanosecsPerMillisec;
#pragma clang diagnostic pop
#else
#error Unsupported platform.

View File

@ -52,21 +52,19 @@ class TaskQueueForTest {
// Returns non-owning pointer to the task queue implementation.
TaskQueueBase* Get() { return impl_.get(); }
void PostTask(
absl::AnyInvocable<void() &&> task,
const webrtc::Location& location = webrtc::Location::Current()) {
void PostTask(absl::AnyInvocable<void() &&> task,
const Location& location = Location::Current()) {
impl_->PostTask(std::move(task), location);
}
void PostDelayedTask(
absl::AnyInvocable<void() &&> task,
webrtc::TimeDelta delay,
const webrtc::Location& location = webrtc::Location::Current()) {
void PostDelayedTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const Location& location = Location::Current()) {
impl_->PostDelayedTask(std::move(task), delay, location);
}
void PostDelayedHighPrecisionTask(
absl::AnyInvocable<void() &&> task,
webrtc::TimeDelta delay,
const webrtc::Location& location = webrtc::Location::Current()) {
TimeDelta delay,
const Location& location = Location::Current()) {
impl_->PostDelayedHighPrecisionTask(std::move(task), delay, location);
}

View File

@ -50,7 +50,7 @@ namespace {
void CALLBACK InitializeQueueThread(ULONG_PTR param) {
MSG msg;
::PeekMessage(&msg, nullptr, WM_USER, WM_USER, PM_NOREMOVE);
webrtc::Event* data = reinterpret_cast<webrtc::Event*>(param);
Event* data = reinterpret_cast<Event*>(param);
data->Set();
}
@ -197,9 +197,9 @@ TaskQueueWin::TaskQueueWin(absl::string_view queue_name,
ThreadPriority priority)
: in_queue_(::CreateEvent(nullptr, true, false, nullptr)) {
RTC_DCHECK(in_queue_);
thread_ = webrtc::PlatformThread::SpawnJoinable(
[this] { RunThreadMain(); }, queue_name,
webrtc::ThreadAttributes().SetPriority(priority));
thread_ =
PlatformThread::SpawnJoinable([this] { RunThreadMain(); }, queue_name,
ThreadAttributes().SetPriority(priority));
Event event(false, false);
RTC_CHECK(thread_.QueueAPC(&InitializeQueueThread,

View File

@ -906,7 +906,7 @@ AutoThread::AutoThread()
: Thread(CreateDefaultSocketServer(), /*do_init=*/false) {
if (!ThreadManager::Instance()->CurrentThread()) {
// DoInit registers with ThreadManager. Do that only if we intend to
// be webrtc::Thread::Current(), otherwise ProcessAllMessageQueuesInternal
// be Thread::Current(), otherwise ProcessAllMessageQueuesInternal
// will post a message to a queue that no running thread is serving.
DoInit();
ThreadManager::Instance()->SetCurrentThread(this);

View File

@ -366,7 +366,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public TaskQueueBase {
// These functions are public to avoid injecting test hooks. Don't call them
// outside of tests.
// This method should be called when thread is created using non standard
// method, like derived implementation of webrtc::Thread and it can not be
// method, like derived implementation of Thread and it can not be
// started by calling Start(). This will set started flag to true and
// owned to false. This must be called from the current thread.
bool WrapCurrent();

View File

@ -127,7 +127,7 @@ int64_t TmToSeconds(const tm& tm);
// Note that this function obeys the system's idea about what the time
// is. It is not guaranteed to be monotonic; it will jump in case the
// system time is changed, e.g., by some other process calling
// settimeofday. Always use webrtc::TimeMicros(), not this function, for
// settimeofday. Always use TimeMicros(), not this function, for
// measuring time intervals and timeouts.
RTC_EXPORT int64_t TimeUTCMicros();

View File

@ -19,13 +19,13 @@
namespace webrtc {
// The TimestampAligner class helps translating timestamps of a capture system
// into the same timescale as is used by webrtc::TimeMicros(). Some capture
// into the same timescale as is used by TimeMicros(). Some capture
// systems provide timestamps, which comes from the capturing hardware (camera
// or sound card) or stamped close to the capturing hardware. Such timestamps
// are more accurate (less jittery) than reading the system clock, but may have
// a different epoch and unknown clock drift. Frame timestamps in webrtc should
// use webrtc::TimeMicros (system monotonic time), and this class provides a
// filter which lets us use the webrtc::TimeMicros timescale, and at the same
// use TimeMicros (system monotonic time), and this class provides a
// filter which lets us use the TimeMicros timescale, and at the same
// time take advantage of higher accuracy of the capturer's clock.
// This class is not thread safe, so all calls to it must be synchronized
@ -46,9 +46,9 @@ class RTC_EXPORT TimestampAligner {
static constexpr int64_t kMinFrameIntervalUs = kNumMicrosecsPerMillisec;
// Translates timestamps of a capture system to the same timescale as is used
// by webrtc::TimeMicros(). `capturer_time_us` is assumed to be accurate, but
// by TimeMicros(). `capturer_time_us` is assumed to be accurate, but
// with an unknown epoch and clock drift. `system_time_us` is
// time according to webrtc::TimeMicros(), preferably read as soon as
// time according to TimeMicros(), preferably read as soon as
// possible when the frame is captured. It may have poor accuracy
// due to poor resolution or scheduling delays. Returns the
// translated timestamp.

View File

@ -54,7 +54,7 @@ class UniqueNumberGenerator {
private:
RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_checker_{
webrtc::SequenceChecker::kDetached};
SequenceChecker::kDetached};
static_assert(std::is_integral<TIntegral>::value, "Must be integral type.");
TIntegral counter_ RTC_GUARDED_BY(sequence_checker_);
std::set<TIntegral> known_ids_ RTC_GUARDED_BY(sequence_checker_);

View File

@ -137,7 +137,7 @@ const char* inet_ntop_v6(const void* src, char* dst, socklen_t size) {
for (int i = 0; i < run_array_size; ++i) {
if (runpos[i] == -1) {
cursor += snprintf(cursor, INET6_ADDRSTRLEN - (cursor - dst), "%x",
webrtc::NetworkToHost16(as_shorts[i]));
NetworkToHost16(as_shorts[i]));
if (i != 7 && runpos[i + 1] != 1) {
*cursor++ = ':';
}
@ -292,7 +292,7 @@ int inet_pton_v6(const char* src, void* dst) {
if (sscanf(readcursor, "%4hx%n", &word, &bytesread) != 1) {
return 0;
} else {
*addr_cursor = webrtc::HostToNetwork16(word);
*addr_cursor = HostToNetwork16(word);
++addr_cursor;
readcursor += bytesread;
if (*readcursor != ':' && *readcursor != '\0') {