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

Issue 2974493002: Fix short error responses sniffed as downloads hanging. (Closed)

Created:
3 years, 5 months ago by mmenke
Modified:
3 years, 5 months ago
Reviewers:
Charlie Harrison
CC:
chromium-reviews, cbentzel+watch_chromium.org, jam, net-reviews_chromium.org, darin-cc_chromium.org, rdsmith+watch_chromium.org, loading-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix short error responses sniffed as downloads hanging. When MimeSniffingResourceHandler sniffs an error responses request as a download, it refuses to download the file and cancels the request with an error instead. It used to both pass cancellation up through the ResourceHandler and cancel the URLRequest itself. However, as of https://codereview.chromium.org/2526983002, it just cancelled the request, rather than passing the cancellation message up the ResourceHandler stack. This mostly works...Except in the case we had to read to the end of the response before we could sniff the mime type. Completed requests do nothing when canceled, so the request would hang. Without the notification up through the ResourceHandler stack, the ResourceLoader never learns of cancellation. This CL replaces cancelling the URLRequest directly with cancelling through the ResourceController (Which is what it should have been doing, anyways). BUG=738680 Review-Url: https://codereview.chromium.org/2974493002 Cr-Commit-Position: refs/heads/master@{#484720} Committed: https://chromium.googlesource.com/chromium/src/+/72fd4f4bc6752250814df9ca73ab9786abc667dd

Patch Set 1 #

Patch Set 2 : Add comment #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -4 lines) Patch
M chrome/browser/net/errorpage_browsertest.cc View 1 3 chunks +30 lines, -0 lines 3 comments Download
M content/browser/loader/mime_sniffing_resource_handler.cc View 2 chunks +2 lines, -4 lines 1 comment Download

Messages

Total messages: 16 (8 generated)
mmenke
I have the strangest feeling I've had to fix this case before. https://codereview.chromium.org/2974493002/diff/20001/content/browser/loader/mime_sniffing_resource_handler.cc File content/browser/loader/mime_sniffing_resource_handler.cc ...
3 years, 5 months ago (2017-07-06 17:51:57 UTC) #5
Charlie Harrison
LGTM https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc File chrome/browser/net/errorpage_browsertest.cc (right): https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc#newcode336 chrome/browser/net/errorpage_browsertest.cc:336: new net::test_server::RawHttpResponse("HTTP/1.1 500 Server Sad :(", Can you ...
3 years, 5 months ago (2017-07-06 18:09:38 UTC) #6
mmenke
Thanks! https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc File chrome/browser/net/errorpage_browsertest.cc (right): https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc#newcode336 chrome/browser/net/errorpage_browsertest.cc:336: new net::test_server::RawHttpResponse("HTTP/1.1 500 Server Sad :(", On 2017/07/06 ...
3 years, 5 months ago (2017-07-06 18:17:19 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2974493002/20001
3 years, 5 months ago (2017-07-06 18:17:45 UTC) #10
Charlie Harrison
https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc File chrome/browser/net/errorpage_browsertest.cc (right): https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc#newcode336 chrome/browser/net/errorpage_browsertest.cc:336: new net::test_server::RawHttpResponse("HTTP/1.1 500 Server Sad :(", On 2017/07/06 18:17:19, ...
3 years, 5 months ago (2017-07-06 18:23:09 UTC) #11
mmenke
On 2017/07/06 18:23:09, Charlie Harrison wrote: > https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc > File chrome/browser/net/errorpage_browsertest.cc (right): > > https://codereview.chromium.org/2974493002/diff/20001/chrome/browser/net/errorpage_browsertest.cc#newcode336 ...
3 years, 5 months ago (2017-07-06 18:24:36 UTC) #12
Charlie Harrison
On 2017/07/06 18:24:36, mmenke wrote: > On 2017/07/06 18:23:09, Charlie Harrison wrote: > > > ...
3 years, 5 months ago (2017-07-06 18:25:26 UTC) #13
commit-bot: I haz the power
3 years, 5 months ago (2017-07-06 20:03:53 UTC) #16
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/72fd4f4bc6752250814df9ca73ab...

Powered by Google App Engine
This is Rietveld 408576698