Namespaces
Records
Functions
-
void PrintTo (const TimeDelta & time_delta, ::std::ostream * os)Used to print useful values in gtest assertions. Should not be used in
production code.
-
template <typename It, typename EndOrSize>span<std::remove_reference_t<std::iter_reference_t<It>>, internal::MaybeStaticExt<EndOrSize>> <deduction guide for span> (It , EndOrSize )[span.deduct], deduction guides.
-
template <typename R, typename T = std::remove_reference_t<std::ranges::range_reference_t<R>>>span<std::conditional_t<std::ranges::borrowed_range<R>, T, const T>, internal::ExtentV<R>> <deduction guide for span> (R && ) -
template <typename T, size_t N>span<const T, N> <deduction guide for span> (const T (&)[N] ) -
template <typename T>uintptr_t get_uintptr (const T * t)TODO(crbug.com/817982): What we really need is for checked_math.h to be
able to do checked arithmetic on pointers.
Defined at line 15 of file ../../third_party/mini_chromium/src/base/containers/util.h
-
template <typename T>T * to_address (T * p)Note that calling `std::to_address()` with a function pointer renders the
program ill-formed.
Defined at line 25 of file ../../third_party/mini_chromium/src/base/types/to_address.h
-
template <typename P>auto to_address (const P & p)Defined at line 34 of file ../../third_party/mini_chromium/src/base/types/to_address.h
-
bool operator== (const CheckedContiguousIterator<T> & lhs, const CheckedContiguousIterator<T> & rhs)Defined at line 78 of file ../../third_party/mini_chromium/src/base/containers/checked_iterators.h
-
auto operator<=> (const CheckedContiguousIterator<T> & lhs, const CheckedContiguousIterator<T> & rhs)Defined at line 84 of file ../../third_party/mini_chromium/src/base/containers/checked_iterators.h
-
template <typename T, size_t N>size_t size (const T (&)[N] array)Defined at line 97 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
template <class T, class Traits>void swap (const ScopedGeneric<T, Traits> & a, const ScopedGeneric<T, Traits> & b)Defined at line 101 of file ../../third_party/mini_chromium/src/base/scoped_generic.h
-
template <class T, class Traits>bool operator== (const T & value, const ScopedGeneric<T, Traits> & scoped)Defined at line 107 of file ../../third_party/mini_chromium/src/base/scoped_generic.h
-
template <class T, class Traits>bool operator!= (const T & value, const ScopedGeneric<T, Traits> & scoped)Defined at line 112 of file ../../third_party/mini_chromium/src/base/scoped_generic.h
-
CheckedContiguousIterator<T> operator+ (difference_type lhs, const CheckedContiguousIterator<T> & rhs)Defined at line 130 of file ../../third_party/mini_chromium/src/base/containers/checked_iterators.h
-
uint16_t NetToHost16 (uint16_t x)base/sys_byteorder.h
Defined at line 137 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
uint32_t NetToHost32 (uint32_t x)Defined at line 140 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
uint64_t NetToHost64 (uint64_t x)Defined at line 143 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
uint16_t HostToNet16 (uint16_t x)Converts the bytes in |x| from host to network order (endianness), and
returns the result.
Defined at line 149 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
uint32_t HostToNet32 (uint32_t x)Defined at line 152 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
difference_type operator- (const CheckedContiguousIterator<T> & lhs, const CheckedContiguousIterator<T> & rhs)Defined at line 152 of file ../../third_party/mini_chromium/src/base/containers/checked_iterators.h
-
uint64_t HostToNet64 (uint64_t x)Defined at line 155 of file ../../src/media/third_party/chromium_media/chromium_utils.h
-
bool operator== (span<T, N, InternalPtrType> lhs, span<T, N, InternalPtrType> rhs)Compares two spans for equality by comparing the objects pointed to by the
spans. The operation is defined for spans of different types as long as the
types are themselves comparable.
For primitive types, this replaces the less safe `memcmp` function, where
`memcmp(a.data(), b.data(), a.size())` can be written as `a == b` and can
no longer go outside the bounds of `b`. Otherwise, it replaced std::equal
or std::ranges::equal when working with spans, and when no projection is
needed.
If the spans are of different sizes, they are not equal. If both spans are
empty, they are always equal (even though their data pointers may differ).
# Implementation note
The non-template overloads allow implicit conversions to span for
comparison.
Defined at line 654 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
bool operator== (span<T, N, InternalPtrType> lhs, span<const T, N> rhs)Defined at line 659 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <class U, size_t M>bool operator== (span<T, N, InternalPtrType> lhs, span<U, M> rhs)Defined at line 667 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
bool operator== (span<T, dynamic_extent, InternalPtrType> lhs, span<T, dynamic_extent, InternalPtrType> rhs)Compares two spans for equality by comparing the objects pointed to by the
spans. The operation is defined for spans of different types as long as the
types are themselves comparable.
For primitive types, this replaces the less safe `memcmp` function, where
`memcmp(a.data(), b.data(), a.size())` can be written as `a == b` and can
no longer go outside the bounds of `b`. Otherwise, it replaced std::equal
or std::ranges::equal when working with spans, and when no projection is
needed.
If the spans are of different sizes, they are not equal. If both spans are
empty, they are always equal (even though their data pointers may differ).
# Implementation note
The non-template overloads allow implicit conversions to span for
comparison.
Defined at line 1039 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
bool operator== (span<T, dynamic_extent, InternalPtrType> lhs, span<const T> rhs)Defined at line 1044 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <class U, size_t M>bool operator== (span<T, dynamic_extent, InternalPtrType> lhs, span<U, M> rhs)Defined at line 1051 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T, size_t X>auto as_bytes (span<T, X> s)[span.objectrep], views of object representation
Defined at line 1082 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T, size_t X>auto as_writable_bytes (span<T, X> s)Defined at line 1096 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T, size_t X>auto as_chars (span<T, X> s)as_chars() is the equivalent of as_bytes(), except that it returns a
span of const char rather than const uint8_t. This non-std function is
added since chrome still represents many things as char arrays which
rightfully should be uint8_t.
Defined at line 1113 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
std::string_view as_string_view (span<const char> s)as_string_view() converts a span over byte-sized primitives (holding chars or
uint8_t) into a std::string_view, where each byte is represented as a char.
It also accepts any type that can implicitly convert to a span, such as
arrays.
If you want to view an arbitrary span type as a string, first explicitly
convert it to bytes via `base::as_bytes()`.
For spans over byte-sized primitives, this is sugar for:
```
std::string_view(as_chars(span).begin(), as_chars(span).end())
```
Defined at line 1137 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
std::string_view as_string_view (span<const unsigned char> s)Defined at line 1140 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T, size_t X>auto as_writable_chars (span<T, X> s)as_writable_chars() is the equivalent of as_writable_bytes(), except that
it returns a span of char rather than uint8_t. This non-std function is
added since chrome still represents many things as char arrays which
rightfully should be uint8_t.
Defined at line 1152 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <int&... ExplicitArgumentBarrier, typename It>auto make_span (It it, StrictNumeric<size_t> size)Type-deducing helper for constructing a span.
# Safety
The contiguous iterator `it` must point to the first element of at least
`size` many elements or Undefined Behaviour may result as the span may give
access beyond the bounds of the collection pointed to by `it`.
Defined at line 1171 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <int&... ExplicitArgumentBarrier, typename It, typename End, typename = std::enable_if_t<!std::is_convertible_v<End, size_t>>>auto make_span (It it, End end)Type-deducing helper for constructing a span.
# Checks
The function CHECKs that `it
<
= end` and will terminate otherwise.
# Safety
The contiguous iterator `it` and its end sentinel `end` must be for the same
allocation or Undefined Behaviour may result as the span may give access
beyond the bounds of the collection pointed to by `it`.
Defined at line 1193 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <int&... ExplicitArgumentBarrier, typename Container>auto make_span (Container && container)make_span utility function that deduces both the span's value_type and extent
from the passed in argument.
Usage: auto span = base::make_span(...);
Defined at line 1205 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <size_t N, int&... ExplicitArgumentBarrier, typename It>auto make_span (It it, StrictNumeric<size_t> size)make_span utility function that allows callers to explicit specify the span's
extent, the value_type is deduced automatically. This is useful when passing
a dynamically sized container to a method expecting static spans, when the
container is known to have the correct size.
Note: This will CHECK that N indeed matches size(container).
# Usage
As this function is unsafe, the caller must guarantee that the size is
correct for the iterator, and will not allow the span to reach out of bounds.
```
// SAFETY:
<An
explanation of how the size is checked/ensured to always be
// valid for the iterator>.
auto static_span = UNSAFE_BUFFERS(base::make_span
<N
>(it, size));
```
# Safety
The contiguous iterator `it` must point to the first element of at least
`size` many elements or Undefined Behaviour may result as the span may give
access beyond the bounds of the collection pointed to by `it`.
Defined at line 1233 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <size_t N, int&... ExplicitArgumentBarrier, typename It, typename End, typename = std::enable_if_t<!std::is_convertible_v<End, size_t>>>auto make_span (It it, End end)make_span utility function that allows callers to explicit specify the span's
extent, the value_type is deduced automatically. This is useful when passing
a dynamically sized container to a method expecting static spans, when the
container is known to have the correct size.
Note: This will CHECK that N indeed matches size(container).
# Usage
As this function is unsafe, the caller must guarantee that the `end` is from
the same allocation as the `it` iterator.
```
// SAFETY:
<An
explanation if non-trivial how the iterators are not from
// different containers/allocations>.
auto static_span = UNSAFE_BUFFERS(base::make_span
<N
>(it, end));
```
# Checks
The function CHECKs that `it
<
= end` and will terminate otherwise.
# Safety
The contiguous iterator `it` and its end sentinel `end` must be for the same
allocation or Undefined Behaviour may result as the span may give access
beyond the bounds of the collection pointed to by `it`.
Defined at line 1270 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <size_t N, int&... ExplicitArgumentBarrier, typename Container>auto make_span (Container && container)Defined at line 1278 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T>span<T, 1U> span_from_ref (T & single_object)`span_from_ref` converts a reference to T into a span of length 1. This is a
non-std helper that is inspired by the `std::slice::from_ref()` function from
Rust.
Defined at line 1290 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T>span<const uint8_t, sizeof(T)> byte_span_from_ref (const T & single_object)`byte_span_from_ref` converts a reference to T into a span of uint8_t of
length sizeof(T). This is a non-std helper that is a sugar for
`as_writable_bytes(span_from_ref(x))`.
Const references are turned into a `span
<const
T, sizeof(T)>` while mutable
references are turned into a `span
<T
, sizeof(T)>`.
Defined at line 1304 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T>span<uint8_t, sizeof(T)> byte_span_from_ref (T & single_object)Defined at line 1309 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <size_t N>span<const char, N - 1> span_from_cstring (const char (&)[N] lit)Converts a string literal (such as `"hello"`) to a span of `char` while
omitting the terminating NUL character. These two are equivalent:
```
base::span
<char
, 5u> s1 = base::span_from_cstring("hello");
base::span
<char
, 5u> s2 = base::span(std::string_view("hello"));
```
If you want to include the NUL terminator, then use the span constructor
directly, such as:
```
base::span
<char
, 6u> s = base::span("hello");
```
Defined at line 1327 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <size_t N>span<const uint8_t, N - 1> byte_span_from_cstring (const char (&)[N] lit)Converts a string literal (such as `"hello"`) to a span of `uint8_t` while
omitting the terminating NUL character. These two are equivalent:
```
base::span
<uint8
_t, 5u> s1 = base::byte_span_from_cstring("hello");
base::span
<uint8
_t, 5u> s2 = base::as_byte_span(std::string_view("hello"));
```
If you want to include the NUL terminator, then use the span constructor
directly, such as:
```
base::span
<uint8
_t, 6u> s = base::as_bytes(base::span("hello"));
```
Defined at line 1345 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T>span<const uint8_t> as_byte_span (const T & arg)Defined at line 1360 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T, size_t N>span<const uint8_t, N * sizeof(T)> as_byte_span (const T (&)[N] arr)This overload for arrays preserves the compile-time size N of the array in
the span type signature span
<uint8
_t, N>.
Defined at line 1367 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T>span<uint8_t> as_writable_byte_span (T && arg)Defined at line 1383 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename T, size_t N>span<uint8_t, N * sizeof(T)> as_writable_byte_span (T (&)[N] arr)This overload for arrays preserves the compile-time size N of the array in
the span type signature span
<uint8
_t, N>.
Defined at line 1391 of file ../../third_party/mini_chromium/src/base/containers/span.h
-
template <typename Tsize_t N>span<uint8_t, N * sizeof(T)> as_writable_byte_span (T (&&)[N] arr)Defined at line 1397 of file ../../third_party/mini_chromium/src/base/containers/span.h
Variables
const size_t dynamic_extent
Defined at line 14 of file ../../third_party/mini_chromium/src/base/containers/dynamic_extent.h
const std::nullopt_t nullopt
Defined at line 94 of file ../../src/media/third_party/chromium_media/chromium_utils.h
shared_ptr<media::H264BitstreamBuffer> (*)() MakeRefCounted
Defined at line 101 of file ../../src/media/third_party/chromium_media/chromium_utils.h
auto MakeRefCounted
Defined at line 102 of file ../../src/media/third_party/chromium_media/chromium_utils.h
std::string (*)(const char *, ...) StringPrintf
Defined at line 243 of file ../../src/media/third_party/chromium_media/chromium_utils.h