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

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

Issue 2134683002: tracing v2: Add base class for zero-copy protobuf (ProtoZero) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proto_utils
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/BUILD.gn ('k') | components/tracing/core/proto_zero_message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/core/proto_utils.h
diff --git a/components/tracing/core/proto_utils.h b/components/tracing/core/proto_utils.h
index 59b147db42faa88bc6acb71f57acd1b98cfce676..68599199688e98f0182aeb874a4e6e15e0585f2d 100644
--- a/components/tracing/core/proto_utils.h
+++ b/components/tracing/core/proto_utils.h
@@ -26,6 +26,10 @@ enum : uint32_t {
kFieldTypeFixed32 = 5,
};
+// Maximum message size supported: 256 MiB (4 x 7-bit due to varint encoding).
+constexpr size_t kMessageLengthFieldSize = 4;
+constexpr size_t kMaxMessageLength = (1u << (kMessageLengthFieldSize * 7)) - 1;
+
// Returns the number of bytes sufficient to encode the largest
// |int_size_in_bits|-bits integer using a non-redundant varint encoding.
template <typename T>
« no previous file with comments | « components/tracing/BUILD.gn ('k') | components/tracing/core/proto_zero_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698