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

Issue 12602: Fix for 1498134, possible crash when cancelling a url request. The... (Closed)

Created:
12 years, 1 month ago by sky
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Fix for 1498134, possible crash when cancelling a url request. The crash happened because OnReadCompleted would invoke CompleteRead which might invoke CancelRequest and delete the request. If this happened when control returned back to OnReadCompleted the request was deleted, yet ResourceDispatcherHost assumed it wasn't. BUG=1498134 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=5989

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -2 lines) Patch
M chrome/browser/resource_dispatcher_host.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/resource_dispatcher_host.cc View 1 3 chunks +21 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
sky
12 years, 1 month ago (2008-11-24 18:50:01 UTC) #1
darin (slow to review)
OK, seems like a safe change to me.
12 years, 1 month ago (2008-11-24 18:54:09 UTC) #2
eroman
LGTM http://codereview.chromium.org/12602/diff/1/2 File chrome/browser/resource_dispatcher_host.cc (right): http://codereview.chromium.org/12602/diff/1/2#newcode1732 Line 1732: CancelRequest(render_process_host_id, request_id, from_renderer, true); I would recommend ...
12 years, 1 month ago (2008-11-24 19:16:19 UTC) #3
sky
New snapshot uploaded. http://codereview.chromium.org/12602/diff/1/2 File chrome/browser/resource_dispatcher_host.cc (right): http://codereview.chromium.org/12602/diff/1/2#newcode1732 Line 1732: CancelRequest(render_process_host_id, request_id, from_renderer, true); On ...
12 years, 1 month ago (2008-11-24 19:36:39 UTC) #4
wtc
I have some incoherent comments below (I wrote them as I tried to understand the ...
12 years, 1 month ago (2008-11-24 19:43:48 UTC) #5
wtc
12 years, 1 month ago (2008-11-24 19:58:49 UTC) #6
Let me elaborate on my previous comment.

I was unhappy that I couldn't decide whether the other two
calls of CancelRequest
(ResourceDispatcherHost::OnReceivedRedirect
and ResourceDispatcherHost::OnResponseStarted) need the
same change.  So I considered alternative solutions.

I first looked into if we can just call i->second->Cancel(),
and change URLRequest::CancelWithError to call job_->Kill()
even if is_pending_ is false.  The problem with this
approach is that I am worried some delegate of URLRequest
may not want to be notified done twice.  I couldn't
answer this question myself.  If you know it's fine for
a URLRequest delegate to be notified done twice, then this
may be the best solution.

Then I came up with the idea of calling
MessageLoop::current()->PostTask(&ResourceDispatcherHost::RemovePendingRequest).
What I like about this solution is that I can almost
explain it completely.

Powered by Google App Engine
This is Rietveld 408576698