Use backticks not vertical bars to denote variables in comments for /api
Bug: webrtc:12338
Change-Id: Ib97b2c3d64dbd895f261ffa76a2e885bd934a87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226940
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34554}
diff --git a/api/stats/rtc_stats.h b/api/stats/rtc_stats.h
index 9290e80..8ad39b4 100644
--- a/api/stats/rtc_stats.h
+++ b/api/stats/rtc_stats.h
@@ -35,7 +35,7 @@
// static const char kType[];
// It is used as a unique class identifier and a string representation of the
// class type, see https://w3c.github.io/webrtc-stats/#rtcstatstype-str*.
-// Use the |WEBRTC_RTCSTATS_IMPL| macro when implementing subclasses, see macro
+// Use the `WEBRTC_RTCSTATS_IMPL` macro when implementing subclasses, see macro
// for details.
//
// Derived classes list their dictionary members, RTCStatsMember<T>, as public
@@ -47,7 +47,7 @@
// foo.baz->push_back("hello world");
// uint32_t x = *foo.bar;
//
-// Pointers to all the members are available with |Members|, allowing iteration:
+// Pointers to all the members are available with `Members`, allowing iteration:
//
// for (const RTCStatsMemberInterface* member : foo.Members()) {
// printf("%s = %s\n", member->name(), member->ValueToString().c_str());
@@ -65,11 +65,11 @@
const std::string& id() const { return id_; }
// Time relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds.
int64_t timestamp_us() const { return timestamp_us_; }
- // Returns the static member variable |kType| of the implementing class.
+ // Returns the static member variable `kType` of the implementing class.
virtual const char* type() const = 0;
- // Returns a vector of pointers to all the |RTCStatsMemberInterface| members
+ // Returns a vector of pointers to all the `RTCStatsMemberInterface` members
// of this class. This allows for iteration of members. For a given class,
- // |Members| always returns the same members in the same order.
+ // `Members` always returns the same members in the same order.
std::vector<const RTCStatsMemberInterface*> Members() const;
// Checks if the two stats objects are of the same type and have the same
// member values. Timestamps are not compared. These operators are exposed for
@@ -81,8 +81,8 @@
// object, listing all of its members (names and values).
std::string ToJson() const;
- // Downcasts the stats object to an |RTCStats| subclass |T|. DCHECKs that the
- // object is of type |T|.
+ // Downcasts the stats object to an `RTCStats` subclass `T`. DCHECKs that the
+ // object is of type `T`.
template <typename T>
const T& cast_to() const {
RTC_DCHECK_EQ(type(), T::kType);
@@ -90,8 +90,8 @@
}
protected:
- // Gets a vector of all members of this |RTCStats| object, including members
- // derived from parent classes. |additional_capacity| is how many more members
+ // Gets a vector of all members of this `RTCStats` object, including members
+ // derived from parent classes. `additional_capacity` is how many more members
// shall be reserved in the vector (so that subclasses can allocate a vector
// with room for both parent and child members without it having to resize).
virtual std::vector<const RTCStatsMemberInterface*>
@@ -101,21 +101,21 @@
int64_t timestamp_us_;
};
-// All |RTCStats| classes should use these macros.
-// |WEBRTC_RTCSTATS_DECL| is placed in a public section of the class definition.
-// |WEBRTC_RTCSTATS_IMPL| is placed outside the class definition (in a .cc).
+// All `RTCStats` classes should use these macros.
+// `WEBRTC_RTCSTATS_DECL` is placed in a public section of the class definition.
+// `WEBRTC_RTCSTATS_IMPL` is placed outside the class definition (in a .cc).
//
-// These macros declare (in _DECL) and define (in _IMPL) the static |kType| and
-// overrides methods as required by subclasses of |RTCStats|: |copy|, |type| and
-// |MembersOfThisObjectAndAncestors|. The |...| argument is a list of addresses
+// These macros declare (in _DECL) and define (in _IMPL) the static `kType` and
+// overrides methods as required by subclasses of `RTCStats`: `copy`, `type` and
+// `MembersOfThisObjectAndAncestors`. The |...| argument is a list of addresses
// to each member defined in the implementing class. The list must have at least
// one member.
//
// (Since class names need to be known to implement these methods this cannot be
-// part of the base |RTCStats|. While these methods could be implemented using
+// part of the base `RTCStats`. While these methods could be implemented using
// templates, that would only work for immediate subclasses. Subclasses of
// subclasses also have to override these methods, resulting in boilerplate
-// code. Using a macro avoids this and works for any |RTCStats| class, including
+// code. Using a macro avoids this and works for any `RTCStats` class, including
// grandchildren.)
//
// Sample usage:
@@ -215,10 +215,10 @@
kRtcStatsRelativePacketArrivalDelay,
};
-// Interface for |RTCStats| members, which have a name and a value of a type
-// defined in a subclass. Only the types listed in |Type| are supported, these
+// Interface for `RTCStats` members, which have a name and a value of a type
+// defined in a subclass. Only the types listed in `Type` are supported, these
// are implemented by |RTCStatsMember<T>|. The value of a member may be
-// undefined, the value can only be read if |is_defined|.
+// undefined, the value can only be read if `is_defined`.
class RTCStatsMemberInterface {
public:
// Member value types.
@@ -284,7 +284,7 @@
bool is_defined_;
};
-// Template implementation of |RTCStatsMemberInterface|.
+// Template implementation of `RTCStatsMemberInterface`.
// The supported types are the ones described by
// |RTCStatsMemberInterface::Type|.
template <typename T>
diff --git a/api/stats/rtc_stats_report.h b/api/stats/rtc_stats_report.h
index 0fe5ce9..a26db86 100644
--- a/api/stats/rtc_stats_report.h
+++ b/api/stats/rtc_stats_report.h
@@ -30,7 +30,7 @@
namespace webrtc {
// A collection of stats.
-// This is accessible as a map from |RTCStats::id| to |RTCStats|.
+// This is accessible as a map from `RTCStats::id` to `RTCStats`.
class RTC_EXPORT RTCStatsReport final
: public rtc::RefCountedNonVirtual<RTCStatsReport> {
public:
@@ -71,8 +71,8 @@
const RTCStats* Get(const std::string& id) const;
size_t size() const { return stats_.size(); }
- // Gets the stat object of type |T| by ID, where |T| is any class descending
- // from |RTCStats|.
+ // Gets the stat object of type `T` by ID, where `T` is any class descending
+ // from `RTCStats`.
// Returns null if there is no stats object for the given ID or it is the
// wrong type.
template <typename T>
@@ -85,17 +85,17 @@
}
// Removes the stats object from the report, returning ownership of it or null
- // if there is no object with |id|.
+ // if there is no object with `id`.
std::unique_ptr<const RTCStats> Take(const std::string& id);
- // Takes ownership of all the stats in |other|, leaving it empty.
+ // Takes ownership of all the stats in `other`, leaving it empty.
void TakeMembersFrom(rtc::scoped_refptr<RTCStatsReport> other);
// Stats iterators. Stats are ordered lexicographically on |RTCStats::id|.
ConstIterator begin() const;
ConstIterator end() const;
- // Gets the subset of stats that are of type |T|, where |T| is any class
- // descending from |RTCStats|.
+ // Gets the subset of stats that are of type `T`, where `T` is any class
+ // descending from `RTCStats`.
template <typename T>
std::vector<const T*> GetStatsOfType() const {
std::vector<const T*> stats_of_type;
diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h
index 6995db8..b18ef97 100644
--- a/api/stats/rtcstats_objects.h
+++ b/api/stats/rtcstats_objects.h
@@ -197,7 +197,7 @@
};
// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
-// TODO(hbos): |RTCStatsCollector| only collects candidates that are part of
+// TODO(hbos): `RTCStatsCollector` only collects candidates that are part of
// ice candidate pairs, but there could be candidates not paired with anything.
// crbug.com/632723
// TODO(qingsi): Add the stats of STUN binding requests (keepalives) and collect
@@ -221,7 +221,7 @@
// TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"?
RTCStatsMember<std::string> candidate_type;
RTCStatsMember<int32_t> priority;
- // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
+ // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/632723
RTCStatsMember<std::string> url;
protected:
@@ -232,8 +232,8 @@
};
// In the spec both local and remote varieties are of type RTCIceCandidateStats.
-// But here we define them as subclasses of |RTCIceCandidateStats| because the
-// |kType| need to be different ("RTCStatsType type") in the local/remote case.
+// But here we define them as subclasses of `RTCIceCandidateStats` because the
+// `kType` need to be different ("RTCStatsType type") in the local/remote case.
// https://w3c.github.io/webrtc-stats/#rtcstatstype-str*
// This forces us to have to override copy() and type().
class RTC_EXPORT RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
@@ -289,28 +289,28 @@
RTCStatsMember<std::string> media_source_id;
RTCStatsMember<bool> remote_source;
RTCStatsMember<bool> ended;
- // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks.
+ // TODO(hbos): `RTCStatsCollector` does not return stats for detached tracks.
// crbug.com/659137
RTCStatsMember<bool> detached;
- // See |RTCMediaStreamTrackKind| for valid values.
+ // See `RTCMediaStreamTrackKind` for valid values.
RTCStatsMember<std::string> kind;
RTCStatsMember<double> jitter_buffer_delay;
RTCStatsMember<uint64_t> jitter_buffer_emitted_count;
// Video-only members
RTCStatsMember<uint32_t> frame_width;
RTCStatsMember<uint32_t> frame_height;
- // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
+ // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137
RTCStatsMember<double> frames_per_second;
RTCStatsMember<uint32_t> frames_sent;
RTCStatsMember<uint32_t> huge_frames_sent;
RTCStatsMember<uint32_t> frames_received;
RTCStatsMember<uint32_t> frames_decoded;
RTCStatsMember<uint32_t> frames_dropped;
- // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
+ // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137
RTCStatsMember<uint32_t> frames_corrupted;
- // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
+ // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137
RTCStatsMember<uint32_t> partial_frames_lost;
- // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
+ // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137
RTCStatsMember<uint32_t> full_frames_lost;
// Audio-only members
RTCStatsMember<double> audio_level; // Receive-only