| Index: components/tracing/core/scattered_stream_writer.h
|
| diff --git a/components/tracing/core/scattered_stream_writer.h b/components/tracing/core/scattered_stream_writer.h
|
| index 00af4d70c3a3b56e0ea92b70f51df2503d24d606..8fbf84cbeb2c7330bbc6fb821c8fc130cf01dca7 100644
|
| --- a/components/tracing/core/scattered_stream_writer.h
|
| +++ b/components/tracing/core/scattered_stream_writer.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include <stdint.h>
|
|
|
| +#include "base/logging.h"
|
| #include "base/macros.h"
|
| #include "components/tracing/tracing_export.h"
|
|
|
| @@ -52,6 +53,16 @@ class TRACING_EXPORT ScatteredStreamWriter {
|
| // is guaranteed to be contiguous and not span across chunks.
|
| ContiguousMemoryRange ReserveBytes(size_t size);
|
|
|
| + // Fast (but unsafe) version of the above. The caller must have previously
|
| + // checked that there are at least |size| contiguos bytes available.
|
| + // Returns only the start pointer of the reservation.
|
| + uint8_t* ReserveBytesUnsafe(size_t size) {
|
| + uint8_t* begin = write_ptr_;
|
| + write_ptr_ += size;
|
| + DCHECK_LE(write_ptr_, cur_range_.end);
|
| + return begin;
|
| + }
|
| +
|
| // Resets the buffer boundaries and the write pointer to the given |range|.
|
| // Subsequent WriteByte(s) will write into |range|.
|
| void Reset(ContiguousMemoryRange range);
|
|
|