Use backticks not vertical bars to denote variables in comments for /rtc_base

Bug: webrtc:12338
Change-Id: I72fcb505a92f03b2ace7160ee33d555a977eddfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226955
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34587}
This commit is contained in:
Artem Titov 2021-07-26 16:03:14 +02:00 committed by WebRTC LUCI CQ
parent 22a6b2dcad
commit 96e3b991da
105 changed files with 352 additions and 352 deletions

View file

@ -53,7 +53,7 @@ void DEPRECATED_AsyncInvoker::Flush(Thread* thread,
if (destroying_.load(std::memory_order_relaxed))
return;
// Run this on |thread| to reduce the number of context switches.
// Run this on `thread` to reduce the number of context switches.
if (Thread::Current() != thread) {
thread->Invoke<void>(RTC_FROM_HERE,
[this, thread, id] { Flush(thread, id); });
@ -113,8 +113,8 @@ AsyncClosure::~AsyncClosure() {
// destructor.
invoker_->pending_invocations_.fetch_sub(1, std::memory_order_release);
// After |pending_invocations_| is decremented, we may need to signal
// |invocation_complete_| in case the AsyncInvoker is being destroyed and
// After `pending_invocations_` is decremented, we may need to signal
// `invocation_complete_` in case the AsyncInvoker is being destroyed and
// waiting for pending tasks to complete.
//
// It's also possible that the destructor finishes before "Set()" is called,

View file

@ -92,7 +92,7 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
DEPRECATED_AsyncInvoker();
~DEPRECATED_AsyncInvoker() override;
// Call |functor| asynchronously on |thread|, with no callback upon
// Call `functor` asynchronously on `thread`, with no callback upon
// completion. Returns immediately.
template <class ReturnT, class FunctorT>
void AsyncInvoke(const Location& posted_from,
@ -105,7 +105,7 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
DoInvoke(posted_from, thread, std::move(closure), id);
}
// Call |functor| asynchronously on |thread| with |delay_ms|, with no callback
// Call `functor` asynchronously on `thread` with `delay_ms`, with no callback
// upon completion. Returns immediately.
template <class ReturnT, class FunctorT>
void AsyncInvokeDelayed(const Location& posted_from,
@ -119,8 +119,8 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
DoInvokeDelayed(posted_from, thread, std::move(closure), delay_ms, id);
}
// Synchronously execute on |thread| all outstanding calls we own
// that are pending on |thread|, and wait for calls to complete
// Synchronously execute on `thread` all outstanding calls we own
// that are pending on `thread`, and wait for calls to complete
// before returning. Optionally filter by message id.
// The destructor will not wait for outstanding calls, so if that
// behavior is desired, call Flush() before destroying this object.

View file

@ -57,7 +57,7 @@ int ResolveHostname(const std::string& hostname,
struct addrinfo* result = nullptr;
struct addrinfo hints = {0};
hints.ai_family = family;
// |family| here will almost always be AF_UNSPEC, because |family| comes from
// `family` here will almost always be AF_UNSPEC, because `family` comes from
// AsyncResolver::addr_.family(), which comes from a SocketAddress constructed
// with a hostname. When a SocketAddress is constructed with a hostname, its
// family is AF_UNSPEC. However, if someday in the future we construct
@ -174,7 +174,7 @@ int AsyncResolver::GetError() const {
void AsyncResolver::Destroy(bool wait) {
// Some callers have trouble guaranteeing that Destroy is called on the
// sequence guarded by |sequence_checker_|.
// sequence guarded by `sequence_checker_`.
// RTC_DCHECK_RUN_ON(&sequence_checker_);
RTC_DCHECK(!destroy_called_);
destroy_called_ = true;

View file

@ -23,12 +23,12 @@ class RTC_EXPORT AsyncResolverInterface {
AsyncResolverInterface();
virtual ~AsyncResolverInterface();
// Start address resolution of the hostname in |addr|.
// Start address resolution of the hostname in `addr`.
virtual void Start(const SocketAddress& addr) = 0;
// Returns true iff the address from |Start| was successfully resolved.
// If the address was successfully resolved, sets |addr| to a copy of the
// address from |Start| with the IP address set to the top most resolved
// address of |family| (|addr| will have both hostname and the resolved ip).
// Returns true iff the address from `Start` was successfully resolved.
// If the address was successfully resolved, sets `addr` to a copy of the
// address from `Start` with the IP address set to the top most resolved
// address of `family` (`addr` will have both hostname and the resolved ip).
virtual bool GetResolvedAddress(int family, SocketAddress* addr) const = 0;
// Returns error from resolver.
virtual int GetError() const = 0;

View file

@ -44,7 +44,7 @@ static const size_t kMinimumRecvSize = 128;
static const int kListenBacklog = 5;
// Binds and connects |socket|
// Binds and connects `socket`
AsyncSocket* AsyncTCPSocketBase::ConnectSocket(
rtc::AsyncSocket* socket,
const rtc::SocketAddress& bind_address,
@ -276,9 +276,9 @@ void AsyncTCPSocketBase::OnCloseEvent(AsyncSocket* socket, int error) {
}
// AsyncTCPSocket
// Binds and connects |socket| and creates AsyncTCPSocket for
// it. Takes ownership of |socket|. Returns null if bind() or
// connect() fail (|socket| is destroyed in that case).
// Binds and connects `socket` and creates AsyncTCPSocket for
// it. Takes ownership of `socket`. Returns null if bind() or
// connect() fail (`socket` is destroyed in that case).
AsyncTCPSocket* AsyncTCPSocket::Create(AsyncSocket* socket,
const SocketAddress& bind_address,
const SocketAddress& remote_address) {

View file

@ -55,17 +55,17 @@ class AsyncTCPSocketBase : public AsyncPacketSocket {
void SetError(int error) override;
protected:
// Binds and connects |socket| and creates AsyncTCPSocket for
// it. Takes ownership of |socket|. Returns null if bind() or
// connect() fail (|socket| is destroyed in that case).
// Binds and connects `socket` and creates AsyncTCPSocket for
// it. Takes ownership of `socket`. Returns null if bind() or
// connect() fail (`socket` is destroyed in that case).
static AsyncSocket* ConnectSocket(AsyncSocket* socket,
const SocketAddress& bind_address,
const SocketAddress& remote_address);
int FlushOutBuffer();
// Add data to |outbuf_|.
// Add data to `outbuf_`.
void AppendToOutBuffer(const void* pv, size_t cb);
// Helper methods for |outpos_|.
// Helper methods for `outpos_`.
bool IsOutBufferEmpty() const { return outbuf_.size() == 0; }
void ClearOutBuffer() { outbuf_.Clear(); }
@ -88,9 +88,9 @@ class AsyncTCPSocketBase : public AsyncPacketSocket {
class AsyncTCPSocket : public AsyncTCPSocketBase {
public:
// Binds and connects |socket| and creates AsyncTCPSocket for
// it. Takes ownership of |socket|. Returns null if bind() or
// connect() fail (|socket| is destroyed in that case).
// Binds and connects `socket` and creates AsyncTCPSocket for
// it. Takes ownership of `socket`. Returns null if bind() or
// connect() fail (`socket` is destroyed in that case).
static AsyncTCPSocket* Create(AsyncSocket* socket,
const SocketAddress& bind_address,
const SocketAddress& remote_address);

View file

@ -27,8 +27,8 @@ namespace rtc {
// buffered since it is acceptable to drop packets under high load.
class AsyncUDPSocket : public AsyncPacketSocket {
public:
// Binds |socket| and creates AsyncUDPSocket for it. Takes ownership
// of |socket|. Returns null if bind() fails (|socket| is destroyed
// Binds `socket` and creates AsyncUDPSocket for it. Takes ownership
// of `socket`. Returns null if bind() fails (`socket` is destroyed
// in that case).
static AsyncUDPSocket* Create(AsyncSocket* socket,
const SocketAddress& bind_address);

View file

@ -17,13 +17,13 @@
namespace {
// Returns the lowest (right-most) |bit_count| bits in |byte|.
// Returns the lowest (right-most) `bit_count` bits in `byte`.
uint8_t LowestBits(uint8_t byte, size_t bit_count) {
RTC_DCHECK_LE(bit_count, 8);
return byte & ((1 << bit_count) - 1);
}
// Returns the highest (left-most) |bit_count| bits in |byte|, shifted to the
// Returns the highest (left-most) `bit_count` bits in `byte`, shifted to the
// lowest bits (to the right).
uint8_t HighestBits(uint8_t byte, size_t bit_count) {
RTC_DCHECK_LE(bit_count, 8);
@ -32,14 +32,14 @@ uint8_t HighestBits(uint8_t byte, size_t bit_count) {
return (byte & mask) >> shift;
}
// Returns the highest byte of |val| in a uint8_t.
// Returns the highest byte of `val` in a uint8_t.
uint8_t HighestByte(uint64_t val) {
return static_cast<uint8_t>(val >> 56);
}
// Returns the result of writing partial data from |source|, of
// |source_bit_count| size in the highest bits, to |target| at
// |target_bit_offset| from the highest bit.
// Returns the result of writing partial data from `source`, of
// `source_bit_count` size in the highest bits, to `target` at
// `target_bit_offset` from the highest bit.
uint8_t WritePartialByte(uint8_t source,
size_t source_bit_count,
uint8_t target,

View file

@ -106,10 +106,10 @@ class BitBuffer {
return val ? ReadSignedExponentialGolomb(*val) : false;
}
// Moves current position |byte_count| bytes forward. Returns false if
// Moves current position `byte_count` bytes forward. Returns false if
// there aren't enough bytes left in the buffer.
bool ConsumeBytes(size_t byte_count);
// Moves current position |bit_count| bits forward. Returns false if
// Moves current position `bit_count` bits forward. Returns false if
// there aren't enough bits left in the buffer.
bool ConsumeBits(size_t bit_count);
@ -119,9 +119,9 @@ class BitBuffer {
protected:
const uint8_t* const bytes_;
// The total size of |bytes_|.
// The total size of `bytes_`.
size_t byte_count_;
// The current offset, in bytes, from the start of |bytes_|.
// The current offset, in bytes, from the start of `bytes_`.
size_t byte_offset_;
// The current offset, in bits, into the current byte.
size_t bit_offset_;
@ -134,7 +134,7 @@ class BitBuffer {
// BitBuffer API, so both reading and writing will consume bytes/bits.
class BitBufferWriter : public BitBuffer {
public:
// Constructs a bit buffer for the writable buffer of |bytes|.
// Constructs a bit buffer for the writable buffer of `bytes`.
BitBufferWriter(uint8_t* bytes, size_t byte_count);
// Writes byte-sized values from the buffer. Returns false if there isn't
@ -152,7 +152,7 @@ class BitBufferWriter : public BitBuffer {
// Call SizeNonSymmetricBits to get number of bits needed to store the value.
// Returns false if there isn't enough room left for the value.
bool WriteNonSymmetric(uint32_t val, uint32_t num_values);
// Returns number of bits required to store |val| with NonSymmetric encoding.
// Returns number of bits required to store `val` with NonSymmetric encoding.
static size_t SizeNonSymmetricBits(uint32_t val, uint32_t num_values);
// Writes the exponential golomb encoded version of the supplied value.

View file

@ -115,7 +115,7 @@ bool AddSHA256SignatureAlgorithm(CBB* cbb, KeyType key_type) {
return true;
}
// Adds an X.509 Common Name to |cbb|.
// Adds an X.509 Common Name to `cbb`.
bool AddCommonName(CBB* cbb, const std::string& common_name) {
// See RFC 4519.
static const uint8_t kCommonName[] = {0x55, 0x04, 0x03};

View file

@ -52,7 +52,7 @@ class BoringSSLCertificate final : public SSLCertificate {
bool operator==(const BoringSSLCertificate& other) const;
bool operator!=(const BoringSSLCertificate& other) const;
// Compute the digest of the certificate given |algorithm|.
// Compute the digest of the certificate given `algorithm`.
bool ComputeDigest(const std::string& algorithm,
unsigned char* digest,
size_t size,

View file

@ -229,13 +229,13 @@ class BufferT {
SetData(w.data(), w.size());
}
// Replaces the data in the buffer with at most |max_elements| of data, using
// the function |setter|, which should have the following signature:
// Replaces the data in the buffer with at most `max_elements` of data, using
// the function `setter`, which should have the following signature:
//
// size_t setter(ArrayView<U> view)
//
// |setter| is given an appropriately typed ArrayView of length exactly
// |max_elements| that describes the area where it should write the data; it
// `setter` is given an appropriately typed ArrayView of length exactly
// `max_elements` that describes the area where it should write the data; it
// should return the number of elements actually written. (If it doesn't fill
// the whole ArrayView, it should leave the unused space at the end.)
template <typename U = T,
@ -290,13 +290,13 @@ class BufferT {
AppendData(&item, 1);
}
// Appends at most |max_elements| to the end of the buffer, using the function
// |setter|, which should have the following signature:
// Appends at most `max_elements` to the end of the buffer, using the function
// `setter`, which should have the following signature:
//
// size_t setter(ArrayView<U> view)
//
// |setter| is given an appropriately typed ArrayView of length exactly
// |max_elements| that describes the area where it should write the data; it
// `setter` is given an appropriately typed ArrayView of length exactly
// `max_elements` that describes the area where it should write the data; it
// should return the number of elements actually written. (If it doesn't fill
// the whole ArrayView, it should leave the unused space at the end.)
template <typename U = T,

View file

@ -33,7 +33,7 @@ class BufferQueue final {
// Return number of queued buffers.
size_t size() const;
// Clear the BufferQueue by moving all Buffers from |queue_| to |free_list_|.
// Clear the BufferQueue by moving all Buffers from `queue_` to `free_list_`.
void Clear();
// ReadFront will only read one buffer at a time and will truncate buffers

View file

@ -83,7 +83,7 @@ class ByteBufferWriterT {
return buffer_.data();
}
// Resize the buffer to the specified |size|.
// Resize the buffer to the specified `size`.
void Resize(size_t size) { buffer_.SetSize(size); }
// Clears the contents of the buffer. After this, Length() will be 0.
@ -144,12 +144,12 @@ class ByteBufferReader {
bool ReadUVarint(uint64_t* val);
bool ReadBytes(char* val, size_t len);
// Appends next |len| bytes from the buffer to |val|. Returns false
// if there is less than |len| bytes left.
// Appends next `len` bytes from the buffer to `val`. Returns false
// if there is less than `len` bytes left.
bool ReadString(std::string* val, size_t len);
// Moves current position |size| bytes forward. Returns false if
// there is less than |size| bytes left in the buffer. Consume doesn't
// Moves current position `size` bytes forward. Returns false if
// there is less than `size` bytes left in the buffer. Consume doesn't
// permanently remove data, so remembered read positions are still valid
// after this call.
bool Consume(size_t size);

View file

@ -356,7 +356,7 @@ RTC_NORETURN RTC_EXPORT void UnreachableCodeReached();
} // namespace webrtc_checks_impl
// The actual stream used isn't important. We reference |ignored| in the code
// The actual stream used isn't important. We reference `ignored` in the code
// but don't evaluate it; this is to avoid "unused variable" warnings (we do so
// in a particularly convoluted way with an extra ?: because that appears to be
// the simplest construct that keeps Visual Studio from complaining about
@ -368,8 +368,8 @@ RTC_NORETURN RTC_EXPORT void UnreachableCodeReached();
::rtc::webrtc_checks_impl::LogStreamer<>()
// Call RTC_EAT_STREAM_PARAMETERS with an argument that fails to compile if
// values of the same types as |a| and |b| can't be compared with the given
// operation, and that would evaluate |a| and |b| if evaluated.
// values of the same types as `a` and `b` can't be compared with the given
// operation, and that would evaluate `a` and `b` if evaluated.
#define RTC_EAT_STREAM_PARAMETERS_OP(op, a, b) \
RTC_EAT_STREAM_PARAMETERS(((void)::rtc::Safe##op(a, b)))
@ -377,7 +377,7 @@ RTC_NORETURN RTC_EXPORT void UnreachableCodeReached();
// controlled by NDEBUG or anything else, so the check will be executed
// regardless of compilation mode.
//
// We make sure RTC_CHECK et al. always evaluates |condition|, as
// We make sure RTC_CHECK et al. always evaluates `condition`, as
// doing RTC_CHECK(FunctionWithSideEffect()) is a common idiom.
//
// RTC_CHECK_OP is a helper macro for binary operators.

View file

@ -242,7 +242,7 @@ TEST(FlatMap, InsertOrAssignMoveOnlyKey) {
flat_map<MoveOnlyInt, MoveOnlyInt> m;
// Initial insertion should return an iterator to the element and set the
// second pair member to |true|. The inserted key and value should be moved
// second pair member to `true`. The inserted key and value should be moved
// from.
MoveOnlyInt key(1);
MoveOnlyInt val(22);
@ -256,7 +256,7 @@ TEST(FlatMap, InsertOrAssignMoveOnlyKey) {
// Second call with same key should result in an assignment, overwriting the
// old value. Assignment should be indicated by setting the second pair member
// to |false|. Only the inserted value should be moved from, the key should be
// to `false`. Only the inserted value should be moved from, the key should be
// left intact.
key = MoveOnlyInt(1);
val = MoveOnlyInt(44);
@ -316,7 +316,7 @@ TEST(FlatMap, TryEmplaceMoveOnlyKey) {
flat_map<MoveOnlyInt, std::pair<MoveOnlyInt, MoveOnlyInt>> m;
// Trying to emplace into an empty map should succeed. Insertion should return
// an iterator to the element and set the second pair member to |true|. The
// an iterator to the element and set the second pair member to `true`. The
// inserted key and value should be moved from.
MoveOnlyInt key(1);
MoveOnlyInt val1(22);

View file

@ -432,14 +432,14 @@ class flat_tree {
template <class... Args>
iterator unsafe_emplace(const_iterator position, Args&&... args);
// Attempts to emplace a new element with key |key|. Only if |key| is not yet
// present, construct value_type from |args| and insert it. Returns an
// iterator to the element with key |key| and a bool indicating whether an
// Attempts to emplace a new element with key `key`. Only if `key` is not yet
// present, construct value_type from `args` and insert it. Returns an
// iterator to the element with key `key` and a bool indicating whether an
// insertion happened.
template <class K, class... Args>
std::pair<iterator, bool> emplace_key_args(const K& key, Args&&... args);
// Similar to |emplace_key_args|, but checks |hint| first as a possible
// Similar to `emplace_key_args`, but checks `hint` first as a possible
// insertion position.
template <class K, class... Args>
std::pair<iterator, bool> emplace_hint_key_args(const_iterator hint,
@ -553,7 +553,7 @@ class flat_tree {
// have to store an instance of Compare. Since Compare commonly is stateless,
// we use the RTC_NO_UNIQUE_ADDRESS attribute to save space.
RTC_NO_UNIQUE_ADDRESS key_compare comp_;
// Declare after |key_compare_comp_| to workaround GCC ICE. For details
// Declare after `key_compare_comp_` to workaround GCC ICE. For details
// see https://crbug.com/1156268
container_type body_;

View file

@ -18,11 +18,11 @@
namespace rtc {
// Updates a CRC32 checksum with |len| bytes from |buf|. |initial| holds the
// Updates a CRC32 checksum with `len` bytes from `buf`. `initial` holds the
// checksum result from the previous update; for the first call, it should be 0.
uint32_t UpdateCrc32(uint32_t initial, const void* buf, size_t len);
// Computes a CRC32 checksum using |len| bytes from |buf|.
// Computes a CRC32 checksum using `len` bytes from `buf`.
inline uint32_t ComputeCrc32(const void* buf, size_t len) {
return UpdateCrc32(0, buf, len);
}

View file

@ -70,7 +70,7 @@ class RTC_LOCKABLE RecursiveCriticalSection {
// TODO(tommi): We could use this number and subtract the recursion count
// to find places where we have multiple threads contending on the same lock.
mutable volatile int lock_queue_;
// |recursion_| represents the recursion count + 1 for the thread that owns
// `recursion_` represents the recursion count + 1 for the thread that owns
// the lock. Only modified by the thread that owns the lock.
mutable int recursion_;
// Used to signal a single waiting thread when the lock becomes available.

View file

@ -48,9 +48,9 @@ class BalancedDegradationSettings {
// Optional settings.
int qp_low = 0;
int qp_high = 0;
int fps = 0; // If unset, defaults to |fps| in Config.
int kbps = 0; // If unset, defaults to |kbps| in Config.
int kbps_res = 0; // If unset, defaults to |kbps_res| in Config.
int fps = 0; // If unset, defaults to `fps` in Config.
int kbps = 0; // If unset, defaults to `kbps` in Config.
int kbps_res = 0; // If unset, defaults to `kbps_res` in Config.
};
struct Config {
@ -94,11 +94,11 @@ class BalancedDegradationSettings {
// optional optional
int pixels = 0; // Video frame size.
// If the frame size is less than or equal to |pixels|:
// If the frame size is less than or equal to `pixels`:
int fps = 0; // Min framerate to be used.
int kbps = 0; // Min bitrate needed to adapt up (resolution/fps).
int kbps_res = 0; // Min bitrate needed to adapt up in resolution.
int fps_diff = kNoFpsDiff; // Min fps reduction needed (input fps - |fps|)
int fps_diff = kNoFpsDiff; // Min fps reduction needed (input fps - `fps`)
// w/o triggering a new subsequent downgrade
// check.
CodecTypeSpecific vp8;
@ -111,20 +111,20 @@ class BalancedDegradationSettings {
// Returns configurations from field trial on success (default on failure).
std::vector<Config> GetConfigs() const;
// Gets the min/max framerate from |configs_| based on |pixels|.
// Gets the min/max framerate from `configs_` based on `pixels`.
int MinFps(VideoCodecType type, int pixels) const;
int MaxFps(VideoCodecType type, int pixels) const;
// Checks if quality can be increased based on |pixels| and |bitrate_bps|.
// Checks if quality can be increased based on `pixels` and `bitrate_bps`.
bool CanAdaptUp(VideoCodecType type, int pixels, uint32_t bitrate_bps) const;
bool CanAdaptUpResolution(VideoCodecType type,
int pixels,
uint32_t bitrate_bps) const;
// Gets the min framerate diff from |configs_| based on |pixels|.
// Gets the min framerate diff from `configs_` based on `pixels`.
absl::optional<int> MinFpsDiff(int pixels) const;
// Gets QpThresholds for the codec |type| based on |pixels|.
// Gets QpThresholds for the codec `type` based on `pixels`.
absl::optional<VideoEncoder::QpThresholds> GetQpThresholds(
VideoCodecType type,
int pixels) const;

View file

@ -32,7 +32,7 @@ class CpuSpeedExperiment {
// WebRTC-VP8-CpuSpeed-Arm/pixels:100|200|300,cpu_speed:-1|-2|-3/,
// cpu_speed_le_cores:-4|-5|-6,cores:3/
// If |num_cores| > 3
// If `num_cores` > 3
// pixels <= 100 -> cpu speed: -1
// pixels <= 200 -> cpu speed: -2
// pixels <= 300 -> cpu speed: -3
@ -43,20 +43,20 @@ class CpuSpeedExperiment {
struct Config {
int pixels = 0; // The video frame size.
int cpu_speed = 0; // The |cpu_speed| to be used if the frame size is less
// than or equal to |pixels|.
int cpu_speed = 0; // The `cpu_speed` to be used if the frame size is less
// than or equal to `pixels`.
// Optional.
int cpu_speed_le_cores = 0; // Same as |cpu_speed| above but only used if
// |num_cores| <= |cores_|.
int cpu_speed_le_cores = 0; // Same as `cpu_speed` above but only used if
// `num_cores` <= `cores_`.
};
// Gets the cpu speed based on |pixels| and |num_cores|.
// Gets the cpu speed based on `pixels` and `num_cores`.
absl::optional<int> GetValue(int pixels, int num_cores) const;
private:
std::vector<Config> configs_;
// Threshold for when to use |cpu_speed_le_cores|.
// Threshold for when to use `cpu_speed_le_cores`.
FieldTrialOptional<int> cores_;
};

View file

@ -26,11 +26,11 @@ class QualityRampupExperiment final {
absl::optional<double> MaxBitrateFactor() const;
// Sets the max bitrate and the frame size.
// The call has no effect if the frame size is less than |min_pixels_|.
// The call has no effect if the frame size is less than `min_pixels_`.
void SetMaxBitrate(int pixels, uint32_t max_bitrate_kbps);
// Returns true if the available bandwidth is a certain percentage
// (max_bitrate_factor_) above |max_bitrate_kbps_| for |min_duration_ms_|.
// (max_bitrate_factor_) above `max_bitrate_kbps_` for `min_duration_ms_`.
bool BwHigh(int64_t now_ms, uint32_t available_bw_kbps);
bool Enabled() const;

View file

@ -25,9 +25,9 @@ class QualityScalingExperiment {
int h264_high; // H264: high QP threshold.
int generic_low; // Generic: low QP threshold.
int generic_high; // Generic: high QP threshold.
float alpha_high; // |alpha_| for ExpFilter used when checking high QP.
float alpha_low; // |alpha_| for ExpFilter used when checking low QP.
int drop; // >0 sets |use_all_drop_reasons| to true.
float alpha_high; // `alpha_` for ExpFilter used when checking high QP.
float alpha_low; // `alpha_` for ExpFilter used when checking low QP.
int drop; // >0 sets `use_all_drop_reasons` to true.
};
// Used by QualityScaler.
@ -45,7 +45,7 @@ class QualityScalingExperiment {
// Returns settings from field trial.
static absl::optional<Settings> ParseSettings();
// Returns QpThresholds for the |codec_type|.
// Returns QpThresholds for the `codec_type`.
static absl::optional<VideoEncoder::QpThresholds> GetQpThresholds(
VideoCodecType codec_type);

View file

@ -41,7 +41,7 @@ const char kCallSessionLogPrefix[] = "webrtc_log";
std::string AddTrailingPathDelimiterIfNeeded(std::string directory);
// |dir| must have a trailing delimiter. |prefix| must not include wild card
// `dir` must have a trailing delimiter. `prefix` must not include wild card
// characters.
std::vector<std::string> GetFilesWithPrefix(const std::string& directory,
const std::string& prefix);
@ -291,7 +291,7 @@ void FileRotatingStream::CloseCurrentFile() {
void FileRotatingStream::RotateFiles() {
CloseCurrentFile();
// Rotates the files by deleting the file at |rotation_index_|, which is the
// Rotates the files by deleting the file at `rotation_index_`, which is the
// oldest file and then renaming the newer files to have an incremented index.
// See header file comments for example.
RTC_DCHECK_LT(rotation_index_, file_names_.size());

View file

@ -112,7 +112,7 @@ class FileRotatingStream {
// logs are most useful for call diagnostics.
//
// This implementation simply writes to a single file until
// |max_total_log_size| / 2 bytes are written to it, and subsequently writes to
// `max_total_log_size` / 2 bytes are written to it, and subsequently writes to
// a set of rotating files. We do this by inheriting FileRotatingStream and
// setting the appropriate internal variables so that we don't delete the last
// (earliest) file on rotate, and that that file's size is bigger.
@ -124,7 +124,7 @@ class FileRotatingStream {
class CallSessionFileRotatingStream : public FileRotatingStream {
public:
// Use this constructor for writing to a directory. Files in the directory
// matching what's used by the stream will be deleted. |max_total_log_size|
// matching what's used by the stream will be deleted. `max_total_log_size`
// must be at least 4.
CallSessionFileRotatingStream(const std::string& dir_path,
size_t max_total_log_size);

View file

@ -102,7 +102,7 @@ public class Logging {
@Deprecated
public static void enableTracing(String path, EnumSet<TraceLevel> levels) {}
// Enable diagnostic logging for messages of |severity| to the platform debug
// Enable diagnostic logging for messages of `severity` to the platform debug
// output. On Android, the output will be directed to Logcat.
// Note: this function starts collecting the output of the RTC_LOG() macros.
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.

View file

@ -145,7 +145,7 @@ public class ThreadUtils {
}
/**
* Post |callable| to |handler| and wait for the result.
* Post `callable` to `handler` and wait for the result.
*/
public static <V> V invokeAtFrontUninterruptibly(
final Handler handler, final Callable<V> callable) {
@ -190,7 +190,7 @@ public class ThreadUtils {
}
/**
* Post |runner| to |handler|, at the front, and wait for completion.
* Post `runner` to `handler`, at the front, and wait for completion.
*/
public static void invokeAtFrontUninterruptibly(final Handler handler, final Runnable runner) {
invokeAtFrontUninterruptibly(handler, new Callable<Void>() {

View file

@ -36,7 +36,7 @@ class RTC_EXPORT Location {
const char* file_name() const { return file_name_; }
int line_number() const { return line_number_; }
// TODO(steveanton): Remove once all downstream users have been updated to use
// |file_name()| and/or |line_number()|.
// `file_name()` and/or `line_number()`.
const char* file_and_line() const { return file_name_; }
std::string ToString() const;

View file

@ -26,7 +26,7 @@ namespace rtc {
// Init() must be called before adding this sink.
class FileRotatingLogSink : public LogSink {
public:
// |num_log_files| must be greater than 1 and |max_log_size| must be greater
// `num_log_files` must be greater than 1 and `max_log_size` must be greater
// than 0.
FileRotatingLogSink(const std::string& log_dir_path,
const std::string& log_prefix,

View file

@ -449,7 +449,7 @@ class LogMessage {
// which case the logging start time will be the time of the first LogMessage
// instance is created.
static int64_t LogStartTime();
// Returns the wall clock equivalent of |LogStartTime|, in seconds from the
// Returns the wall clock equivalent of `LogStartTime`, in seconds from the
// epoch.
static uint32_t WallClockStartTime();
// LogThreads: Display the thread identifier of the current thread
@ -463,14 +463,14 @@ class LogMessage {
// Sets whether logs will be directed to stderr in debug mode.
static void SetLogToStderr(bool log_to_stderr);
// Stream: Any non-blocking stream interface.
// Installs the |stream| to collect logs with severtiy |min_sev| or higher.
// |stream| must live until deinstalled by RemoveLogToStream.
// If |stream| is the first stream added to the system, we might miss some
// Installs the `stream` to collect logs with severtiy `min_sev` or higher.
// `stream` must live until deinstalled by RemoveLogToStream.
// If `stream` is the first stream added to the system, we might miss some
// early concurrent log statement happening from another thread happening near
// this instant.
static void AddLogToStream(LogSink* stream, LoggingSeverity min_sev);
// Removes the specified stream, without destroying it. When the method
// has completed, it's guaranteed that |stream| will receive no more logging
// has completed, it's guaranteed that `stream` will receive no more logging
// calls.
static void RemoveLogToStream(LogSink* stream);
// Returns the severity for the specified stream, of if none is specified,
@ -482,9 +482,9 @@ class LogMessage {
// Parses the provided parameter stream to configure the options above.
// Useful for configuring logging from the command line.
static void ConfigureLogging(const char* params);
// Checks the current global debug severity and if the |streams_| collection
// is empty. If |severity| is smaller than the global severity and if the
// |streams_| collection is empty, the LogMessage will be considered a noop
// Checks the current global debug severity and if the `streams_` collection
// is empty. If `severity` is smaller than the global severity and if the
// `streams_` collection is empty, the LogMessage will be considered a noop
// LogMessage.
static bool IsNoop(LoggingSeverity severity);
// Version of IsNoop that uses fewer instructions at the call site, since the
@ -573,7 +573,7 @@ class LogMessage {
// The output streams and their associated severities
static LogSink* streams_;
// Holds true with high probability if |streams_| is empty, false with high
// Holds true with high probability if `streams_` is empty, false with high
// probability otherwise. Operated on with std::memory_order_relaxed because
// it's ok to lose or log some additional statements near the instant streams
// are added/removed.

View file

@ -29,17 +29,17 @@ class MdnsResponderInterface {
MdnsResponderInterface() = default;
virtual ~MdnsResponderInterface() = default;
// Asynchronously creates and returns a new name via |callback| for |addr| if
// Asynchronously creates and returns a new name via `callback` for `addr` if
// there is no name mapped to it by this responder, and initializes the
// reference count of this name to one. Otherwise the existing name mapped to
// |addr| is returned and its reference count is incremented by one.
// `addr` is returned and its reference count is incremented by one.
virtual void CreateNameForAddress(const rtc::IPAddress& addr,
NameCreatedCallback callback) = 0;
// Decrements the reference count of the mapped name of |addr|, if
// Decrements the reference count of the mapped name of `addr`, if
// there is a map created previously via CreateNameForAddress; asynchronously
// removes the association between |addr| and its mapped name, and returns
// true via |callback| if the decremented reference count reaches zero.
// Otherwise no operation is done and false is returned via |callback|
// removes the association between `addr` and its mapped name, and returns
// true via `callback` if the decremented reference count reaches zero.
// Otherwise no operation is done and false is returned via `callback`
// asynchronously.
virtual void RemoveNameForAddress(const rtc::IPAddress& addr,
NameRemovedCallback callback) = 0;

View file

@ -26,7 +26,7 @@
namespace webrtc {
uintptr_t GetRightAlign(uintptr_t start_pos, size_t alignment) {
// The pointer should be aligned with |alignment| bytes. The - 1 guarantees
// The pointer should be aligned with `alignment` bytes. The - 1 guarantees
// that it is aligned towards the closest higher (right) address.
return (start_pos + alignment - 1) & ~(alignment - 1);
}

View file

@ -21,13 +21,13 @@
namespace webrtc {
// Returns a pointer to the first boundry of |alignment| bytes following the
// address of |ptr|.
// Returns a pointer to the first boundry of `alignment` bytes following the
// address of `ptr`.
// Note that there is no guarantee that the memory in question is available.
// |ptr| has no requirements other than it can't be NULL.
// `ptr` has no requirements other than it can't be NULL.
void* GetRightAlign(const void* ptr, size_t alignment);
// Allocates memory of |size| bytes aligned on an |alignment| boundry.
// Allocates memory of `size` bytes aligned on an `alignment` boundry.
// The return value is a pointer to the memory. Note that the memory must
// be de-allocated using AlignedFree.
void* AlignedMalloc(size_t size, size_t alignment);

View file

@ -22,7 +22,7 @@
namespace webrtc {
// Returns true if |size| and |alignment| are valid combinations.
// Returns true if `size` and `alignment` are valid combinations.
bool CorrectUsage(size_t size, size_t alignment) {
std::unique_ptr<char, AlignedFreeDeleter> scoped(
static_cast<char*>(AlignedMalloc(size, alignment)));

View file

@ -34,7 +34,7 @@ class FifoBuffer final : public StreamInterface {
// Resizes the buffer to the specified capacity. Fails if data_length_ > size
bool SetCapacity(size_t length);
// Read into |buffer| with an offset from the current read position, offset
// Read into `buffer` with an offset from the current read position, offset
// is specified in number of bytes.
// This method doesn't adjust read position nor the number of available
// bytes, user has to call ConsumeReadData() to do this.
@ -43,7 +43,7 @@ class FifoBuffer final : public StreamInterface {
size_t offset,
size_t* bytes_read);
// Write |buffer| with an offset from the current write position, offset is
// Write `buffer` with an offset from the current write position, offset is
// specified in number of bytes.
// This method doesn't adjust the number of buffered bytes, user has to call
// ConsumeWriteBuffer() to do this.

View file

@ -249,7 +249,7 @@ TEST(FifoBufferTest, WriteOffsetAndReadOffset) {
// Write 14 bytes.
EXPECT_EQ(SR_SUCCESS, buf.Write(in, 14, nullptr, nullptr));
// Make sure data is in |buf|.
// Make sure data is in `buf`.
size_t buffered;
EXPECT_TRUE(buf.GetBuffered(&buffered));
EXPECT_EQ(14u, buffered);

View file

@ -32,9 +32,9 @@ class MessageDigest {
virtual ~MessageDigest() {}
// Returns the digest output size (e.g. 16 bytes for MD5).
virtual size_t Size() const = 0;
// Updates the digest with |len| bytes from |buf|.
// Updates the digest with `len` bytes from `buf`.
virtual void Update(const void* buf, size_t len) = 0;
// Outputs the digest value to |buf| with length |len|.
// Outputs the digest value to `buf` with length `len`.
// Returns the number of bytes written, i.e., Size().
virtual size_t Finish(void* buf, size_t len) = 0;
};
@ -51,28 +51,28 @@ bool IsFips180DigestAlgorithm(const std::string& alg);
// Functions to create hashes.
// Computes the hash of |in_len| bytes of |input|, using the |digest| hash
// implementation, and outputs the hash to the buffer |output|, which is
// |out_len| bytes long. Returns the number of bytes written to |output| if
// successful, or 0 if |out_len| was too small.
// Computes the hash of `in_len` bytes of `input`, using the `digest` hash
// implementation, and outputs the hash to the buffer `output`, which is
// `out_len` bytes long. Returns the number of bytes written to `output` if
// successful, or 0 if `out_len` was too small.
size_t ComputeDigest(MessageDigest* digest,
const void* input,
size_t in_len,
void* output,
size_t out_len);
// Like the previous function, but creates a digest implementation based on
// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no
// the desired digest name `alg`, e.g. DIGEST_SHA_1. Returns 0 if there is no
// digest with the given name.
size_t ComputeDigest(const std::string& alg,
const void* input,
size_t in_len,
void* output,
size_t out_len);
// Computes the hash of |input| using the |digest| hash implementation, and
// Computes the hash of `input` using the `digest` hash implementation, and
// returns it as a hex-encoded string.
std::string ComputeDigest(MessageDigest* digest, const std::string& input);
// Like the previous function, but creates a digest implementation based on
// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if
// the desired digest name `alg`, e.g. DIGEST_SHA_1. Returns empty string if
// there is no digest with the given name.
std::string ComputeDigest(const std::string& alg, const std::string& input);
// Like the previous function, but returns an explicit result code.
@ -87,10 +87,10 @@ inline std::string MD5(const std::string& input) {
// Functions to compute RFC 2104 HMACs.
// Computes the HMAC of |in_len| bytes of |input|, using the |digest| hash
// implementation and |key_len| bytes of |key| to key the HMAC, and outputs
// the HMAC to the buffer |output|, which is |out_len| bytes long. Returns the
// number of bytes written to |output| if successful, or 0 if |out_len| was too
// Computes the HMAC of `in_len` bytes of `input`, using the `digest` hash
// implementation and `key_len` bytes of `key` to key the HMAC, and outputs
// the HMAC to the buffer `output`, which is `out_len` bytes long. Returns the
// number of bytes written to `output` if successful, or 0 if `out_len` was too
// small.
size_t ComputeHmac(MessageDigest* digest,
const void* key,
@ -100,7 +100,7 @@ size_t ComputeHmac(MessageDigest* digest,
void* output,
size_t out_len);
// Like the previous function, but creates a digest implementation based on
// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no
// the desired digest name `alg`, e.g. DIGEST_SHA_1. Returns 0 if there is no
// digest with the given name.
size_t ComputeHmac(const std::string& alg,
const void* key,
@ -109,13 +109,13 @@ size_t ComputeHmac(const std::string& alg,
size_t in_len,
void* output,
size_t out_len);
// Computes the HMAC of |input| using the |digest| hash implementation and |key|
// Computes the HMAC of `input` using the `digest` hash implementation and `key`
// to key the HMAC, and returns it as a hex-encoded string.
std::string ComputeHmac(MessageDigest* digest,
const std::string& key,
const std::string& input);
// Like the previous function, but creates a digest implementation based on
// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if
// the desired digest name `alg`, e.g. DIGEST_SHA_1. Returns empty string if
// there is no digest with the given name.
std::string ComputeHmac(const std::string& alg,
const std::string& key,

View file

@ -103,7 +103,7 @@ class NATSocket : public AsyncSocket, public sigslot::has_slots<> {
int Connect(const SocketAddress& addr) override {
int result = 0;
// If we're not already bound (meaning |socket_| is null), bind to ANY
// If we're not already bound (meaning `socket_` is null), bind to ANY
// address.
if (!socket_) {
result = BindInternal(SocketAddress(GetAnyIP(family_), 0));

View file

@ -398,20 +398,20 @@ void NetworkManagerBase::MergeNetworkList(const NetworkList& new_networks,
}
networks_map_[key]->set_mdns_responder_provider(this);
}
// It may still happen that the merged list is a subset of |networks_|.
// It may still happen that the merged list is a subset of `networks_`.
// To detect this change, we compare their sizes.
if (merged_list.size() != networks_.size()) {
*changed = true;
}
// If the network list changes, we re-assign |networks_| to the merged list
// If the network list changes, we re-assign `networks_` to the merged list
// and re-sort it.
if (*changed) {
networks_ = merged_list;
// Reset the active states of all networks.
for (const auto& kv : networks_map_) {
Network* network = kv.second;
// If |network| is in the newly generated |networks_|, it is active.
// If `network` is in the newly generated `networks_`, it is active.
bool found = absl::c_linear_search(networks_, network);
network->set_active(found);
}

View file

@ -175,14 +175,14 @@ class RTC_EXPORT NetworkManagerBase : public NetworkManager {
protected:
typedef std::map<std::string, Network*> NetworkMap;
// Updates |networks_| with the networks listed in |list|. If
// |network_map_| already has a Network object for a network listed
// in the |list| then it is reused. Accept ownership of the Network
// objects in the |list|. |changed| will be set to true if there is
// Updates `networks_` with the networks listed in `list`. If
// `network_map_` already has a Network object for a network listed
// in the `list` then it is reused. Accept ownership of the Network
// objects in the `list`. `changed` will be set to true if there is
// any change in the network list.
void MergeNetworkList(const NetworkList& list, bool* changed);
// |stats| will be populated even if |*changed| is false.
// `stats` will be populated even if |*changed| is false.
void MergeNetworkList(const NetworkList& list,
bool* changed,
NetworkManager::Stats* stats);
@ -353,7 +353,7 @@ class RTC_EXPORT Network {
// Returns the length, in bits, of this network's prefix.
int prefix_length() const { return prefix_length_; }
// |key_| has unique value per network interface. Used in sorting network
// `key_` has unique value per network interface. Used in sorting network
// interfaces. Key is derived from interface name and it's prefix.
std::string key() const { return key_; }

View file

@ -42,8 +42,8 @@ const char* NetworkPreferenceToString(NetworkPreference preference);
// where only the ip address is known at the time of binding.
class NetworkBinderInterface {
public:
// Binds a socket to the network that is attached to |address| so that all
// packets on the socket |socket_fd| will be sent via that network.
// Binds a socket to the network that is attached to `address` so that all
// packets on the socket `socket_fd` will be sent via that network.
// This is needed because some operating systems (like Android) require a
// special bind call to put packets on a non-default network interface.
virtual NetworkBindingResult BindSocketToNetwork(
@ -53,7 +53,7 @@ class NetworkBinderInterface {
};
/*
* Receives network-change events via |OnNetworksChanged| and signals the
* Receives network-change events via `OnNetworksChanged` and signals the
* networks changed event.
*
* Threading consideration:
@ -85,7 +85,7 @@ class NetworkMonitorInterface {
virtual NetworkPreference GetNetworkPreference(
const std::string& interface_name) = 0;
// Does |this| NetworkMonitorInterface implement BindSocketToNetwork?
// Does `this` NetworkMonitorInterface implement BindSocketToNetwork?
// Only Android returns true.
virtual bool SupportsBindSocketToNetwork() const { return false; }

View file

@ -24,9 +24,9 @@ constexpr double ninetyfive_percent_confidence = 1.96;
namespace rtc {
// |half_time| specifies how much weight will be given to old samples,
// `half_time` specifies how much weight will be given to old samples,
// a sample gets exponentially less weight so that it's 50%
// after |half_time| time units has passed.
// after `half_time` time units has passed.
EventBasedExponentialMovingAverage::EventBasedExponentialMovingAverage(
int half_time) {
SetHalfTime(half_time);

View file

@ -26,11 +26,11 @@ namespace rtc {
* https://en.wikipedia.org/wiki/Talk:Moving_average.
*
* A sample gets exponentially less weight so that it's 50%
* after |half_time| time units.
* after `half_time` time units.
*/
class EventBasedExponentialMovingAverage {
public:
// |half_time| specifies how much weight will be given to old samples,
// `half_time` specifies how much weight will be given to old samples,
// see example above.
explicit EventBasedExponentialMovingAverage(int half_time);

View file

@ -19,10 +19,10 @@ namespace webrtc {
// so it's mostly useful for end of call statistics.
class EventRateCounter {
public:
// Adds an event based on it's |event_time| for correct updates of the
// Adds an event based on it's `event_time` for correct updates of the
// interval statistics, each event must be added past the previous events.
void AddEvent(Timestamp event_time);
// Adds the events from |other|. Note that the interval stats won't be
// Adds the events from `other`. Note that the interval stats won't be
// recalculated, only merged, so this is not equivalent to if the events would
// have been added to the same counter from the start.
void AddEvents(EventRateCounter other);

View file

@ -25,7 +25,7 @@ class ExpFilter {
}
// Resets the filter to its initial state, and resets filter factor base to
// the given value |alpha|.
// the given value `alpha`.
void Reset(float alpha);
// Applies the filter with a given exponent on the provided sample:
@ -35,7 +35,7 @@ class ExpFilter {
// Returns current filtered value.
float filtered() const { return filtered_; }
// Changes the filter factor base to the given value |alpha|.
// Changes the filter factor base to the given value `alpha`.
void UpdateBase(float alpha);
private:

View file

@ -20,11 +20,11 @@
#include "absl/types/optional.h"
namespace rtc {
// Calculates percentiles on the stream of data. Use |Add| methods to add new
// values. Use |GetPercentile| to get percentile of the currently added values.
// Calculates percentiles on the stream of data. Use `Add` methods to add new
// values. Use `GetPercentile` to get percentile of the currently added values.
class HistogramPercentileCounter {
public:
// Values below |long_tail_boundary| are stored as the histogram in an array.
// Values below `long_tail_boundary` are stored as the histogram in an array.
// Values above - in a map.
explicit HistogramPercentileCounter(uint32_t long_tail_boundary);
~HistogramPercentileCounter();

View file

@ -23,7 +23,7 @@ TEST(HistogramPercentileCounterTest, ReturnsCorrectPercentiles) {
EXPECT_FALSE(counter.GetPercentile(0.5f));
// Pairs of {fraction, percentile value} computed by hand
// for |kTestValues|.
// for `kTestValues`.
const std::vector<std::pair<float, uint32_t>> kTestPercentiles = {
{0.0f, 1}, {0.01f, 1}, {0.5f, 10}, {0.9f, 18},
{0.95f, 19}, {0.99f, 20}, {1.0f, 20}};

View file

@ -18,7 +18,7 @@
namespace webrtc {
namespace webrtc_impl {
// Given two numbers |x| and |y| such that x >= y, computes the difference
// Given two numbers `x` and `y` such that x >= y, computes the difference
// x - y without causing undefined behavior due to signed overflow.
template <typename T>
typename std::make_unsigned<T>::type unsigned_difference(T x, T y) {

View file

@ -35,7 +35,7 @@ class MovingAverage {
// Adds new sample. If the window is full, the oldest element is pushed out.
void AddSample(int sample);
// Returns rounded down average of last |window_size| elements or all
// Returns rounded down average of last `window_size` elements or all
// elements if there are not enough of them. Returns nullopt if there were
// no elements added.
absl::optional<int> GetAverageRoundedDown() const;
@ -58,7 +58,7 @@ class MovingAverage {
// Sum of the samples in the moving window.
int64_t sum_ = 0;
// Circular buffer for all the samples in the moving window.
// Size is always |window_size|
// Size is always `window_size`
std::vector<int> history_;
};

View file

@ -27,8 +27,8 @@ namespace rtc {
// fixed moving window.
//
// Window size is configured at constructor.
// Samples can be added with |Add()| and max over current window is returned by
// |MovingMax|. |current_time_ms| in successive calls to Add and MovingMax
// Samples can be added with `Add()` and max over current window is returned by
// `MovingMax`. `current_time_ms` in successive calls to Add and MovingMax
// should never decrease as if it's a wallclock time.
template <class T>
class MovingMaxCounter {

View file

@ -26,8 +26,8 @@ namespace webrtc {
template <typename T>
class MovingMedianFilter {
public:
// Construct filter. |window_size| is how many latest samples are stored and
// used to take median. |window_size| must be positive.
// Construct filter. `window_size` is how many latest samples are stored and
// used to take median. `window_size` must be positive.
explicit MovingMedianFilter(size_t window_size);
// Insert a new sample.

View file

@ -26,14 +26,14 @@ namespace webrtc {
template <typename T>
class PercentileFilter {
public:
// Construct filter. |percentile| should be between 0 and 1.
// Construct filter. `percentile` should be between 0 and 1.
explicit PercentileFilter(float percentile);
// Insert one observation. The complexity of this operation is logarithmic in
// the size of the container.
void Insert(const T& value);
// Remove one observation or return false if |value| doesn't exist in the
// Remove one observation or return false if `value` doesn't exist in the
// container. The complexity of this operation is logarithmic in the size of
// the container.
bool Erase(const T& value);
@ -73,7 +73,7 @@ void PercentileFilter<T>::Insert(const T& value) {
percentile_it_ = set_.begin();
percentile_index_ = 0;
} else if (value < *percentile_it_) {
// If new element is before us, increment |percentile_index_|.
// If new element is before us, increment `percentile_index_`.
++percentile_index_;
}
UpdatePercentileIterator();
@ -91,7 +91,7 @@ bool PercentileFilter<T>::Erase(const T& value) {
percentile_it_ = set_.erase(it);
} else {
set_.erase(it);
// If erased element was before us, decrement |percentile_index_|.
// If erased element was before us, decrement `percentile_index_`.
if (value <= *percentile_it_)
--percentile_index_;
}

View file

@ -117,17 +117,17 @@ TEST_P(PercentileFilterTest, InsertAndEraseTenValuesInRandomOrder) {
// The percentile value of the ten values above.
const int64_t expected_value = static_cast<int64_t>(GetParam() * 9);
// Insert two sets of |zero_to_nine| in random order.
// Insert two sets of `zero_to_nine` in random order.
for (int i = 0; i < 2; ++i) {
absl::c_shuffle(zero_to_nine, std::mt19937(std::random_device()()));
for (int64_t value : zero_to_nine)
filter_.Insert(value);
// After inserting a full set of |zero_to_nine|, the percentile should
// After inserting a full set of `zero_to_nine`, the percentile should
// stay constant.
EXPECT_EQ(expected_value, filter_.GetPercentileValue());
}
// Insert and erase sets of |zero_to_nine| in random order a few times.
// Insert and erase sets of `zero_to_nine` in random order a few times.
for (int i = 0; i < 3; ++i) {
absl::c_shuffle(zero_to_nine, std::mt19937(std::random_device()()));
for (int64_t value : zero_to_nine)

View file

@ -29,8 +29,8 @@ class SampleCounter {
absl::optional<int64_t> Sum(int64_t min_required_samples) const;
int64_t NumSamples() const;
void Reset();
// Adds all the samples from the |other| SampleCounter as if they were all
// individually added using |Add(int)| method.
// Adds all the samples from the `other` SampleCounter as if they were all
// individually added using `Add(int)` method.
void Add(const SampleCounter& other);
protected:
@ -46,8 +46,8 @@ class SampleCounterWithVariance : public SampleCounter {
void Add(int sample);
absl::optional<int64_t> Variance(int64_t min_required_samples) const;
void Reset();
// Adds all the samples from the |other| SampleCounter as if they were all
// individually added using |Add(int)| method.
// Adds all the samples from the `other` SampleCounter as if they were all
// individually added using `Add(int)` method.
void Add(const SampleCounterWithVariance& other);
private:

View file

@ -22,9 +22,9 @@
namespace webrtc {
// Test if the sequence number |a| is ahead or at sequence number |b|.
// Test if the sequence number `a` is ahead or at sequence number `b`.
//
// If |M| is an even number and the two sequence numbers are at max distance
// If `M` is an even number and the two sequence numbers are at max distance
// from each other, then the sequence number with the highest value is
// considered to be ahead.
template <typename T, T M>
@ -52,9 +52,9 @@ inline bool AheadOrAt(T a, T b) {
return AheadOrAt<T, 0>(a, b);
}
// Test if the sequence number |a| is ahead of sequence number |b|.
// Test if the sequence number `a` is ahead of sequence number `b`.
//
// If |M| is an even number and the two sequence numbers are at max distance
// If `M` is an even number and the two sequence numbers are at max distance
// from each other, then the sequence number with the highest value is
// considered to be ahead.
template <typename T, T M = 0>

View file

@ -294,7 +294,7 @@ int OpenSSLAdapter::BeginSSL() {
// First set up the context. We should either have a factory, with its own
// pre-existing context, or be running standalone, in which case we will
// need to create one, and specify |false| to disable session caching.
// need to create one, and specify `false` to disable session caching.
if (ssl_session_cache_ == nullptr) {
RTC_DCHECK(!ssl_ctx_);
ssl_ctx_ = CreateContext(ssl_mode_, false);
@ -370,7 +370,7 @@ int OpenSSLAdapter::BeginSSL() {
SSL_set1_curves_list(ssl_, rtc::join(elliptic_curves_, ':').c_str());
}
// Now that the initial config is done, transfer ownership of |bio| to the
// Now that the initial config is done, transfer ownership of `bio` to the
// SSL object. If ContinueSSL() fails, the bio will be freed in Cleanup().
SSL_set_bio(ssl_, bio.get(), bio.get());
bio.release();

View file

@ -75,7 +75,7 @@ class OpenSSLAdapter final : public SSLAdapter,
ConnState GetState() const override;
bool IsResumedSession() override;
// Creates a new SSL_CTX object, configured for client-to-server usage
// with SSLMode |mode|, and if |enable_cache| is true, with support for
// with SSLMode `mode`, and if `enable_cache` is true, with support for
// storing successful sessions so that they can be later resumed.
// OpenSSLAdapterFactory will call this method to create its own internal
// SSL_CTX, and OpenSSLAdapter will also call this when used without a
@ -114,7 +114,7 @@ class OpenSSLAdapter final : public SSLAdapter,
void Error(const char* context, int err, bool signal = true);
void Cleanup();
// Return value and arguments have the same meanings as for Send; |error| is
// Return value and arguments have the same meanings as for Send; `error` is
// an output parameter filled with the result of SSL_get_error.
int DoSslWrite(const void* pv, size_t cb, int* error);
void OnMessage(Message* msg) override;
@ -136,7 +136,7 @@ class OpenSSLAdapter final : public SSLAdapter,
#endif
friend class OpenSSLStreamAdapter; // for custom_verify_callback_;
// If the SSL_CTX was created with |enable_cache| set to true, this callback
// If the SSL_CTX was created with `enable_cache` set to true, this callback
// will be called when a SSL session has been successfully established,
// to allow its SSL_SESSION* to be cached for later resumption.
static int NewSSLSessionCallback(SSL* ssl, SSL_SESSION* session);

View file

@ -23,14 +23,14 @@ namespace rtc {
// An implementation of the digest class that uses OpenSSL.
class OpenSSLDigest final : public MessageDigest {
public:
// Creates an OpenSSLDigest with |algorithm| as the hash algorithm.
// Creates an OpenSSLDigest with `algorithm` as the hash algorithm.
explicit OpenSSLDigest(const std::string& algorithm);
~OpenSSLDigest() override;
// Returns the digest output size (e.g. 16 bytes for MD5).
size_t Size() const override;
// Updates the digest with |len| bytes from |buf|.
// Updates the digest with `len` bytes from `buf`.
void Update(const void* buf, size_t len) override;
// Outputs the digest value to |buf| with length |len|.
// Outputs the digest value to `buf` with length `len`.
size_t Finish(void* buf, size_t len) override;
// Helper function to look up a digest's EVP by name.

View file

@ -57,7 +57,7 @@
namespace rtc {
namespace {
// SRTP cipher suite table. |internal_name| is used to construct a
// SRTP cipher suite table. `internal_name` is used to construct a
// colon-separated profile strings which is needed by
// SSL_CTX_set_tlsext_use_srtp().
struct SrtpCipherMapEntry {

View file

@ -63,9 +63,9 @@ class SSLCertChain;
///////////////////////////////////////////////////////////////////////////////
// If |allow| has a value, its value determines if legacy TLS protocols are
// If `allow` has a value, its value determines if legacy TLS protocols are
// allowed, overriding the default configuration.
// If |allow| has no value, any previous override is removed and the default
// If `allow` has no value, any previous override is removed and the default
// configuration is restored.
RTC_EXPORT void SetAllowLegacyTLSProtocols(const absl::optional<bool>& allow);
@ -169,7 +169,7 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter {
// raised on the stream with the specified error.
// A 0 error means a graceful close, otherwise there is not really enough
// context to interpret the error code.
// |alert| indicates an alert description (one of the SSL_AD constants) to
// `alert` indicates an alert description (one of the SSL_AD constants) to
// send to the remote endpoint when closing the association. If 0, a normal
// shutdown will be performed.
void Error(const char* context, int err, uint8_t alert, bool signal);

View file

@ -30,7 +30,7 @@ void OperationsChain::CallbackHandle::OnOperationComplete() {
has_run_ = true;
#endif // RTC_DCHECK_IS_ON
operations_chain_->OnOperationComplete();
// We have no reason to keep the |operations_chain_| alive through reference
// We have no reason to keep the `operations_chain_` alive through reference
// counting anymore.
operations_chain_ = nullptr;
}

View file

@ -40,8 +40,8 @@ class Operation {
virtual void Run() = 0;
};
// FunctorT is the same as in OperationsChain::ChainOperation(). |callback_| is
// passed on to the |functor_| and is used to inform the OperationsChain that
// FunctorT is the same as in OperationsChain::ChainOperation(). `callback_` is
// passed on to the `functor_` and is used to inform the OperationsChain that
// the operation completed. The functor is responsible for invoking the
// callback when the operation has completed.
template <typename FunctorT>
@ -63,13 +63,13 @@ class OperationWithFunctor final : public Operation {
has_run_ = true;
#endif // RTC_DCHECK_IS_ON
// The functor being executed may invoke the callback synchronously,
// marking the operation as complete. As such, |this| OperationWithFunctor
// object may get deleted here, including destroying |functor_|. To
// marking the operation as complete. As such, `this` OperationWithFunctor
// object may get deleted here, including destroying `functor_`. To
// protect the functor from self-destruction while running, it is moved to
// a local variable.
auto functor = std::move(functor_);
functor(std::move(callback_));
// |this| may now be deleted; don't touch any member variables.
// `this` may now be deleted; don't touch any member variables.
}
private:
@ -122,7 +122,7 @@ class OperationsChain final : public RefCountedObject<RefCountInterface> {
bool IsEmpty() const;
// Chains an operation. Chained operations are executed in FIFO order. The
// operation starts when |functor| is executed by the OperationsChain and is
// operation starts when `functor` is executed by the OperationsChain and is
// contractually obligated to invoke the callback passed to it when the
// operation is complete. Operations must start and complete on the same
// sequence that this method was invoked on.

View file

@ -78,8 +78,8 @@ class OperationTracker {
callback();
}
// This operation is completed asynchronously; it pings |background_thread_|,
// blocking that thread until |unblock_operation_event| is signaled and then
// This operation is completed asynchronously; it pings `background_thread_`,
// blocking that thread until `unblock_operation_event` is signaled and then
// completes upon posting back to the thread that the operation started on.
// Note that this requires the starting thread to be executing tasks (handle
// messages), i.e. must not be blocked.
@ -191,7 +191,7 @@ class OperationTrackerProxy {
return operation_complete_event;
}
// The order of completed events. Touches the |operation_tracker_| on the
// The order of completed events. Touches the `operation_tracker_` on the
// calling thread, this is only thread safe if all chained operations have
// completed.
const std::vector<Event*>& completed_operation_events() const {
@ -212,7 +212,7 @@ class SignalOnDestruction final {
RTC_DCHECK(destructor_called_);
}
~SignalOnDestruction() {
// Moved objects will have |destructor_called_| set to null. Destroying a
// Moved objects will have `destructor_called_` set to null. Destroying a
// moved SignalOnDestruction should not signal.
if (destructor_called_) {
*destructor_called_ = true;

View file

@ -711,7 +711,7 @@ bool SocketDispatcher::IsDescriptorClosed() {
if (udp_) {
// The MSG_PEEK trick doesn't work for UDP, since (at least in some
// circumstances) it requires reading an entire UDP packet, which would be
// bad for performance here. So, just check whether |s_| has been closed,
// bad for performance here. So, just check whether `s_` has been closed,
// which should be sufficient.
return s_ == INVALID_SOCKET;
}

View file

@ -50,12 +50,12 @@ class PlatformThread final {
// removed.
PlatformThread() = default;
// Moves |rhs| into this, storing an empty state in |rhs|.
// Moves `rhs` into this, storing an empty state in `rhs`.
// TODO(bugs.webrtc.org/12727) Look into if default and move support can be
// removed.
PlatformThread(PlatformThread&& rhs);
// Moves |rhs| into this, storing an empty state in |rhs|.
// Moves `rhs` into this, storing an empty state in `rhs`.
// TODO(bugs.webrtc.org/12727) Look into if default and move support can be
// removed.
PlatformThread& operator=(PlatformThread&& rhs);

View file

@ -47,7 +47,7 @@ class RateTracker {
// these samples, and increments the count for that bucket by sample_count.
void AddSamples(int64_t sample_count);
// Increment count for bucket at |current_time_ms|.
// Increment count for bucket at `current_time_ms`.
void AddSamplesAtTime(int64_t current_time_ms, int64_t sample_count);
protected:

View file

@ -20,7 +20,7 @@ namespace {
const double kLearningRate = 0.5;
// Add |n| samples drawn from uniform distribution in [a;b].
// Add `n` samples drawn from uniform distribution in [a;b].
void FillStatsFromUniformDistribution(RollingAccumulator<double>& stats,
int n,
double a,

View file

@ -53,13 +53,13 @@ class RTCCertificatePEM {
class RTC_EXPORT RTCCertificate final
: public RefCountedNonVirtual<RTCCertificate> {
public:
// Takes ownership of |identity|.
// Takes ownership of `identity`.
static scoped_refptr<RTCCertificate> Create(
std::unique_ptr<SSLIdentity> identity);
// Returns the expiration time in ms relative to epoch, 1970-01-01T00:00:00Z.
uint64_t Expires() const;
// Checks if the certificate has expired, where |now| is expressed in ms
// Checks if the certificate has expired, where `now` is expressed in ms
// relative to epoch, 1970-01-01T00:00:00Z.
bool HasExpired(uint64_t now) const;
@ -87,7 +87,7 @@ class RTC_EXPORT RTCCertificate final
private:
// The SSLIdentity is the owner of the SSLCertificate. To protect our
// GetSSLCertificate() we take ownership of |identity_|.
// GetSSLCertificate() we take ownership of `identity_`.
const std::unique_ptr<SSLIdentity> identity_;
};

View file

@ -47,11 +47,11 @@ scoped_refptr<RTCCertificate> RTCCertificateGenerator::GenerateCertificate(
uint64_t expires_s = *expires_ms / 1000;
// Limit the expiration time to something reasonable (a year). This was
// somewhat arbitrarily chosen. It also ensures that the value is not too
// large for the unspecified |time_t|.
// large for the unspecified `time_t`.
expires_s = std::min(expires_s, kYearInSeconds);
// TODO(torbjorng): Stop using |time_t|, its type is unspecified. It it safe
// TODO(torbjorng): Stop using `time_t`, its type is unspecified. It it safe
// to assume it can hold up to a year's worth of seconds (and more), but
// |SSLIdentity::Create| should stop relying on |time_t|.
// |SSLIdentity::Create| should stop relying on `time_t`.
// See bugs.webrtc.org/5720.
time_t cert_lifetime_s = static_cast<time_t>(expires_s);
identity = SSLIdentity::Create(kIdentityName, key_params, cert_lifetime_s);
@ -76,9 +76,9 @@ void RTCCertificateGenerator::GenerateCertificateAsync(
RTC_DCHECK(signaling_thread_->IsCurrent());
RTC_DCHECK(callback);
// Create a new |RTCCertificateGenerationTask| for this generation request. It
// Create a new `RTCCertificateGenerationTask` for this generation request. It
// is reference counted and referenced by the message data, ensuring it lives
// until the task has completed (independent of |RTCCertificateGenerator|).
// until the task has completed (independent of `RTCCertificateGenerator`).
worker_thread_->PostTask(RTC_FROM_HERE, [key_params, expires_ms,
signaling_thread = signaling_thread_,
cb = callback]() {

View file

@ -33,15 +33,15 @@ class RTCCertificateGeneratorCallback : public RefCountInterface {
~RTCCertificateGeneratorCallback() override {}
};
// Generates |RTCCertificate|s.
// See |RTCCertificateGenerator| for the WebRTC repo's implementation.
// Generates `RTCCertificate`s.
// See `RTCCertificateGenerator` for the WebRTC repo's implementation.
class RTCCertificateGeneratorInterface {
public:
virtual ~RTCCertificateGeneratorInterface() {}
// Generates a certificate asynchronously on the worker thread.
// Must be called on the signaling thread. The |callback| is invoked with the
// result on the signaling thread. |exipres_ms| optionally specifies for how
// Must be called on the signaling thread. The `callback` is invoked with the
// result on the signaling thread. `exipres_ms` optionally specifies for how
// long we want the certificate to be valid, but the implementation may choose
// its own restrictions on the expiration time.
virtual void GenerateCertificateAsync(
@ -50,17 +50,17 @@ class RTCCertificateGeneratorInterface {
const scoped_refptr<RTCCertificateGeneratorCallback>& callback) = 0;
};
// Standard implementation of |RTCCertificateGeneratorInterface|.
// The static function |GenerateCertificate| generates a certificate on the
// current thread. The |RTCCertificateGenerator| instance generates certificates
// asynchronously on the worker thread with |GenerateCertificateAsync|.
// Standard implementation of `RTCCertificateGeneratorInterface`.
// The static function `GenerateCertificate` generates a certificate on the
// current thread. The `RTCCertificateGenerator` instance generates certificates
// asynchronously on the worker thread with `GenerateCertificateAsync`.
class RTC_EXPORT RTCCertificateGenerator
: public RTCCertificateGeneratorInterface {
public:
// Generates a certificate on the current thread. Returns null on failure.
// If |expires_ms| is specified, the certificate will expire in approximately
// that many milliseconds from now. |expires_ms| is limited to a year, a
// larger value than that is clamped down to a year. If |expires_ms| is not
// If `expires_ms` is specified, the certificate will expire in approximately
// that many milliseconds from now. `expires_ms` is limited to a year, a
// larger value than that is clamped down to a year. If `expires_ms` is not
// specified, a default expiration time is used.
static scoped_refptr<RTCCertificate> GenerateCertificate(
const KeyParams& key_params,
@ -69,10 +69,10 @@ class RTC_EXPORT RTCCertificateGenerator
RTCCertificateGenerator(Thread* signaling_thread, Thread* worker_thread);
~RTCCertificateGenerator() override {}
// |RTCCertificateGeneratorInterface| overrides.
// If |expires_ms| is specified, the certificate will expire in approximately
// that many milliseconds from now. |expires_ms| is limited to a year, a
// larger value than that is clamped down to a year. If |expires_ms| is not
// `RTCCertificateGeneratorInterface` overrides.
// If `expires_ms` is specified, the certificate will expire in approximately
// that many milliseconds from now. `expires_ms` is limited to a year, a
// larger value than that is clamped down to a year. If `expires_ms` is not
// specified, a default expiration time is used.
void GenerateCertificateAsync(
const KeyParams& key_params,

View file

@ -94,7 +94,7 @@ TEST_F(RTCCertificateGeneratorTest, GenerateAsyncECDSA) {
absl::nullopt, fixture_);
// Until generation has completed, the certificate is null. Since this is an
// async call, generation must not have completed until we process messages
// posted to this thread (which is done by |EXPECT_TRUE_WAIT|).
// posted to this thread (which is done by `EXPECT_TRUE_WAIT`).
EXPECT_FALSE(fixture_->GenerateAsyncCompleted());
EXPECT_FALSE(fixture_->certificate());
EXPECT_TRUE_WAIT(fixture_->GenerateAsyncCompleted(), kGenerationTimeoutMs);
@ -120,7 +120,7 @@ TEST_F(RTCCertificateGeneratorTest, GenerateWithExpires) {
kExpiresMs);
EXPECT_TRUE(cert_b);
// Verify that |cert_b| expires approximately |kExpiresMs| after |cert_a|
// Verify that `cert_b` expires approximately `kExpiresMs` after `cert_a`
// (allowing a +/- 1 second plus maximum generation time difference).
EXPECT_GT(cert_b->Expires(), cert_a->Expires());
uint64_t expires_diff = cert_b->Expires() - cert_a->Expires();

View file

@ -62,7 +62,7 @@ class RTCCertificateTest : public ::testing::Test {
return cert->HasExpired(now_s * kNumMillisecsPerSec);
}
// An RTC_CHECK ensures that |expires_s| this is in valid range of time_t as
// An RTC_CHECK ensures that `expires_s` this is in valid range of time_t as
// is required by SSLIdentityParams. On some 32-bit systems time_t is limited
// to < 2^31. On such systems this will fail for expiration times of year 2038
// or later.

View file

@ -94,7 +94,7 @@ class Socket {
virtual int Connect(const SocketAddress& addr) = 0;
virtual int Send(const void* pv, size_t cb) = 0;
virtual int SendTo(const void* pv, size_t cb, const SocketAddress& addr) = 0;
// |timestamp| is in units of microseconds.
// `timestamp` is in units of microseconds.
virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0;
virtual int RecvFrom(void* pv,
size_t cb,

View file

@ -69,7 +69,7 @@ class SSLAdapter : public AsyncSocketAdapter {
virtual void SetCertVerifier(SSLCertificateVerifier* ssl_cert_verifier) = 0;
// Set the certificate this socket will present to incoming clients.
// Takes ownership of |identity|.
// Takes ownership of `identity`.
virtual void SetIdentity(std::unique_ptr<SSLIdentity> identity) = 0;
// Choose whether the socket acts as a server socket or client socket.
@ -88,8 +88,8 @@ class SSLAdapter : public AsyncSocketAdapter {
virtual bool IsResumedSession() = 0;
// Create the default SSL adapter for this platform. On failure, returns null
// and deletes |socket|. Otherwise, the returned SSLAdapter takes ownership
// of |socket|.
// and deletes `socket`. Otherwise, the returned SSLAdapter takes ownership
// of `socket`.
static SSLAdapter* Create(AsyncSocket* socket);
};

View file

@ -103,12 +103,12 @@ std::unique_ptr<SSLCertChain> SSLCertChain::Clone() const {
std::unique_ptr<SSLCertificateStats> SSLCertChain::GetStats() const {
// We have a linked list of certificates, starting with the first element of
// |certs_| and ending with the last element of |certs_|. The "issuer" of a
// `certs_` and ending with the last element of `certs_`. The "issuer" of a
// certificate is the next certificate in the chain. Stats are produced for
// each certificate in the list. Here, the "issuer" is the issuer's stats.
std::unique_ptr<SSLCertificateStats> issuer;
// The loop runs in reverse so that the |issuer| is known before the
// certificate issued by |issuer|.
// The loop runs in reverse so that the `issuer` is known before the
// certificate issued by `issuer`.
for (ptrdiff_t i = certs_.size() - 1; i >= 0; --i) {
std::unique_ptr<SSLCertificateStats> new_stats = certs_[i]->GetStats();
if (new_stats) {

View file

@ -33,8 +33,8 @@ namespace rtc {
//////////////////////////////////////////////////////////////////////
namespace {
// Read |n| bytes from ASN1 number string at *|pp| and return the numeric value.
// Update *|pp| and *|np| to reflect number of read bytes.
// Read `n` bytes from ASN1 number string at *`pp` and return the numeric value.
// Update *`pp` and *`np` to reflect number of read bytes.
// TODO(bugs.webrtc.org/9860) - Remove this code.
inline int ASN1ReadInt(const unsigned char** pp, size_t* np, size_t n) {
const unsigned char* p = *pp;
@ -87,7 +87,7 @@ int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format) {
}
}
// Read out remaining ASN1 time data and store it in |tm| in documented
// Read out remaining ASN1 time data and store it in `tm` in documented
// std::tm format.
tm tm;
tm.tm_year = year;

View file

@ -85,7 +85,7 @@ class RTC_EXPORT KeyParams {
// appropriately we can change KeyType enum -> class without breaking Chromium.
KeyType IntKeyTypeFamilyToKeyType(int key_type_family);
// Parameters for generating a certificate. If |common_name| is non-empty, it
// Parameters for generating a certificate. If `common_name` is non-empty, it
// will be used for the certificate's subject and issuer name, otherwise a
// random string will be used.
struct SSLIdentityParams {
@ -101,10 +101,10 @@ struct SSLIdentityParams {
class RTC_EXPORT SSLIdentity {
public:
// Generates an identity (keypair and self-signed certificate). If
// |common_name| is non-empty, it will be used for the certificate's subject
// `common_name` is non-empty, it will be used for the certificate's subject
// and issuer name, otherwise a random string will be used. The key type and
// parameters are defined in |key_param|. The certificate's lifetime in
// seconds from the current time is defined in |certificate_lifetime|; it
// parameters are defined in `key_param`. The certificate's lifetime in
// seconds from the current time is defined in `certificate_lifetime`; it
// should be a non-negative number.
// Returns null on failure.
// Caller is responsible for freeing the returned object.
@ -160,7 +160,7 @@ bool operator!=(const SSLIdentity& a, const SSLIdentity& b);
// Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01
// 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at
// |s| is not 0-terminated; its char count is defined by |length|.
// `s` is not 0-terminated; its char count is defined by `length`.
int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format);
extern const char kPemTypeCertificate[];

View file

@ -298,7 +298,7 @@ class SSLIdentityTest : public ::testing::Test {
}
void TestCloningIdentity(const SSLIdentity& identity) {
// Convert |identity| to PEM strings and create a new identity by converting
// Convert `identity` to PEM strings and create a new identity by converting
// back from the string format.
std::string priv_pem = identity.PrivateKeyToPEMString();
std::string publ_pem = identity.PublicKeyToPEMString();

View file

@ -200,7 +200,7 @@ class SSLStreamAdapter : public StreamInterface, public sigslot::has_slots<> {
// certificate, not just a CA. SSLStream makes a copy of the digest value.
//
// Returns true if successful.
// |error| is optional and provides more information about the failure.
// `error` is optional and provides more information about the failure.
virtual bool SetPeerCertificateDigest(
const std::string& digest_alg,
const unsigned char* digest_val,

View file

@ -378,7 +378,7 @@ class SSLStreamAdapterTestBase : public ::testing::Test,
virtual void CreateStreams() = 0;
// Recreate the client/server identities with the specified validity period.
// |not_before| and |not_after| are offsets from the current time in number
// `not_before` and `not_after` are offsets from the current time in number
// of seconds.
void ResetIdentitiesWithValidity(int not_before, int not_after) {
CreateStreams();

View file

@ -49,7 +49,7 @@ size_t hex_encode_output_length(size_t srclen, char delimiter) {
}
// hex_encode shows the hex representation of binary data in ascii, with
// |delimiter| between bytes, or none if |delimiter| == 0.
// `delimiter` between bytes, or none if `delimiter` == 0.
void hex_encode_with_delimiter(char* buffer,
const char* csource,
size_t srclen,

View file

@ -41,7 +41,7 @@ size_t hex_decode(char* buffer,
// hex_decode, assuming that there is a delimiter between every byte
// pair.
// |delimiter| == 0 means no delimiter
// `delimiter` == 0 means no delimiter
// If the buffer is too short or the data is invalid, we return 0.
size_t hex_decode_with_delimiter(char* buffer,
size_t buflen,

View file

@ -25,7 +25,7 @@ namespace rtc {
// when you might otherwise be tempted to use a stringstream (discouraged for
// anything except logging). It uses a fixed-size buffer provided by the caller
// and concatenates strings and numbers into it, allowing the results to be
// read via |str()|.
// read via `str()`.
class SimpleStringBuilder {
public:
explicit SimpleStringBuilder(rtc::ArrayView<char> buffer);
@ -45,12 +45,12 @@ class SimpleStringBuilder {
SimpleStringBuilder& operator<<(double f);
SimpleStringBuilder& operator<<(long double f);
// Returns a pointer to the built string. The name |str()| is borrowed for
// Returns a pointer to the built string. The name `str()` is borrowed for
// compatibility reasons as we replace usage of stringstream throughout the
// code base.
const char* str() const { return buffer_.data(); }
// Returns the length of the string. The name |size()| is picked for STL
// Returns the length of the string. The name `size()` is picked for STL
// compatibility reasons.
size_t size() const { return size_; }

View file

@ -113,7 +113,7 @@ class LockRunner : public rtc::MessageHandlerAutoCleanup {
EXPECT_EQ(0, shared_value_);
int old = shared_value_;
// Use a loop to increase the chance of race. If the |locker_|
// Use a loop to increase the chance of race. If the `locker_`
// implementation is faulty, it would be improbable that the error slips
// through.
for (int i = 0; i < kOperationsToRun; ++i) {

View file

@ -32,7 +32,7 @@ class FileWrapper final {
public:
// Opens a file, in read or write mode. Use the is_open() method on the
// returned object to check if the open operation was successful. On failure,
// and if |error| is non-null, the system errno value is stored at |*error|.
// and if `error` is non-null, the system errno value is stored at |*error|.
// The file is closed by the destructor.
static FileWrapper OpenReadOnly(const char* file_name_utf8);
static FileWrapper OpenReadOnly(const std::string& file_name_utf8);
@ -43,8 +43,8 @@ class FileWrapper final {
FileWrapper() = default;
// Takes over ownership of |file|, closing it on destruction. Calling with
// null |file| is allowed, and results in a FileWrapper with is_open() false.
// Takes over ownership of `file`, closing it on destruction. Calling with
// null `file` is allowed, and results in a FileWrapper with is_open() false.
explicit FileWrapper(FILE* file) : file_(file) {}
~FileWrapper() { Close(); }

View file

@ -49,7 +49,7 @@ class RTC_LOCKABLE TaskQueueForTest : public rtc::TaskQueue {
// a task executes on the task queue.
// This variant is specifically for posting custom QueuedTask derived
// implementations that tests do not want to pass ownership of over to the
// task queue (i.e. the Run() method always returns |false|.).
// task queue (i.e. the Run() method always returns `false`.).
template <class Closure>
void SendTask(Closure* task) {
RTC_CHECK(!IsCurrent());

View file

@ -281,7 +281,7 @@ void TaskQueueLibevent::OnWakeup(int socket,
if (task->Run()) {
task.reset();
} else {
// |false| means the task should *not* be deleted.
// `false` means the task should *not* be deleted.
task.release();
}
}

View file

@ -102,13 +102,13 @@ class DelayedTaskInfo {
private:
int64_t due_time_ = 0; // Absolute timestamp in milliseconds.
// |task| needs to be mutable because std::priority_queue::top() returns
// `task` needs to be mutable because std::priority_queue::top() returns
// a const reference and a key in an ordered queue must not be changed.
// There are two basic workarounds, one using const_cast, which would also
// make the key (|due_time|), non-const and the other is to make the non-key
// (|task|), mutable.
// Because of this, the |task| variable is made private and can only be
// mutated by calling the |Run()| method.
// make the key (`due_time`), non-const and the other is to make the non-key
// (`task`), mutable.
// Because of this, the `task` variable is made private and can only be
// mutated by calling the `Run()` method.
mutable std::unique_ptr<QueuedTask> task_;
};

View file

@ -30,8 +30,8 @@ namespace webrtc {
// Typical usage:
// When posting a task, post a copy (capture by-value in a lambda) of the flag
// reference and before performing the work, check the |alive()| state. Abort if
// alive() returns |false|:
// reference and before performing the work, check the `alive()` state. Abort if
// alive() returns `false`:
//
// class ExampleClass {
// ....

View file

@ -31,7 +31,7 @@ using ::testing::Return;
TEST(PendingTaskSafetyFlagTest, Basic) {
rtc::scoped_refptr<PendingTaskSafetyFlag> safety_flag;
{
// Scope for the |owner| instance.
// Scope for the `owner` instance.
class Owner {
public:
Owner() = default;
@ -44,7 +44,7 @@ TEST(PendingTaskSafetyFlagTest, Basic) {
safety_flag = owner.flag_;
EXPECT_TRUE(safety_flag->alive());
}
// |owner| now out of scope.
// `owner` now out of scope.
EXPECT_FALSE(safety_flag->alive());
}
@ -57,7 +57,7 @@ TEST(PendingTaskSafetyFlagTest, BasicScoped) {
safety_flag = owner.safety.flag();
EXPECT_TRUE(safety_flag->alive());
}
// |owner| now out of scope.
// `owner` now out of scope.
EXPECT_FALSE(safety_flag->alive());
}
@ -142,7 +142,7 @@ TEST(PendingTaskSafetyFlagTest, PendingTaskDropped) {
RTC_FROM_HERE);
ASSERT_TRUE(owner);
// Queue up a task on tq1 that will execute before the 'DoStuff' task
// can, and delete the |owner| before the 'stuff' task can execute.
// can, and delete the `owner` before the 'stuff' task can execute.
rtc::Event blocker;
tq1.PostTask([&blocker, &owner]() {
blocker.Wait(rtc::Event::kForever);

View file

@ -131,7 +131,7 @@ TEST(ToQueuedTaskTest, PendingTaskSafetyFlag) {
PendingTaskSafetyFlag::Create();
int count = 0;
// Create two identical tasks that increment the |count|.
// Create two identical tasks that increment the `count`.
auto task1 = ToQueuedTask(flag, [&count]() { ++count; });
auto task2 = ToQueuedTask(flag, [&count]() { ++count; });

View file

@ -46,11 +46,11 @@ class Base64 {
static bool IsBase64Char(char ch);
// Get the char next to the |ch| from the Base64Table.
// If the |ch| is the last one in the Base64Table then returns
// Get the char next to the `ch` from the Base64Table.
// If the `ch` is the last one in the Base64Table then returns
// the first one from the table.
// Expects the |ch| be a base64 char.
// The result will be saved in |next_ch|.
// Expects the `ch` be a base64 char.
// The result will be saved in `next_ch`.
// Returns true on success.
static bool GetNextBase64Char(char ch, char* next_ch);

View file

@ -1080,7 +1080,7 @@ uint32_t Thread::GetCouldBeBlockingCallCount() const {
#endif
// Returns true if no policies added or if there is at least one policy
// that permits invocation to |target| thread.
// that permits invocation to `target` thread.
bool Thread::IsInvokeToThreadAllowed(rtc::Thread* target) {
#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON))
RTC_DCHECK_RUN_ON(this);

View file

@ -141,8 +141,8 @@ class RTC_EXPORT ThreadManager {
bool IsMainThread();
#if RTC_DCHECK_IS_ON
// Registers that a Send operation is to be performed between |source| and
// |target|, while checking that this does not cause a send cycle that could
// Registers that a Send operation is to be performed between `source` and
// `target`, while checking that this does not cause a send cycle that could
// potentially cause a deadlock.
void RegisterSendAndCheckForCycles(Thread* source, Thread* target);
#endif
@ -204,7 +204,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
explicit Thread(std::unique_ptr<SocketServer> ss);
// Constructors meant for subclasses; they should call DoInit themselves and
// pass false for |do_init|, so that DoInit is called only on the fully
// pass false for `do_init`, so that DoInit is called only on the fully
// instantiated class, which avoids a vptr data race.
Thread(SocketServer* ss, bool do_init);
Thread(std::unique_ptr<SocketServer> ss, bool do_init);
@ -298,7 +298,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
int cmsWait = kForever,
bool process_io = true);
virtual bool Peek(Message* pmsg, int cmsWait = 0);
// |time_sensitive| is deprecated and should always be false.
// `time_sensitive` is deprecated and should always be false.
virtual void Post(const Location& posted_from,
MessageHandler* phandler,
uint32_t id = 0,
@ -344,7 +344,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
static bool SleepMs(int millis);
// Sets the thread's name, for debugging. Must be called before Start().
// If |obj| is non-null, its value is appended to |name|.
// If `obj` is non-null, its value is appended to `name`.
const std::string& name() const { return name_; }
bool SetName(const std::string& name, const void* obj);
@ -373,7 +373,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
MessageData* pdata = nullptr);
// Convenience method to invoke a functor on another thread. Caller must
// provide the |ReturnT| template argument, which cannot (easily) be deduced.
// provide the `ReturnT` template argument, which cannot (easily) be deduced.
// Uses Send() internally, which blocks the current thread until execution
// is complete.
// Ex: bool result = thread.Invoke<bool>(RTC_FROM_HERE,
@ -398,7 +398,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
InvokeInternal(posted_from, functor);
}
// Allows invoke to specified |thread|. Thread never will be dereferenced and
// Allows invoke to specified `thread`. Thread never will be dereferenced and
// will be used only for reference-based comparison, so instance can be safely
// deleted. If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do
// nothing.
@ -406,27 +406,27 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
// If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do nothing.
void DisallowAllInvokes();
// Returns true if |target| was allowed by AllowInvokesToThread() or if no
// Returns true if `target` was allowed by AllowInvokesToThread() or if no
// calls were made to AllowInvokesToThread and DisallowAllInvokes. Otherwise
// returns false.
// If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined always returns
// true.
bool IsInvokeToThreadAllowed(rtc::Thread* target);
// Posts a task to invoke the functor on |this| thread asynchronously, i.e.
// without blocking the thread that invoked PostTask(). Ownership of |functor|
// is passed and (usually, see below) destroyed on |this| thread after it is
// Posts a task to invoke the functor on `this` thread asynchronously, i.e.
// without blocking the thread that invoked PostTask(). Ownership of `functor`
// is passed and (usually, see below) destroyed on `this` thread after it is
// invoked.
// Requirements of FunctorT:
// - FunctorT is movable.
// - FunctorT implements "T operator()()" or "T operator()() const" for some T
// (if T is not void, the return value is discarded on |this| thread).
// - FunctorT has a public destructor that can be invoked from |this| thread
// (if T is not void, the return value is discarded on `this` thread).
// - FunctorT has a public destructor that can be invoked from `this` thread
// after operation() has been invoked.
// - The functor must not cause the thread to quit before PostTask() is done.
//
// Destruction of the functor/task mimics what TaskQueue::PostTask does: If
// the task is run, it will be destroyed on |this| thread. However, if there
// the task is run, it will be destroyed on `this` thread. However, if there
// are pending tasks by the time the Thread is destroyed, or a task is posted
// to a thread that is quitting, the task is destroyed immediately, on the
// calling thread. Destroying the Thread only blocks for any currently running
@ -612,7 +612,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
// ThreadManager::Instance() cannot be used while ThreadManager is
// being created.
// The method tries to get synchronization rights of the thread on Windows if
// |need_synchronize_access| is true.
// `need_synchronize_access` is true.
bool WrapCurrentWithThreadManager(ThreadManager* thread_manager,
bool need_synchronize_access);
@ -651,7 +651,7 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
// The SocketServer might not be owned by Thread.
SocketServer* const ss_;
// Used if SocketServer ownership lies with |this|.
// Used if SocketServer ownership lies with `this`.
std::unique_ptr<SocketServer> own_ss_;
std::string name_;

View file

@ -511,7 +511,7 @@ TEST(ThreadTest, ThreeThreadsInvoke) {
thread->Invoke<void>(RTC_FROM_HERE, [out] { Set(out); });
}
// Set |out| true and call InvokeSet on |thread|.
// Set `out` true and call InvokeSet on `thread`.
static void SetAndInvokeSet(LockedBool* out,
Thread* thread,
LockedBool* out_inner) {
@ -519,8 +519,8 @@ TEST(ThreadTest, ThreeThreadsInvoke) {
InvokeSet(thread, out_inner);
}
// Asynchronously invoke SetAndInvokeSet on |thread1| and wait until
// |thread1| starts the call.
// Asynchronously invoke SetAndInvokeSet on `thread1` and wait until
// `thread1` starts the call.
static void AsyncInvokeSetAndWait(DEPRECATED_AsyncInvoker* invoker,
Thread* thread1,
Thread* thread2,
@ -842,8 +842,8 @@ TEST_F(AsyncInvokeTest, KillInvokerDuringExecuteWithReentrantInvoke) {
Thread::Current()->SleepMs(kWaitTimeout);
invoker.AsyncInvoke<void>(RTC_FROM_HERE, main, reentrant_functor);
};
// This queues a task on |thread| to sleep for |kWaitTimeout| then queue a
// task on |main|. But this second queued task should never run, since the
// This queues a task on `thread` to sleep for `kWaitTimeout` then queue a
// task on `main`. But this second queued task should never run, since the
// destructor will be entered before it's even invoked.
invoker.AsyncInvoke<void>(RTC_FROM_HERE, &thread, functor);
functor_started.Wait(Event::kForever);

View file

@ -232,11 +232,11 @@ int64_t TmToSeconds(const tm& tm) {
// We will have added one day too much above if expiration is during a leap
// year, and expiration is in January or February.
if (expiry_in_leap_year && month <= 2 - 1) // |month| is zero based.
if (expiry_in_leap_year && month <= 2 - 1) // `month` is zero based.
day -= 1;
// Combine all variables into seconds from 1970-01-01 00:00 (except |month|
// which was accumulated into |day| above).
// Combine all variables into seconds from 1970-01-01 00:00 (except `month`
// which was accumulated into `day` above).
return (((static_cast<int64_t>(year - 1970) * 365 + day) * 24 + hour) * 60 +
min) *
60 +

View file

@ -88,7 +88,7 @@ int64_t TimestampAligner::UpdateOffset(int64_t capturer_time_us,
// offset, the filter is reset. This could happen, e.g., if the
// capturer's clock is reset, cameras are plugged in and out, or
// the application process is temporarily suspended. Expected to
// happen for the very first timestamp (|frames_seen_| = 0). The
// happen for the very first timestamp (`frames_seen_` = 0). The
// threshold of 300 ms should make this unlikely in normal
// operation, and at the same time, converging gradually rather than
// resetting the filter should be tolerable for jumps in capturer's time
@ -124,10 +124,10 @@ int64_t TimestampAligner::ClipTimestamp(int64_t filtered_time_us,
time_us = prev_translated_time_us_ + kMinFrameIntervalUs;
if (time_us > system_time_us) {
// In the anomalous case that this function is called with values of
// |system_time_us| less than |kMinFrameIntervalUs| apart, we may output
// `system_time_us` less than `kMinFrameIntervalUs` apart, we may output
// timestamps with with too short inter-frame interval. We may even return
// duplicate timestamps in case this function is called several times with
// exactly the same |system_time_us|.
// exactly the same `system_time_us`.
RTC_LOG(LS_WARNING) << "too short translated timestamp interval: "
"system time (us) = "
<< system_time_us << ", interval (us) = "

View file

@ -37,8 +37,8 @@ class RTC_EXPORT TimestampAligner {
public:
// Translates timestamps of a capture system to the same timescale as is used
// by rtc::TimeMicros(). |capturer_time_us| is assumed to be accurate, but
// with an unknown epoch and clock drift. |system_time_us| is
// by rtc::TimeMicros(). `capturer_time_us` is assumed to be accurate, but
// with an unknown epoch and clock drift. `system_time_us` is
// time according to rtc::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
@ -56,9 +56,9 @@ class RTC_EXPORT TimestampAligner {
int64_t UpdateOffset(int64_t capturer_time_us, int64_t system_time_us);
// Clip timestamp, return value is always
// <= |system_time_us|, and
// >= min(|prev_translated_time_us_| + |kMinFrameIntervalUs|,
// |system_time_us|).
// <= `system_time_us`, and
// >= min(`prev_translated_time_us_` + `kMinFrameIntervalUs`,
// `system_time_us`).
int64_t ClipTimestamp(int64_t filtered_time_us, int64_t system_time_us);
private:
@ -69,12 +69,12 @@ class RTC_EXPORT TimestampAligner {
// State for the ClipTimestamp method, applied after the filter.
// A large negative clock drift of the capturer tends to push translated
// timestamps into the future. |clip_bias_us_| is subtracted from the
// timestamps into the future. `clip_bias_us_` is subtracted from the
// translated timestamps, to get them back from the future.
int64_t clip_bias_us_;
// Used to ensure that translated timestamps are monotonous.
int64_t prev_translated_time_us_;
// Offset between |prev_translated_time_us_| and the corresponding capturer
// Offset between `prev_translated_time_us_` and the corresponding capturer
// time.
int64_t prev_time_offset_us_;
RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner);

View file

@ -23,8 +23,8 @@ namespace rtc {
namespace {
// Computes the difference x_k - mean(x), when x_k is the linear sequence x_k =
// k, and the "mean" is plain mean for the first |window_size| samples, followed
// by exponential averaging with weight 1 / |window_size| for each new sample.
// k, and the "mean" is plain mean for the first `window_size` samples, followed
// by exponential averaging with weight 1 / `window_size` for each new sample.
// This is needed to predict the effect of camera clock drift on the timestamp
// translation. See the comment on TimestampAligner::UpdateOffset for more
// context.
@ -160,7 +160,7 @@ TEST(TimestampAlignerTest, ClipToMonotonous) {
// translated timestamps in the future. Which is tolerated if
// |timestamp_aligner.clip_bias_us| is large enough. Instead of
// changing that private member for this test, just add the bias to
// |kSystemTimeUs| when calling ClipTimestamp.
// `kSystemTimeUs` when calling ClipTimestamp.
const int64_t kClipBiasUs = 100000;
bool did_clip = false;

View file

@ -136,10 +136,10 @@
// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
// free(str); // Trace system now has dangling pointer
//
// To avoid this issue with the |name| and |arg_name| parameters, use the
// To avoid this issue with the `name` and `arg_name` parameters, use the
// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime overhead.
// Notes: The category must always be in a long-lived char* (i.e. static const).
// The |arg_values|, when used, are always deep copied with the _COPY
// The `arg_values`, when used, are always deep copied with the _COPY
// macros.
//
// When are string argument values copied:
@ -303,7 +303,7 @@
// must be representable as a 32 bit integer.
// - category and name strings must have application lifetime (statics or
// literals). They may not include " chars.
// - |id| is used to disambiguate counters with the same name. It must either
// - `id` is used to disambiguate counters with the same name. It must either
// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits
// will be xored with a hash of the process ID so that the same pointer on
// two different processes will not collide.
@ -321,7 +321,7 @@
// values as a stacked-bar chart.
// - category and name strings must have application lifetime (statics or
// literals). They may not include " chars.
// - |id| is used to disambiguate counters with the same name. It must either
// - `id` is used to disambiguate counters with the same name. It must either
// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits
// will be xored with a hash of the process ID so that the same pointer on
// two different processes will not collide.
@ -344,9 +344,9 @@
// does nothing.
// - category and name strings must have application lifetime (statics or
// literals). They may not include " chars.
// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC
// - `id` is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC
// events are considered to match if their category, name and id values all
// match. |id| must either be a pointer or an integer value up to 64 bits. If
// match. `id` must either be a pointer or an integer value up to 64 bits. If
// it's a pointer, the bits will be xored with a hash of the process ID so
// that the same pointer on two different processes will not collide.
// An asynchronous operation can consist of multiple phases. The first phase is
@ -354,7 +354,7 @@
// ASYNC_STEP macros. When the operation completes, call ASYNC_END.
// An ASYNC trace typically occur on a single thread (if not, they will only be
// drawn on the thread defined in the ASYNC_BEGIN event), but all events in that
// operation must use the same |name| and |id|. Each event can have its own
// operation must use the same `name` and `id`. Each event can have its own
// args.
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
@ -380,9 +380,9 @@
category, name, id, TRACE_EVENT_FLAG_COPY, \
arg1_name, arg1_val, arg2_name, arg2_val)
// Records a single ASYNC_STEP event for |step| immediately. If the category
// is not enabled, then this does nothing. The |name| and |id| must match the
// ASYNC_BEGIN event above. The |step| param identifies this step within the
// Records a single ASYNC_STEP event for `step` immediately. If the category
// is not enabled, then this does nothing. The `name` and `id` must match the
// ASYNC_BEGIN event above. The `step` param identifies this step within the
// async event. This should be called at the beginning of the next phase of an
// asynchronous operation.
#define TRACE_EVENT_ASYNC_STEP0(category, name, id, step) \
@ -434,9 +434,9 @@
// does nothing.
// - category and name strings must have application lifetime (statics or
// literals). They may not include " chars.
// - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW
// - `id` is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW
// events are considered to match if their category, name and id values all
// match. |id| must either be a pointer or an integer value up to 64 bits. If
// match. `id` must either be a pointer or an integer value up to 64 bits. If
// it's a pointer, the bits will be xored with a hash of the process ID so
// that the same pointer on two different processes will not collide.
// FLOW events are different from ASYNC events in how they are drawn by the
@ -447,7 +447,7 @@
// by the FLOW_BEGIN calls. Additional phases can be defined using the FLOW_STEP
// macros. When the operation completes, call FLOW_END. An async operation can
// span threads and processes, but all events in that operation must use the
// same |name| and |id|. Each event can have its own args.
// same `name` and `id`. Each event can have its own args.
#define TRACE_EVENT_FLOW_BEGIN0(category, name, id) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
category, name, id, TRACE_EVENT_FLAG_NONE)
@ -472,9 +472,9 @@
category, name, id, TRACE_EVENT_FLAG_COPY, \
arg1_name, arg1_val, arg2_name, arg2_val)
// Records a single FLOW_STEP event for |step| immediately. If the category
// is not enabled, then this does nothing. The |name| and |id| must match the
// FLOW_BEGIN event above. The |step| param identifies this step within the
// Records a single FLOW_STEP event for `step` immediately. If the category
// is not enabled, then this does nothing. The `name` and `id` must match the
// FLOW_BEGIN event above. The `step` param identifies this step within the
// async event. This should be called at the beginning of the next phase of an
// asynchronous operation.
#define TRACE_EVENT_FLOW_STEP0(category, name, id, step) \
@ -1019,4 +1019,4 @@ class TraceEndOnScopeClose {
#endif // RTC_TRACE_EVENTS_ENABLED
#endif // RTC_BASE_TRACE_EVENT_H_
#endif // RTC_BASE_TRACE_EVENT_H_

Some files were not shown because too many files have changed in this diff Show more