From 11149bd45e6450e6d3a872d7b30a2b155dbded52 Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Thu, 10 Jun 2010 16:31:04 +0000 Subject: UseAlternateResourceHandler should set the non-owning pointer to the CrossSiteResourceHandler in the extra request info to NULL when it deletes the original ResourceHandler chain. R=brettw,jschuh BUG=46126 TEST=See bug report. Review URL: http://codereview.chromium.org/2787005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49411 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/buffered_resource_handler.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index adaea34..3943896 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -304,7 +304,6 @@ bool BufferedResourceHandler::CompleteResponseStarted(int request_id, // Check if this is an X.509 certificate, if yes, let it be handled // by X509UserCertResourceHandler. if (mime_type == "application/x-x509-user-cert") { - // This is entirely similar to how DownloadThrottlingResourceHandler // works except we are doing it for an X.509 client certificates. @@ -457,6 +456,11 @@ void BufferedResourceHandler::UseAlternateResourceHandler( URLRequestStatus status(URLRequestStatus::HANDLED_EXTERNALLY, 0); real_handler_->OnResponseCompleted(info->request_id(), status, std::string()); + // Remove the non-owning pointer to the CrossSiteResourceHandler, if any, + // from the extra request info because the CrossSiteResourceHandler (part of + // the original ResourceHandler chain) will be deleted by the next statement. + info->set_cross_site_handler(NULL); + // This is handled entirely within the new ResourceHandler, so just reset the // original ResourceHandler. real_handler_ = handler; -- cgit v1.1