summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ssl')
-rw-r--r--chrome/browser/ssl/ssl_cert_error_handler.h3
-rw-r--r--chrome/browser/ssl/ssl_error_handler.cc72
-rw-r--r--chrome/browser/ssl/ssl_mixed_content_handler.h1
-rw-r--r--chrome/browser/ssl/ssl_policy.h6
4 files changed, 40 insertions, 42 deletions
diff --git a/chrome/browser/ssl/ssl_cert_error_handler.h b/chrome/browser/ssl/ssl_cert_error_handler.h
index 632927b..2dd557e4 100644
--- a/chrome/browser/ssl/ssl_cert_error_handler.h
+++ b/chrome/browser/ssl/ssl_cert_error_handler.h
@@ -43,11 +43,12 @@ class SSLCertErrorHandler : public SSLErrorHandler {
const net::SSLInfo& ssl_info() const { return ssl_info_; }
int cert_error() const { return cert_error_; }
- private:
+ protected:
// SSLErrorHandler methods
virtual void OnDispatchFailed() { CancelRequest(); }
virtual void OnDispatched() { manager_->OnCertError(this); }
+ private:
// These read-only members may be accessed on any thread.
net::SSLInfo ssl_info_;
const int cert_error_; // The error we represent.
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();
}
-
diff --git a/chrome/browser/ssl/ssl_mixed_content_handler.h b/chrome/browser/ssl/ssl_mixed_content_handler.h
index afb7e13..c3f9057 100644
--- a/chrome/browser/ssl/ssl_mixed_content_handler.h
+++ b/chrome/browser/ssl/ssl_mixed_content_handler.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_SSL_SSL_MIXED_CONTENT_HANDLER_H_
#include "chrome/browser/ssl/ssl_error_handler.h"
+#include "chrome/browser/ssl/ssl_manager.h"
// The SSLMixedContentHandler class is used to query what to do with
// mixed content, from the IO thread to the UI thread.
diff --git a/chrome/browser/ssl/ssl_policy.h b/chrome/browser/ssl/ssl_policy.h
index 570783f..204a96e 100644
--- a/chrome/browser/ssl/ssl_policy.h
+++ b/chrome/browser/ssl/ssl_policy.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SSL_POLICY_H_
-#define CHROME_BROWSER_SSL_POLICY_H_
+#ifndef CHROME_BROWSER_SSL_SSL_POLICY_H_
+#define CHROME_BROWSER_SSL_SSL_POLICY_H_
#include "base/singleton.h"
#include "chrome/browser/ssl/ssl_blocking_page.h"
@@ -56,4 +56,4 @@ class SSLPolicy : public SSLManager::Delegate,
DISALLOW_COPY_AND_ASSIGN(SSLPolicy);
};
-#endif // CHROME_BROWSER_SSL_POLICY_H_
+#endif // CHROME_BROWSER_SSL_SSL_POLICY_H_