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

Issue 267563004: Avoid issuing a Read() after draining a request. (Closed)

Created:
6 years, 7 months ago by asanka
Modified:
6 years, 7 months ago
Reviewers:
davidben
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -19 lines) Patch
M chrome/browser/download/download_browsertest.cc View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/test/data/downloads/empty.bin View 1 2 3 Binary file 0 comments Download
A chrome/test/data/downloads/empty.bin.mock-http-headers View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
M content/browser/download/download_browsertest.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M content/browser/loader/buffered_resource_handler.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/resource_loader.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 4 chunks +15 lines, -3 lines 0 comments Download
M content/browser/loader/resource_loader_unittest.cc View 1 2 4 chunks +25 lines, -14 lines 0 comments Download
A content/test/data/download/empty.bin View Binary file 0 comments Download
A content/test/data/download/empty.bin.mock-http-headers View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
asanka
6 years, 7 months ago (2014-05-08 21:47:32 UTC) #1
davidben
LGTM. Were you able to figure out why the tests don't tickle the crash itself ...
6 years, 7 months ago (2014-05-08 21:51:59 UTC) #2
asanka
On 2014/05/08 21:51:59, David Benjamin wrote: > LGTM. > > Were you able to figure ...
6 years, 7 months ago (2014-05-09 05:13:27 UTC) #3
davidben
Ah. New test LGTM. apply_issue seems to be unhappy at the empty file. Maybe rename ...
6 years, 7 months ago (2014-05-09 16:04:24 UTC) #4
asanka
Thanks! On 2014/05/09 16:04:24, David Benjamin wrote: > Ah. New test LGTM. > > apply_issue ...
6 years, 7 months ago (2014-05-09 16:16:02 UTC) #5
asanka
The CQ bit was checked by asanka@chromium.org
6 years, 7 months ago (2014-05-09 18:22:47 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/267563004/100001
6 years, 7 months ago (2014-05-09 18:23:43 UTC) #7
commit-bot: I haz the power
6 years, 7 months ago (2014-05-10 04:30:04 UTC) #8
Message was sent while issue was closed.
Change committed as 269518

Powered by Google App Engine
This is Rietveld 408576698