Mail thread discussing this is at:
https://groups.google.com/a/chromium.org/forum/#!msg/net-dev/tKHlioTYJ9A/0l_QH7igBwAJ
There is a subtle behavior difference between what SpdyHttpStream::GetTotalReceivedBytes() is supposed to return and what it is being used for. GetTotalReceivedBytes on all interfaces seems to suggest that it should return the total bytes received from the network till now and not the total bytes that have been read by that layer's consumer.
The issue may come because URLRequest::OnHeadersComplete() is filling in the raw_header_size_ field by invoking GetTotalReceivedBytes() on the job which eventually invokes the spdy stream's GetTotalReceivedBytes().
There is no guarantee from HttpTransaction or URLRequestJob layer that receiving headers and letting the consumer know that headers are received will be synchronous. If any of these layers introduce an asynchronous behavior between headers completion at the streams layer and when URLRequest eventually knows that headers are completed, its possible the spdy stream by that time has gone ahead and read more bytes and closed itself and thus the URLRequest fills raw_header_size_ with something more than just the headers bytes.
There should be another API like GetReceivedHeaderBytes() at the various layers.
Comment 1 by sheriffbot@chromium.org
, Apr 16 2018Status: Untriaged (was: Available)