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

Issue 2366753002: Have MimeSniffingResourceHandler call WillStartRequest on new Handlers. (Closed)

Created:
4 years, 3 months ago by mmenke
Modified:
4 years, 2 months ago
Reviewers:
CC:
chromium-reviews, loading-reviews_chromium.org, jam, darin-cc_chromium.org, Randy Smith (Not in Mondays)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Have MimeSniffingResourceHandler call WillStartRequest on new Handlers. Previously, when swapping in a new ResourceHandler, this method was not being called on them. This, combined with another bug, was resulting in crashes. Could have the InterceptingResourceHandler invoke this function instead, the two reasons for having the MimeSniffingResourceHandler do it instead are that it already implements ResourceController and ties it to a DoLoop, and that there's a symmetry in bringing the new ResourceHandler to the same state the old one was in before swapping it in. One the down side, both the InterceptingResourceHandler and the MimeSniffingResourceHandler share the responsibilty for handling sending data to both the old and new handlers for the transfer, though this was already the previous state as well, just to a lesser extent. BUG=640545

Patch Set 1 #

Patch Set 2 : Tests! #

Patch Set 3 : Fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -75 lines) Patch
M content/browser/loader/intercepting_resource_handler.h View 1 1 chunk +6 lines, -4 lines 0 comments Download
M content/browser/loader/intercepting_resource_handler.cc View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler.h View 3 chunks +16 lines, -5 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler.cc View 1 2 4 chunks +51 lines, -16 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler_unittest.cc View 1 2 28 chunks +192 lines, -50 lines 0 comments Download

Messages

Total messages: 19 (15 generated)
mmenke
I want to land the other CL before this one, out of paranoia (Duplicate throttles ...
4 years, 2 months ago (2016-09-26 21:03:19 UTC) #12
mmenke
On 2016/09/26 21:03:19, mmenke wrote: > I want to land the other CL before this ...
4 years, 2 months ago (2016-09-26 21:04:25 UTC) #13
mmenke
On 2016/09/26 21:04:25, mmenke wrote: > On 2016/09/26 21:03:19, mmenke wrote: > > I want ...
4 years, 2 months ago (2016-09-26 22:22:30 UTC) #16
mmenke
4 years, 2 months ago (2016-09-27 17:34:56 UTC) #17
On 2016/09/26 22:22:30, mmenke wrote:
> On 2016/09/26 21:04:25, mmenke wrote:
> > On 2016/09/26 21:03:19, mmenke wrote:
> > > I want to land the other CL before this one, out of paranoia (Duplicate
> > > throttles just seems bad enough that I don't want to make things more
> > > complicated there).
> > > 
> > > I put the call in MimeSniffingResourceHandler for two reasons:
> > > 1)  It's already a ResourceController with a DoLoop, so it was simpler.
> > > 2)  If OnWillStart cancels through the ResourceController, we could end up
> > > telling a ResourceController whose turn it currently is not to cancel the
> > > request.  Sure we do that elsewhere, just doesn't seem like a great idea.
> > 
> > Hrm...Actually, suppose 2) isn't an issue.  It's still easier, though.  :)
> 
> Oops, hold off on this one - a test expects the navigation to be cancelled,
and
> then the prompt to appear, and this CL flips the order.  I'll need to either
fix
> the test, or rework the code (Probably the latter).

I'm going to put this CL off to the side, for now - doesn't seem urgent, and
there are regressions to investigate.  Will file a new bug for this.

Powered by Google App Engine
This is Rietveld 408576698