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

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

Issue 2196663002: tracing v2: Introduce TraceBufferWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proto_refactor
Patch Set: . 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
Index: components/tracing/core/proto_utils.h
diff --git a/components/tracing/core/proto_utils.h b/components/tracing/core/proto_utils.h
index 68599199688e98f0182aeb874a4e6e15e0585f2d..dfa983e0297c599c9dfda0a3690ef1ab6ae39842 100644
--- a/components/tracing/core/proto_utils.h
+++ b/components/tracing/core/proto_utils.h
@@ -95,6 +95,12 @@ void WriteRedundantVarIntU32(uint32_t value, uint8_t* buf) {
DCHECK_EQ(0u, value) << "Buffer too short to encode the given value";
}
+template <uint32_t field_id>
+void StaticAssertSingleBytePreamble() {
+ static_assert(field_id < 16,
+ "Proto field id too big to fit in a single byte preamble");
+};
+
} // namespace proto
} // namespace v2
} // namespace tracing

Powered by Google App Engine
This is Rietveld 408576698