Currently, various OutputSurface derived classes make use of LatencyInfoCache which generates |swap_id_| values which mirror the values generated by ImageTransportSurface in the GPU process (see https://cs.chromium.org/chromium/src/components/viz/service/display/output_surface.h?rcl=5ed4537c67e7a0e38981dbde6a3971debcedbba5&l=170).
Recent code changes will introduce additional mirrored |swap_id_|s. In order to avoid this fragile dependency, we should update SwapBuffers and related command buffer commands to take a callback which can be used to store data (such as latency info) which must be associated with a give SwapBuffers ack. Internally, the CommandBuffer could generate |swap_id_| and round-trip this value, ensuring that everything stays in sync.
Comment 1 by bugdroid1@chromium.org
, May 7 2018