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

Issue 10332130: Use defer out-params instead of ResourceDispatcherHostImpl::PauseRequest(...true) (Closed)

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

Description

Add defer out params to ResourceHandler's OnResponseStarted and OnReadCompleted methods. Use that to pause the request instead of directly calling ResourceDispatcherHostImpl's PauseRequest function. Eliminate direct calls to PauseRequest, with the exception of resource_dispatcher_host_unittest.cc and some uses internal to ResourceDispatcherHostImpl. Those should ultimately be changed to use the defer out-param approach too. This CL also changes the DownloadRequestHandle to talk back to the DownloadResourceHandler in order to pause / resume / cancel the URLRequest. The handle keeps a reference to the handler, which may extend the lifetime of the handler, but that should be OK given that the handler already supports having its lifetime extended beyond the URLRequest. Now, instead of the DownloadFileManager calling PauseRequest, we just wait for the SetDownloadID call to resume the URLRequest. This simplifies some of the logic. The Pause/ResumeRequest issued on a DownloadRequestHandle gets its own pause counter, which has nothing to do with the internal pausing that the DownloadResourceHandler does when it is waiting for a DownloadId. See DownloadResourceHandler::MaybeResumeRequest for the logic that handles the conditions for resuming the URLRequest. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138111

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 4

Patch Set 7 : #

Patch Set 8 : #

Total comments: 17

Patch Set 9 : #

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+408 lines, -282 lines) Patch
M content/browser/download/download_file_manager.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/download/download_request_handle.h View 1 2 3 4 5 6 7 8 4 chunks +8 lines, -1 line 0 comments Download
M content/browser/download/download_request_handle.cc View 1 2 3 4 5 6 7 8 3 chunks +12 lines, -39 lines 0 comments Download
M content/browser/download/download_resource_handler.h View 1 2 3 4 5 6 7 8 5 chunks +22 lines, -14 lines 0 comments Download
M content/browser/download/download_resource_handler.cc View 1 2 3 4 5 6 7 8 10 chunks +110 lines, -48 lines 0 comments Download
M content/browser/download/save_file_resource_handler.h View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -3 lines 0 comments Download
M content/browser/download/save_file_resource_handler.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -3 lines 0 comments Download
M content/browser/renderer_host/async_resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/async_resource_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/buffered_resource_handler.h View 1 2 3 4 5 6 7 8 4 chunks +9 lines, -5 lines 0 comments Download
M content/browser/renderer_host/buffered_resource_handler.cc View 1 2 3 4 5 6 7 8 9 12 chunks +54 lines, -53 lines 0 comments Download
M content/browser/renderer_host/cross_site_resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -3 lines 0 comments Download
M content/browser/renderer_host/cross_site_resource_handler.cc View 1 2 3 4 5 6 7 8 7 chunks +30 lines, -20 lines 0 comments Download
M content/browser/renderer_host/doomed_resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/doomed_resource_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/layered_resource_handler.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/layered_resource_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -4 lines 0 comments Download
M content/browser/renderer_host/redirect_to_file_resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/redirect_to_file_resource_handler.cc View 1 2 3 4 5 6 7 8 5 chunks +16 lines, -12 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_impl.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -3 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 5 chunks +54 lines, -35 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +10 lines, -4 lines 0 comments Download
M content/browser/renderer_host/sync_resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/sync_resource_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/throttling_resource_handler.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/throttling_resource_handler.cc View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -10 lines 0 comments Download
M content/browser/renderer_host/x509_user_cert_resource_handler.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/x509_user_cert_resource_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Randy Smith (Not in Mondays)
Did a quick, high level scan, primarily focussing on downloads. Overall approach looks good. Happy ...
8 years, 7 months ago (2012-05-17 15:53:48 UTC) #1
darin (slow to review)
http://codereview.chromium.org/10332130/diff/40/content/browser/download/download_request_handle.h File content/browser/download/download_request_handle.h (right): http://codereview.chromium.org/10332130/diff/40/content/browser/download/download_request_handle.h#newcode76 content/browser/download/download_request_handle.h:76: scoped_refptr<DownloadResourceHandler> handler_; On 2012/05/17 15:53:48, rdsmith wrote: > Shouldn't ...
8 years, 7 months ago (2012-05-17 21:17:57 UTC) #2
darin (slow to review)
Ready for review, thanks!
8 years, 7 months ago (2012-05-17 21:34:01 UTC) #3
Randy Smith (Not in Mondays)
Looks fairly good. You might want to get another reviewer for cross_site_resource_handler.cc; I did review ...
8 years, 7 months ago (2012-05-18 20:17:02 UTC) #4
darin (slow to review)
http://codereview.chromium.org/10332130/diff/2016/content/browser/download/download_resource_handler.cc File content/browser/download/download_resource_handler.cc (right): http://codereview.chromium.org/10332130/diff/2016/content/browser/download/download_resource_handler.cc#newcode384 content/browser/download/download_resource_handler.cc:384: download_file_manager_->StartDownload(info.release(), handle); DownloadFileManager::StartDownload() gets called on the UI thread ...
8 years, 7 months ago (2012-05-18 23:09:04 UTC) #5
Randy Smith (Not in Mondays)
LGTM with changes agreed to. http://codereview.chromium.org/10332130/diff/2016/content/browser/download/download_resource_handler.cc File content/browser/download/download_resource_handler.cc (right): http://codereview.chromium.org/10332130/diff/2016/content/browser/download/download_resource_handler.cc#newcode384 content/browser/download/download_resource_handler.cc:384: download_file_manager_->StartDownload(info.release(), handle); On 2012/05/18 ...
8 years, 7 months ago (2012-05-19 00:42:14 UTC) #6
jam
8 years, 7 months ago (2012-05-21 15:35:03 UTC) #7
lgtm

Powered by Google App Engine
This is Rietveld 408576698