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 | |
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')
-rw-r--r-- | chrome/browser/ssl/ssl_cert_error_handler.h | 3 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_error_handler.cc | 72 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_mixed_content_handler.h | 1 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_policy.h | 6 |
4 files changed, 42 insertions, 40 deletions
diff --git a/chrome/browser/ssl/ssl_cert_error_handler.h b/chrome/browser/ssl/ssl_cert_error_handler.h index 2dd557e4..632927b 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.h +++ b/chrome/browser/ssl/ssl_cert_error_handler.h @@ -43,12 +43,11 @@ class SSLCertErrorHandler : public SSLErrorHandler { const net::SSLInfo& ssl_info() const { return ssl_info_; } int cert_error() const { return cert_error_; } - protected: + private: // 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 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(); + } } + diff --git a/chrome/browser/ssl/ssl_mixed_content_handler.h b/chrome/browser/ssl/ssl_mixed_content_handler.h index c3f9057..afb7e13 100644 --- a/chrome/browser/ssl/ssl_mixed_content_handler.h +++ b/chrome/browser/ssl/ssl_mixed_content_handler.h @@ -6,7 +6,6 @@ #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 204a96e..570783f 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_SSL_POLICY_H_ -#define CHROME_BROWSER_SSL_SSL_POLICY_H_ +#ifndef CHROME_BROWSER_SSL_POLICY_H_ +#define CHROME_BROWSER_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_SSL_POLICY_H_ +#endif // CHROME_BROWSER_SSL_POLICY_H_ |