diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 07:50:35 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 07:50:35 +0000 |
commit | 67039c734e08c5c1b04f8bc1a98c81dc675bd7ab (patch) | |
tree | 8301bd3453b40271330ad2e13a17366ef21a3435 /chrome/browser/ssl/ssl_error_handler.cc | |
parent | 7b391ba2938aaaf7ebb3e2ad04c78c88c26b74ea (diff) | |
download | chromium_src-67039c734e08c5c1b04f8bc1a98c81dc675bd7ab.zip chromium_src-67039c734e08c5c1b04f8bc1a98c81dc675bd7ab.tar.gz chromium_src-67039c734e08c5c1b04f8bc1a98c81dc675bd7ab.tar.bz2 |
Resubmit 16044 with typo fixed.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16046 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, 34 insertions, 38 deletions
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index b5b435b..3319f26 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc @@ -50,9 +50,7 @@ SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, void SSLErrorHandler::Dispatch() { DCHECK(MessageLoop::current() == ui_loop_); - TabContents* tab_contents = - tab_util::GetTabContentsByID(render_process_host_id_, tab_contents_id_); - + TabContents* tab_contents = GetTabContents(); if (!tab_contents) { // We arrived on the UI thread, but the tab we're looking for is no longer // here. @@ -119,24 +117,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; - 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(); + 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(); } void SSLErrorHandler::CompleteContinueRequest() { @@ -146,20 +144,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; - 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(); + 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(); } void SSLErrorHandler::CompleteStartRequest(FilterPolicy::Type filter_policy) { @@ -169,7 +167,6 @@ 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; @@ -198,12 +195,11 @@ 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; - if (!request_has_been_notified_) { - request_has_been_notified_ = true; + 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(); } - |