Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: components/tracing/core/scattered_stream_writer.cc

Issue 2196663002: tracing v2: Introduce TraceBufferWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proto_refactor
Patch Set: Fix linking errors moving kChunkSize outside of exported class Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/tracing/core/scattered_stream_writer.h ('k') | components/tracing/core/trace_buffer_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/core/scattered_stream_writer.cc
diff --git a/components/tracing/core/scattered_stream_writer.cc b/components/tracing/core/scattered_stream_writer.cc
index 73e2a36ae20ebf7e829555caecb2951e17f8b6c1..37ca5b355075094c4f66a13607f7267d2998a86d 100644
--- a/components/tracing/core/scattered_stream_writer.cc
+++ b/components/tracing/core/scattered_stream_writer.cc
@@ -13,6 +13,8 @@
namespace tracing {
namespace v2 {
+ScatteredStreamWriter::Delegate::~Delegate() {}
+
ScatteredStreamWriter::ScatteredStreamWriter(Delegate* delegate)
: delegate_(delegate),
cur_range_({nullptr, nullptr}),
@@ -62,7 +64,7 @@ void ScatteredStreamWriter::WriteBytes(const uint8_t* src, size_t size) {
// TODO(primiano): perf optimization: I suspect that at the end this will always
// be called with |size| == 4, in which case we might just hardcode it.
ContiguousMemoryRange ScatteredStreamWriter::ReserveBytes(size_t size) {
- // Assume the reservations are always < TraceRingBuffer::Chunk::kSize.
+ // Assume the reservations are always < kChunkSize.
if (write_ptr_ + size > cur_range_.end) {
Extend();
DCHECK_LE(write_ptr_ + size, cur_range_.end);
« no previous file with comments | « components/tracing/core/scattered_stream_writer.h ('k') | components/tracing/core/trace_buffer_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698