diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 07:10:53 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 07:10:53 +0000 |
commit | 7b391ba2938aaaf7ebb3e2ad04c78c88c26b74ea (patch) | |
tree | 944c1af45521b01498fae7f92a3657277e152ca6 /chrome/browser/ssl/ssl_error_handler.cc | |
parent | 2647ad420d10f27cff7b44021916011ae17594f0 (diff) | |
download | chromium_src-7b391ba2938aaaf7ebb3e2ad04c78c88c26b74ea.zip chromium_src-7b391ba2938aaaf7ebb3e2ad04c78c88c26b74ea.tar.gz chromium_src-7b391ba2938aaaf7ebb3e2ad04c78c88c26b74ea.tar.bz2 |
Revert 16044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_error_handler.cc')
-rw-r--r-- | chrome/browser/ssl/ssl_error_handler.cc | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index c450a8e..b5b435b 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc @@ -50,7 +50,9 @@ SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, void SSLErrorHandler::Dispatch() { DCHECK(MessageLoop::current() == ui_loop_); - TabContents* tab_contents = GetTabContents(); + TabContents* tab_contents = + tab_util::GetTabContentsByID(render_process_host_id_, tab_contents_id_); + if (!tab_contents) { // We arrived on the UI thread, but the tab we're looking for is no longer // here. @@ -117,24 +119,24 @@ void SSLErrorHandler::CompleteCancelRequest(int error) { // notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); - if (!request_has_been_notified_) - return; - URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); - if (request) { - // The request can be NULL if it was cancelled by the renderer (as the - // result of the user navigating to a new page from the location bar). - DLOG(INFO) << "CompleteCancelRequest() url: " << request->url().spec(); - SSLCertErrorHandler* cert_error = AsSSLCertErrorHandler(); - if (cert_error) - request->SimulateSSLError(error, cert_error->ssl_info()); - else - request->SimulateError(error); + if (!request_has_been_notified_) { + URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); + if (request) { + // The request can be NULL if it was cancelled by the renderer (as the + // result of the user navigating to a new page from the location bar). + DLOG(INFO) << "CompleteCancelRequest() url: " << request->url().spec(); + SSLCertErrorHandler* cert_error = AsSSLCertErrorHandler(); + if (cert_error) + request->SimulateSSLError(error, cert_error->ssl_info()); + else + request->SimulateError(error); + } + request_has_been_notified_ = true; + + // We're done with this object on the IO thread. + Release(); } - request_has_been_notified_ = true; - - // We're done with this object on the IO thread. - Release(); } void SSLErrorHandler::CompleteContinueRequest() { @@ -144,20 +146,20 @@ void SSLErrorHandler::CompleteContinueRequest() { // notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); - if (request_has_been_notified_) - return; - URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); - if (request) { - // The request can be NULL if it was cancelled by the renderer (as the - // result of the user navigating to a new page from the location bar). - DLOG(INFO) << "CompleteContinueRequest() url: " << request->url().spec(); - request->ContinueDespiteLastError(); + if (!request_has_been_notified_) { + URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); + if (request) { + // The request can be NULL if it was cancelled by the renderer (as the + // result of the user navigating to a new page from the location bar). + DLOG(INFO) << "CompleteContinueRequest() url: " << request->url().spec(); + request->ContinueDespiteLastError(); + } + request_has_been_notified_ = true; + + // We're done with this object on the IO thread. + Release(); } - request_has_been_notified_ = true; - - // We're done with this object on the IO thread. - Release(); } void SSLErrorHandler::CompleteStartRequest(FilterPolicy::Type filter_policy) { @@ -167,6 +169,7 @@ void SSLErrorHandler::CompleteStartRequest(FilterPolicy::Type filter_policy) { // notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); + if (request_has_been_notified_) return; @@ -195,11 +198,12 @@ void SSLErrorHandler::CompleteTakeNoAction() { // notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); - if (request_has_been_notified_) - return; - request_has_been_notified_ = true; + if (!request_has_been_notified_) { + request_has_been_notified_ = true; - // We're done with this object on the IO thread. - Release(); + // We're done with this object on the IO thread. + Release(); + } } + |