diff options
Diffstat (limited to 'chrome/browser/resource_dispatcher_host.cc')
-rw-r--r-- | chrome/browser/resource_dispatcher_host.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/resource_dispatcher_host.cc b/chrome/browser/resource_dispatcher_host.cc index edc9aca..60ba658 100644 --- a/chrome/browser/resource_dispatcher_host.cc +++ b/chrome/browser/resource_dispatcher_host.cc @@ -1745,7 +1745,16 @@ void ResourceDispatcherHost::CancelRequest(int render_process_host_id, info->login_handler->OnRequestCancelled(); info->login_handler = NULL; } - i->second->Cancel(); + if (!i->second->is_pending()) { + // No io is pending, canceling the request won't notify us of anything, + // so we explicitly remove it. + // TODO: removing the request in this manner means we're not notifying + // anyone. We need make sure the event handlers and others are notified + // so that everything is cleaned up properly. + RemovePendingRequest(info->render_process_host_id, info->request_id); + } else { + i->second->Cancel(); + } } // Do not remove from the pending requests, as the request will still |