The method SimpleURLLoader::DownloadHeadersOnly is used when the issuer of a resource request does not require the response body. This frees the caller from worrying about how large a response body should be accepted.
The current implementation simply discards the response body as it is received and then calls the provided callback. This is inefficient because it means the response body is still sent over the network and the request takes longer to complete. Rather than wait until the body has been downloaded SimpleURLLoader should cancel the request when OnReceiveResponse() is called.
This issue tracks the work necessary to make this possible. The current implementation makes the assumption that OnComplete() will be called for a successful request. There are also fields of the URLLoaderCompletionStatus passed to OnComplete() that are unrelated to the size of the response body and will be unset if we do not wait for this message.
Comment 1 by marcuskoehler@chromium.org
, Jan 15