diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-27 18:42:21 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-27 18:42:21 +0000 |
commit | 5b0ae24406c5cf0e587b05592256629e5aae31f2 (patch) | |
tree | e4329e9467359c593bfe3898141be19a2b2d4796 /chrome/browser/renderer_host/resource_dispatcher_host.cc | |
parent | d538c88b79c25e77f1449091238a7065bf2bf6a8 (diff) | |
download | chromium_src-5b0ae24406c5cf0e587b05592256629e5aae31f2.zip chromium_src-5b0ae24406c5cf0e587b05592256629e5aae31f2.tar.gz chromium_src-5b0ae24406c5cf0e587b05592256629e5aae31f2.tar.bz2 |
Fix renderer hang caused when a synchronous XHR is disallowed for security
reasons (via ShouldServiceReqeuest).
BUG=8401
R=jam
Review URL: http://codereview.chromium.org/56016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/resource_dispatcher_host.cc')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index da28df4..998850d5 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -274,13 +274,21 @@ void ResourceDispatcherHost::BeginRequest( if (is_shutdown_ || !ShouldServiceRequest(process_type, process_id, request_data)) { - // Tell the renderer that this request was disallowed. - receiver_->Send(new ViewMsg_Resource_RequestComplete( - route_id, - request_id, - URLRequestStatus(URLRequestStatus::FAILED, net::ERR_ABORTED), - std::string())); // No security info needed, connection was not - // established. + URLRequestStatus status(URLRequestStatus::FAILED, net::ERR_ABORTED); + if (sync_result) { + SyncLoadResult result; + result.status = status; + ViewHostMsg_SyncLoad::WriteReplyParams(sync_result, result); + receiver_->Send(sync_result); + } else { + // Tell the renderer that this request was disallowed. + receiver_->Send(new ViewMsg_Resource_RequestComplete( + route_id, + request_id, + status, + std::string())); // No security info needed, connection was not + // established. + } return; } |