DescriptionFix ReadRawData to make the job state match the return value.
The comment for ReadRawData reads:
// If returning true, data was read from the job. buf will contain
// the data, and bytes_read will receive the number of bytes read.
...
// If returning false, an error occurred or an async IO is now pending.
// If async IO is pending, the status of the request will be
// URLRequestStatus::IO_PENDING, and buf must remain available until the
// operation is completed. See comments on URLRequest::Read for more info.
I interpret this to mean that an implementer should never set status to IO_PENDING and return true, but that's what the slow download job does:
...
SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
DCHECK(!is_done());
return true;
...
Unfortunately this class is part of the Download UI tests which are already flaky/broken so it's not possible to verify that this change doesn't further break those tests. But the current implementation is clearly broken and should be fixed.
BUG=50399
TEST=ran ui_tests, verified no additional breakage
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53876
Patch Set 1 #
Messages
Total messages: 3 (0 generated)
|