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

Issue 2847443002: PlzNavigate: make NavigationResourceHandler a LayeredResourceHandler (Closed)

Created:
3 years, 8 months ago by clamy
Modified:
3 years, 7 months ago
Reviewers:
nasko, mmenke
CC:
chromium-reviews, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, Randy Smith (Not in Mondays), darin-cc_chromium.org, loading-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

PlzNavigate: make NavigationResourceHandler a LayeredResourceHandler This CL makes NavigationResourceHandler a LayeredResourceHandler and moves it just after the MimeSniffingResourceHandler. In PlzNavigate, the ordering of ResourceHandlers in navigation is the following: - ThrottlingResourceHandler - MimeSniffingResourceHandler - ThrottlingResourceHandler (no NavigationResourceThrottle) - InterceptingResourceHandler - NavigationResourceHandler: interacts with the UI thread & writes the response in a stream. After this CL, the ordering of ResourceHandlers will be the following: - ThrottlingResourceHandler - MimeSniffingResourceHandler - NavigationResourceHandler: interacts with the UI thread - ThrottlingResourceHandler (no NavigationResourceThrottle) - InterceptingResourceHandler - StreamResourceHandler: writes the response in a stream. The reason is two-fold. First, it better matches the ordering of ResourceHandlers in the current navigation architecture, which is: - ThrottlingResourceHandler - MimeSniffingResourceHandler - ThrottlingResourceHandler with a NavigationResourceThrottle (interacts with the UI thread) - InterceptingResourceHandler - AsyncResourceHandler In particular, this ensures that the NavigationThrottles will be executed before teh second-round of ResourceThrottles both in PlzNavigate and in the current architecture. Second, moving NavigationResourceHandler before the InterceptingResourceHandler allows to properly pause downloads & stream requests while we execute the NavigationThrottles on the UI thread. This was not possible before because InterceptingResourceHandler does not expect its next handler to pause the request in OnResponseStarted. Not pausing it is causing race conditions with the processing of the navigation on the UI thread. BUG=709771 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2847443002 Cr-Commit-Position: refs/heads/master@{#468692} Committed: https://chromium.googlesource.com/chromium/src/+/ea2f911cf6b0b023ff26e17bb9e57c871c8f52f5

Patch Set 1 #

Patch Set 2 : Removed one unit test #

Total comments: 28

Patch Set 3 : Rebase #

Patch Set 4 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -165 lines) Patch
M content/browser/frame_host/navigation_request.cc View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M content/browser/loader/navigation_resource_handler.h View 1 2 3 5 chunks +15 lines, -15 lines 0 comments Download
M content/browser/loader/navigation_resource_handler.cc View 1 2 3 5 chunks +30 lines, -74 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 2 3 3 chunks +7 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 7 chunks +33 lines, -7 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 chunks +24 lines, -63 lines 0 comments Download
M content/browser/loader/stream_resource_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/stream_resource_handler.cc View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 30 (18 generated)
clamy
@nasko, mmenke: PTAL The main issue that patch is trying to solve is that we ...
3 years, 8 months ago (2017-04-26 16:55:41 UTC) #6
clamy
https://codereview.chromium.org/2847443002/diff/20001/content/browser/loader/resource_dispatcher_host_unittest.cc File content/browser/loader/resource_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/2847443002/diff/20001/content/browser/loader/resource_dispatcher_host_unittest.cc#newcode2562 content/browser/loader/resource_dispatcher_host_unittest.cc:2562: if (IsBrowserSideNavigationEnabled()) I've had to disable this test with ...
3 years, 7 months ago (2017-04-27 13:46:11 UTC) #12
mmenke
Sorry, forgot about this one. At the front of my queue for tomorrow.
3 years, 7 months ago (2017-04-27 22:42:44 UTC) #15
nasko
Based on the overall description of the change, it seems logical to me. I'd defer ...
3 years, 7 months ago (2017-04-27 23:31:37 UTC) #16
mmenke
Should this have browser tests? Particularly with servicification of the network stack, I think it ...
3 years, 7 months ago (2017-04-28 15:16:54 UTC) #17
mmenke
Not an expert on the streams logic, but this seems pretty reasonable to me. https://codereview.chromium.org/2847443002/diff/20001/content/browser/frame_host/navigation_request.cc ...
3 years, 7 months ago (2017-04-28 16:02:21 UTC) #18
clamy
Thanks! https://codereview.chromium.org/2847443002/diff/20001/content/browser/frame_host/navigation_request.cc File content/browser/frame_host/navigation_request.cc (right): https://codereview.chromium.org/2847443002/diff/20001/content/browser/frame_host/navigation_request.cc#newcode799 content/browser/frame_host/navigation_request.cc:799: loader_->ProceedWithResponse(); On 2017/04/28 16:02:20, mmenke wrote: > Why ...
3 years, 7 months ago (2017-05-02 15:05:44 UTC) #20
mmenke
This LGTM, but are there any downloads integration tests that require the changed behavior to ...
3 years, 7 months ago (2017-05-02 15:55:39 UTC) #22
clamy
Thanks! Unfortunately, this was only caught because it broke pdf navigations on Canary. I'm trying ...
3 years, 7 months ago (2017-05-02 16:35:46 UTC) #23
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/2847443002/60001
3 years, 7 months ago (2017-05-02 16:36:40 UTC) #26
mmenke
On 2017/05/02 16:35:46, clamy wrote: > Thanks! Unfortunately, this was only caught because it broke ...
3 years, 7 months ago (2017-05-02 16:37:25 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-05-02 17:14:22 UTC) #30
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/ea2f911cf6b0b023ff26e17bb9e5...

Powered by Google App Engine
This is Rietveld 408576698