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

Issue 10644011: Revert r143458 (which re-applies r143341 and r142979). (Closed)

Created:
8 years, 6 months ago by darin (slow to review)
Modified:
8 years, 5 months ago
Reviewers:
jam
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, jochen+watch-content_chromium.org
Visibility:
Public.

Description

Revert r143458 (which re-applies r143341 and r142979). This CL also includes unit tests for DataReceived and DataReceived_ACK messaging. Make ResourceHandlers that defer loading also be responsible for calling Resume on their ResourceController. What this does is avoid out-of-band calls to Resume the ResourceLoader, and that means that an intermediate ResourceHandler (for example the BufferedResourceHandler) will be able to implement ResourceController. Consider the problematic scenerio that happens today: 1- The BufferedResourceHandler consumes response headers and buffers network data, delaying notifications to its downstream ResourceHandler. 2- The BufferedResourceHandler decides if it is dealing with a download or not, and optionally installs a DownloadResourceHandler as the downstream handler. 3- The BufferedResourceHandler replays the OnResponseStarted and OnReadCompleted events to push data to its downstream handler. 4- The downstream handler might decide to defer processing. 5- When the downstream handler wants to resume processing, it needs to tell someone to Resume. At step 5, the complicated thing we do to ourselves today is we make that Resume step tell the ResourceLoader to resume instead of the BufferedResourceHandler. This causes problems for the BufferedResourceHandler as it may start receiving more network events before it has finished flushing its existing buffers to its downstream handler. This patch is a step toward fixing the above problem. It makes all handlers call Resume on their own controller when it is time to resume. A subsequent patch will leverage this to cleanup and simplify the BufferedResourceHandler as well as the overall pause/resume semantics of the ResourceLoader. Other cleanup in this patch: The {Async,Sync,CrossSite}ResourceHandler classes are now all constructed with an URLRequest. This avoids messy code to call ResourceDispatcherHostImpl::GetURLRequest(). Since the lifetime of ResourceHandlers is now bound to the lifetime of their associated URLRequest, this is a safe and simple change to make. Other ResourceHandlers, like the BufferedResourceHandler, were already holding onto their associated URLRequest. R=jam@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=143702

Patch Set 1 : #

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+360 lines, -235 lines) Patch
M content/browser/renderer_host/async_resource_handler.h View 1 4 chunks +23 lines, -4 lines 0 comments Download
M content/browser/renderer_host/async_resource_handler.cc View 1 10 chunks +79 lines, -26 lines 0 comments Download
M content/browser/renderer_host/buffered_resource_handler.cc View 1 chunk +0 lines, -7 lines 0 comments Download
M content/browser/renderer_host/cross_site_resource_handler.h View 4 chunks +6 lines, -5 lines 0 comments Download
M content/browser/renderer_host/cross_site_resource_handler.cc View 9 chunks +11 lines, -33 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_impl.h View 2 chunks +0 lines, -10 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_impl.cc View 1 9 chunks +69 lines, -107 lines 1 comment Download
M content/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 14 chunks +149 lines, -4 lines 0 comments Download
M content/browser/renderer_host/resource_loader.h View 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/resource_loader.cc View 1 chunk +0 lines, -12 lines 0 comments Download
M content/browser/renderer_host/resource_request_info_impl.h View 5 chunks +11 lines, -10 lines 0 comments Download
M content/browser/renderer_host/resource_request_info_impl.cc View 2 chunks +1 line, -1 line 0 comments Download
M content/browser/renderer_host/sync_resource_handler.h View 3 chunks +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/sync_resource_handler.cc View 4 chunks +8 lines, -13 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
darin (slow to review)
Take a look at the delta between patchset 1 and patchset 2. Patchset 1 is ...
8 years, 6 months ago (2012-06-22 19:10:40 UTC) #1
jam
lgtm
8 years, 6 months ago (2012-06-22 19:54:42 UTC) #2
darin (slow to review)
https://chromiumcodereview.appspot.com/10644011/diff/12017/content/browser/renderer_host/resource_dispatcher_host_impl.cc File content/browser/renderer_host/resource_dispatcher_host_impl.cc (right): https://chromiumcodereview.appspot.com/10644011/diff/12017/content/browser/renderer_host/resource_dispatcher_host_impl.cc#newcode1010 content/browser/renderer_host/resource_dispatcher_host_impl.cc:1010: scoped_ptr<ResourceHandler> handler; btw, the point of this code move ...
8 years, 6 months ago (2012-06-22 19:56:03 UTC) #3
Vitaly Buka (NO REVIEWS)
What is the reason to revert? On 2012/06/22 19:56:03, darin wrote: > https://chromiumcodereview.appspot.com/10644011/diff/12017/content/browser/renderer_host/resource_dispatcher_host_impl.cc > File ...
8 years, 5 months ago (2012-07-11 20:38:03 UTC) #4
darin (slow to review)
8 years, 5 months ago (2012-07-11 20:42:57 UTC) #5
On 2012/07/11 20:38:03, Vitaly Buka wrote:
> What is the reason to revert?

This is a revert of a revert.

Powered by Google App Engine
This is Rietveld 408576698