commit | dc398ef76fbd4f15c2af4252f86ee777d80b27eb | [log] [tgz] |
---|---|---|
author | David Van Cleve <[email protected]> | Tue Oct 15 19:39:11 2019 |
committer | Commit Bot <[email protected]> | Tue Oct 15 19:39:11 2019 |
tree | 394a402d07f1bdd53b9354a3cbae85ba57422d5c | |
parent | e36b812d88137e6b8c9fda0360363597cd69930e [diff] |
Adds length-prefixed read to BigEndianReader A common task when parsing encoded structs from a network is to read a serialization of an object with (possibly nested) length-prefixed members. //third_party/boringssl's Crypto ByteString bakes support for this in by having a "length-prefixed read" API that initially reads a big-endian length L from the buffer, then constructs and returns a new reader on the L many bytes immediately following the length, skipping the parent reader over this substring. However, this API is C-style and, as a consequence, perhaps not suitable for wide use in Chromium code. This patch adds similar functionality to base::BigEndianReader by adding ReadU8LengthPrefixed and ReadU16LengthPrefixed methods. R=mark Change-Id: Idaf0b04b414a3484099a861ef02501e5f8a83a47 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860518 Commit-Queue: David Van Cleve <[email protected]> Reviewed-by: Mark Mentovai <[email protected]> Cr-Commit-Position: refs/heads/master@{#706074}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .