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

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

Issue 2043913006: tracing v2: Add proto_utils.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tv_ups2
Patch Set: rebase Created 4 years, 5 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/proto_utils_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f5b0b770d852c3b16fb8449de2fbe10293b77da6..00af4d70c3a3b56e0ea92b70f51df2503d24d606 100644
--- a/components/tracing/core/scattered_stream_writer.h
+++ b/components/tracing/core/scattered_stream_writer.h
@@ -16,6 +16,10 @@ namespace v2 {
struct ContiguousMemoryRange {
uint8_t* begin;
uint8_t* end; // STL style: one byte past the end of the buffer.
+
+ inline bool is_valid() const { return begin != nullptr; }
+ inline void reset() { begin = nullptr; }
+ inline size_t size() { return static_cast<size_t>(end - begin); }
};
// This class deals with the following problem: append-only proto messages want
« no previous file with comments | « components/tracing/core/proto_utils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698