Removed `upb_EpsCopyInputStream_GetInputPtr()` from the public API.
In its place, we now provide higher-level operations with clearer semantics: - `upb_EpsCopyInputStream_ReadStringAlwaysAlias()` -- for advancing past a region of known size and obtaining a `upb_StringView` pointing to the input buffer. - `upb_EpsCopyInputStream_StartCapture()/EndCapture()` -- for marking a "start" position before advancing past some data of unknown size (eg. for skipping groups). When the capture is ended, the user can obtain a `upb_StringView` for the entire captured region pointing to the input buffer. There are several benefits from this change: 1. The higher-level operations let users express their intent more directly, saving them from managing low-level details (like the surprising `IsDone()` check in `decode.c`). 2. If/when we extend EpsCopyInputStream to support multi-buffer input, this will make it clearer what call sites need to change to handle multiple buffers correctly, and how to extend those higher-level operations to be multi-buffer-safe. 3. This will help us unwind some complexity around `IsDoneFallbackInline()`. One of the original motivations for providing a custom buffer flip callback was to copy data out of the soon-to-disappear buffer if we were in the middle of capturing some unknown data. If the higher level `StartCapture()/EndCapture()` operation can handle any required copying automatically, that puts us one step closer to having a single `IsDoneFallback()` with no need to let the user inject their own buffer flip callback. This CL also fixes a bug in `_upb_WireReader_SkipGroup()`, and removes the code path where we parse unknown groups by calling back into `_upb_Decoder_DecodeMessage()` with a NULL MiniTable. PiperOrigin-RevId: 833458789
J
Joshua Haberman committed
562f1b22e3f82e0ff85851b98cd3161d0bc537fb
Parent: 74c3ab7
Committed by Copybara-Service <copybara-worker@google.com>
on 11/17/2025, 8:58:56 PM