Avoid 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 Review URL: https://codereview.chromium.org/267563004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269518 0039d316-1c4b-4281-b951-d872f2087c98
Showing
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
Please register or sign in to comment