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

Issue 6713008: Don't destroy a request while it is being processed (Closed)

Created:
9 years, 9 months ago by asanka
Modified:
9 years, 7 months ago
CC:
chromium-reviews, jam, brettw-cc_chromium.org, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

If ResourceDispatcherHost receives a CancelRequest, it should call OnResponseComplete() only if the cancellation is actually processed. Otherwise, it might destroy a request that is still active. In addition, make sure DownloadRequestLimiter::Callback is only invoked from the IO thread and prevent DownloadThrottlingResourceHandler from processing callbacks after the request has been closed. BUG=76202 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78983

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Fix unit test #

Patch Set 4 : . #

Total comments: 6

Patch Set 5 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -42 lines) Patch
M chrome/browser/download/download_request_limiter.h View 3 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/download/download_request_limiter.cc View 4 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/download/download_request_limiter_unittest.cc View 1 2 1 chunk +1 line, -5 lines 0 comments Download
M chrome/browser/renderer_host/download_throttling_resource_handler.h View 1 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/download_throttling_resource_handler.cc View 9 chunks +41 lines, -25 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.h View 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 2 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
asanka
See http://crbug.com/76202 for what we are trying to avoid. The core part of the fix ...
9 years, 9 months ago (2011-03-19 12:52:43 UTC) #1
asanka
[+skylined]
9 years, 9 months ago (2011-03-21 16:57:33 UTC) #2
Randy Smith (Not in Mondays)
LGTM, but to me the key section of this CL is about the protocol for ...
9 years, 9 months ago (2011-03-21 17:31:01 UTC) #3
lzheng
I can not access: http://crbug.com/76202. Is it possible the link is wrong? I am trying ...
9 years, 9 months ago (2011-03-21 21:02:53 UTC) #4
rvargas (doing something else)
lzheng: try now. On Mon, Mar 21, 2011 at 2:02 PM, <lzheng@chromium.org> wrote: > I ...
9 years, 9 months ago (2011-03-21 21:09:21 UTC) #5
rvargas (doing something else)
Please add a test for this. It doesn't have to be part of this CL ...
9 years, 9 months ago (2011-03-21 22:38:10 UTC) #6
lzheng
LGTM. Echo the need for a test. Otherwise, we won't know when this is broken ...
9 years, 9 months ago (2011-03-21 22:54:02 UTC) #7
asanka
Thanks for the reviews! I'll add a test in a separate CL. http://codereview.chromium.org/6713008/diff/4001/chrome/browser/renderer_host/download_throttling_resource_handler.cc File chrome/browser/renderer_host/download_throttling_resource_handler.cc ...
9 years, 9 months ago (2011-03-22 14:52:42 UTC) #8
Randy Smith (Not in Mondays)
9 years, 9 months ago (2011-03-22 14:55:45 UTC) #9
http://codereview.chromium.org/6713008/diff/4001/chrome/browser/renderer_host...
File chrome/browser/renderer_host/download_throttling_resource_handler.cc
(right):

http://codereview.chromium.org/6713008/diff/4001/chrome/browser/renderer_host...
chrome/browser/renderer_host/download_throttling_resource_handler.cc:172: if
(!request_closed_) {
On 2011/03/22 14:52:42, asanka wrote:
> On 2011/03/21 17:31:01, rdsmith wrote:
> > nit: I'd suggest restructuring this routing by putting the Release() at the
> > beginning and then inverting the request_closed_ test and doing a return at
> that
> > point, just to reduce indenting and make the unindented code by the common
> path.
> 
> It's not very pretty, but as rvargas points out, once we call Release() we
have
> no guarantee that we can safely access any members.

Fair enough; destruction could happen right then, couldn't it?  Never mind.

Powered by Google App Engine
This is Rietveld 408576698