DescriptionAvoid issuing a Read() after draining a request.
A URLRequest can signal the end of a stream by calling OnReadCompleted()
with a byte count of zero. No further reads should be issued after this.
However, ResourceLoader could issue a second Read() if the
ResourceHandler::OnReadCompleted() handler sets defer to true. I.e.
When a read completes:
URLRequest calls
-> ResourceLoader::OnReadCompleted(request, 0)
-> ResourceHandler::OnReadCompleted(id, 0, &defer)
(ResourceHandler sets defer to true)
Prior to this CL, the behavior on resumption was:
ResourceHandler calls
-> ResourceLoader::Resume()
-> ResourceLoader::ResumeReading()
-> ResourceLoader::StartReading()
-> ResourceLoader::ReadMore()
-> URLRequest::Read()
The new behavior is:
ResourceHandler calls
-> ResourceLoader::Resume()
-> ResourceLoader::ResponseCompleted()
The new behavior is parallel to what happens if the ResourceHandler
didn't defer.
BUG=320394
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269518
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : Add reliable repro of crash. #
Total comments: 1
Patch Set 5 : Re-upload to see if it would make bots happy. #Messages
Total messages: 8 (0 generated)
|