summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-06 19:56:12 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-06 19:56:12 +0000
commit63f3e1d4a52b91470609455d59b3b4ef8f81b3ad (patch)
tree6157d8bfdf5557a793d3ed223c0815bf7e28cdda /chrome/browser
parent5bf46dbf64e933055fe740d596be8ff2d33d274d (diff)
downloadchromium_src-63f3e1d4a52b91470609455d59b3b4ef8f81b3ad.zip
chromium_src-63f3e1d4a52b91470609455d59b3b4ef8f81b3ad.tar.gz
chromium_src-63f3e1d4a52b91470609455d59b3b4ef8f81b3ad.tar.bz2
Fix renderer hang that occurs when a RenderWidget with outstanding synchronous XHR requests is closed. Currently we cancel all the pending URLRequestJobs, however at that point it doesn't have a pointer to get to the SyncResourceHandler object.
BUG=1575301 Review URL: http://codereview.chromium.org/39246 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/sync_resource_handler.cc9
-rw-r--r--chrome/browser/renderer_host/sync_resource_handler.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/sync_resource_handler.cc b/chrome/browser/renderer_host/sync_resource_handler.cc
index c21e7e7..cc74b2d 100644
--- a/chrome/browser/renderer_host/sync_resource_handler.cc
+++ b/chrome/browser/renderer_host/sync_resource_handler.cc
@@ -16,6 +16,14 @@ SyncResourceHandler::SyncResourceHandler(
result_.filter_policy = FilterPolicy::DONT_FILTER;
}
+SyncResourceHandler::~SyncResourceHandler() {
+ if (!result_message_)
+ return;
+
+ result_message_->set_reply_error();
+ receiver_->Send(result_message_);
+}
+
bool SyncResourceHandler::OnRequestRedirected(int request_id,
const GURL& new_url) {
result_.final_url = new_url;
@@ -52,5 +60,6 @@ bool SyncResourceHandler::OnResponseCompleted(int request_id,
ViewHostMsg_SyncLoad::WriteReplyParams(result_message_, result_);
receiver_->Send(result_message_);
+ result_message_ = NULL;
return true;
}
diff --git a/chrome/browser/renderer_host/sync_resource_handler.h b/chrome/browser/renderer_host/sync_resource_handler.h
index 82cebbc..deb7746 100644
--- a/chrome/browser/renderer_host/sync_resource_handler.h
+++ b/chrome/browser/renderer_host/sync_resource_handler.h
@@ -16,6 +16,7 @@ class SyncResourceHandler : public ResourceHandler {
SyncResourceHandler(ResourceDispatcherHost::Receiver* receiver,
const GURL& url,
IPC::Message* result_message);
+ ~SyncResourceHandler();
bool OnRequestRedirected(int request_id, const GURL& new_url);
bool OnResponseStarted(int request_id, ResourceResponse* response);