Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Issue 3052016: Make sure the job state matches the return value.... (Closed)

Created:
10 years, 4 months ago by bmcquade1
Modified:
9 years, 7 months ago
Reviewers:
tony, eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, Paul Godavari, darin-cc_chromium.org, ben+cc_chromium.org, tc_chromium.org
Visibility:
Public.

Description

Fix 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M chrome/browser/net/url_request_slow_download_job.cc View 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
tony
LGTM. Are the download tests the only tests that use this url request type?
10 years, 4 months ago (2010-07-27 22:48:48 UTC) #1
bmcquade1
I did a quick source grep: grepsvn -l --exclude-dir=out URLRequestSlowDownloadJob * chrome/browser/net/url_request_slow_download_job.h chrome/browser/net/url_request_mock_util.cc chrome/browser/net/url_request_slow_download_job.cc chrome/browser/download/download_uitest.cc ...
10 years, 4 months ago (2010-07-27 23:53:49 UTC) #2
eroman
10 years, 4 months ago (2010-07-27 23:56:52 UTC) #3
lgtm

Powered by Google App Engine
This is Rietveld 408576698