summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_error_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ssl/ssl_error_handler.cc')
-rw-r--r--chrome/browser/ssl/ssl_error_handler.cc72
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..c450a8e 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();
}
-