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

Issue 2476163003: Refactor ResourceHandler API. (Closed)

Created:
4 years, 1 month ago by mmenke
Modified:
3 years, 9 months ago
Reviewers:
CC:
chromium-reviews, asanka, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, jam, Randy Smith (Not in Mondays), yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, loading-reviews_chromium.org, darin (slow to review)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor ResourceHandler API. ResourceHandlers used to have one way to cancel requests synchronously, and another to do so asynchronously. Now there's only one way to do it: Call into the ResourceController. The downside to this is that when cancelling the request, ResourceHandlers also need to tell the upstream object that the request is "deferred". This is part of a refactoring to make cancellation synchronous. BUG=too lazy to look it up right now

Patch Set 1 #

Patch Set 2 : Oops #

Patch Set 3 : Fix tests (No longer post async cancel task) #

Patch Set 4 : Merge #

Patch Set 5 : Fix merge #

Patch Set 6 : Mini merge #

Patch Set 7 : Fix includes #

Patch Set 8 : Minor cleanups, one real fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+978 lines, -808 lines) Patch
M content/browser/download/download_resource_handler.h View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/download/download_resource_handler.cc View 1 2 3 4 5 6 7 2 chunks +20 lines, -12 lines 0 comments Download
M content/browser/download/save_file_resource_handler.h View 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/download/save_file_resource_handler.cc View 5 chunks +13 lines, -10 lines 0 comments Download
M content/browser/loader/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/loader/async_resource_handler.h View 1 2 1 chunk +6 lines, -5 lines 0 comments Download
M content/browser/loader/async_resource_handler.cc View 1 2 3 4 5 6 7 8 chunks +38 lines, -27 lines 0 comments Download
M content/browser/loader/detachable_resource_handler.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -5 lines 0 comments Download
M content/browser/loader/detachable_resource_handler.cc View 1 2 3 4 5 6 7 5 chunks +41 lines, -30 lines 0 comments Download
M content/browser/loader/intercepting_resource_handler.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -10 lines 0 comments Download
M content/browser/loader/intercepting_resource_handler.cc View 9 chunks +53 lines, -51 lines 0 comments Download
M content/browser/loader/intercepting_resource_handler_unittest.cc View 34 chunks +158 lines, -108 lines 0 comments Download
M content/browser/loader/layered_resource_handler.h View 1 chunk +6 lines, -5 lines 0 comments Download
M content/browser/loader/layered_resource_handler.cc View 2 chunks +12 lines, -11 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler.h View 1 2 3 4 5 6 7 3 chunks +21 lines, -22 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler.cc View 13 chunks +59 lines, -58 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler_unittest.cc View 1 10 chunks +44 lines, -47 lines 0 comments Download
M content/browser/loader/mojo_async_resource_handler.h View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
M content/browser/loader/mojo_async_resource_handler.cc View 1 2 3 4 5 4 chunks +31 lines, -21 lines 0 comments Download
M content/browser/loader/mojo_async_resource_handler_unittest.cc View 1 2 3 4 5 6 7 35 chunks +163 lines, -116 lines 0 comments Download
M content/browser/loader/navigation_resource_handler.h View 1 chunk +6 lines, -5 lines 0 comments Download
M content/browser/loader/navigation_resource_handler.cc View 5 chunks +12 lines, -15 lines 0 comments Download
M content/browser/loader/redirect_to_file_resource_handler.h View 1 chunk +5 lines, -4 lines 0 comments Download
M content/browser/loader/redirect_to_file_resource_handler.cc View 6 chunks +16 lines, -14 lines 0 comments Download
M content/browser/loader/resource_handler.h View 1 2 3 4 5 2 chunks +29 lines, -26 lines 0 comments Download
M content/browser/loader/resource_loader.h View 1 2 3 4 5 1 chunk +5 lines, -2 lines 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 3 4 5 9 chunks +61 lines, -69 lines 0 comments Download
M content/browser/loader/resource_loader_unittest.cc View 4 chunks +12 lines, -11 lines 0 comments Download
M content/browser/loader/stream_resource_handler.h View 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/loader/stream_resource_handler.cc View 2 chunks +9 lines, -14 lines 0 comments Download
M content/browser/loader/sync_resource_handler.h View 1 2 1 chunk +6 lines, -5 lines 0 comments Download
M content/browser/loader/sync_resource_handler.cc View 1 2 3 4 5 6 5 chunks +17 lines, -16 lines 0 comments Download
M content/browser/loader/test_resource_handler.h View 2 chunks +8 lines, -5 lines 0 comments Download
M content/browser/loader/test_resource_handler.cc View 4 chunks +31 lines, -20 lines 0 comments Download
M content/browser/loader/throttling_resource_handler.h View 1 chunk +5 lines, -4 lines 0 comments Download
M content/browser/loader/throttling_resource_handler.cc View 4 chunks +48 lines, -40 lines 0 comments Download

Messages

Total messages: 39 (33 generated)
mmenke
[rdsmith]: WDYT? This is kinda a huge CL, and I should probably beef up tests ...
4 years, 1 month ago (2016-11-17 19:59:04 UTC) #30
Randy Smith (Not in Mondays)
Questions/thoughts in no particular order: * I just skimmed this since I think we're still ...
4 years, 1 month ago (2016-11-18 21:38:42 UTC) #33
mmenke
Worth noting I'm in no rush here, rather get things right, even if it takes ...
4 years, 1 month ago (2016-11-18 22:27:23 UTC) #34
mmenke
On 2016/11/18 21:38:42, Randy Smith - Not in Mondays wrote: > Random thought: Would it ...
4 years, 1 month ago (2016-11-18 23:08:08 UTC) #35
mmenke
On 2016/11/18 23:08:08, mmenke wrote: > On 2016/11/18 21:38:42, Randy Smith - Not in Mondays ...
4 years ago (2016-11-22 17:53:03 UTC) #36
mmenke
4 years ago (2016-11-22 18:55:11 UTC) #37
On 2016/11/22 17:53:03, mmenke wrote:
> On 2016/11/18 23:08:08, mmenke wrote:
> > On 2016/11/18 21:38:42, Randy Smith - Not in Mondays wrote:
> > > Random thought: Would it be possible to change the contract for traveling
> down
> > > the ResourceHandler chain s.t. the base class always handled the
> next_handler_
> > > and calls to that handler went through the base class?  And (key point) we
> > > cancelled through that base class as well?  Then that base class could
> > > auto-defer and the RH subclass wouldn't have to worry about it.  As I say,
> > > random thought--there may well be things wrong with it.

So I'm not sure about this...The RedirectToFileResourceHandler drives both the
URLRequest and the layers below it (Using a different message!) at the same
time.  I'm having trouble picturing a reasonable way for things like that to
work - same goes for the MimeTypeResourceHandler.  IF we just had the parent
class manage return/cancellation/resume, I think that works fine, just when we
have it managing next_handler_, too, that things get ugly.

Powered by Google App Engine
This is Rietveld 408576698