| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/ssl/ssl_manager.h" | 5 #include "content/browser/ssl/ssl_manager.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 DISALLOW_COPY_AND_ASSIGN(SSLManagerSet); | 44 DISALLOW_COPY_AND_ASSIGN(SSLManagerSet); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 // static | 49 // static |
| 50 void SSLManager::OnSSLCertificateError( | 50 void SSLManager::OnSSLCertificateError( |
| 51 const base::WeakPtr<SSLErrorHandler::Delegate>& delegate, | 51 const base::WeakPtr<SSLErrorHandler::Delegate>& delegate, |
| 52 const ResourceType resource_type, | 52 const ResourceType resource_type, |
| 53 const GURL& url, | 53 const GURL& url, |
| 54 int render_process_id, | 54 const ResourceRequestInfo::WebContentsGetterOnUI& web_contents_getter, |
| 55 int render_frame_id, | |
| 56 const net::SSLInfo& ssl_info, | 55 const net::SSLInfo& ssl_info, |
| 57 bool fatal) { | 56 bool fatal) { |
| 58 DCHECK(delegate.get()); | 57 DCHECK(delegate.get()); |
| 59 DVLOG(1) << "OnSSLCertificateError() cert_error: " | 58 DVLOG(1) << "OnSSLCertificateError() cert_error: " |
| 60 << net::MapCertStatusToNetError(ssl_info.cert_status) | 59 << net::MapCertStatusToNetError(ssl_info.cert_status) |
| 61 << " resource_type: " << resource_type | 60 << " resource_type: " << resource_type |
| 62 << " url: " << url.spec() | 61 << " url: " << url.spec() |
| 63 << " render_process_id: " << render_process_id | |
| 64 << " render_frame_id: " << render_frame_id | |
| 65 << " cert_status: " << std::hex << ssl_info.cert_status; | 62 << " cert_status: " << std::hex << ssl_info.cert_status; |
| 66 | 63 |
| 67 // A certificate error occurred. Construct a SSLCertErrorHandler object and | 64 // A certificate error occurred. Construct a SSLCertErrorHandler object and |
| 68 // hand it over to the UI thread for processing. | 65 // hand it over to the UI thread for processing. |
| 69 BrowserThread::PostTask( | 66 BrowserThread::PostTask( |
| 70 BrowserThread::UI, FROM_HERE, | 67 BrowserThread::UI, FROM_HERE, |
| 71 base::Bind(&SSLCertErrorHandler::Dispatch, | 68 base::Bind(&SSLCertErrorHandler::Dispatch, |
| 72 new SSLCertErrorHandler(delegate, | 69 new SSLCertErrorHandler(delegate, |
| 73 resource_type, | 70 resource_type, |
| 74 url, | 71 url, |
| 75 render_process_id, | 72 web_contents_getter, |
| 76 render_frame_id, | |
| 77 ssl_info, | 73 ssl_info, |
| 78 fatal))); | 74 fatal))); |
| 79 } | 75 } |
| 80 | 76 |
| 81 // static | 77 // static |
| 82 void SSLManager::NotifySSLInternalStateChanged(BrowserContext* context) { | 78 void SSLManager::NotifySSLInternalStateChanged(BrowserContext* context) { |
| 83 SSLManagerSet* managers = static_cast<SSLManagerSet*>( | 79 SSLManagerSet* managers = static_cast<SSLManagerSet*>( |
| 84 context->GetUserData(kSSLManagerKeyName)); | 80 context->GetUserData(kSSLManagerKeyName)); |
| 85 | 81 |
| 86 for (std::set<SSLManager*>::iterator i = managers->get().begin(); | 82 for (std::set<SSLManager*>::iterator i = managers->get().begin(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 NotifyDidChangeVisibleSSLState(); | 189 NotifyDidChangeVisibleSSLState(); |
| 194 } | 190 } |
| 195 | 191 |
| 196 void SSLManager::NotifyDidChangeVisibleSSLState() { | 192 void SSLManager::NotifyDidChangeVisibleSSLState() { |
| 197 WebContentsImpl* contents = | 193 WebContentsImpl* contents = |
| 198 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); | 194 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); |
| 199 contents->DidChangeVisibleSSLState(); | 195 contents->DidChangeVisibleSSLState(); |
| 200 } | 196 } |
| 201 | 197 |
| 202 } // namespace content | 198 } // namespace content |
| OLD | NEW |