| Index: content/browser/ssl/ssl_manager.cc
|
| diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
|
| index e4c71e3dc4e0f8b2c520afe4cb9d9979d51140d9..0a0f41bf2640d8d5486a7489a83fb86287372b96 100644
|
| --- a/content/browser/ssl/ssl_manager.cc
|
| +++ b/content/browser/ssl/ssl_manager.cc
|
| @@ -21,6 +21,7 @@
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/load_from_memory_cache_details.h"
|
| #include "content/public/browser/navigation_details.h"
|
| +#include "content/public/browser/navigation_entry.h"
|
| #include "content/public/browser/resource_request_details.h"
|
| #include "content/public/common/ssl_status.h"
|
| #include "net/url_request/url_request.h"
|
| @@ -79,6 +80,31 @@ void SSLManager::OnSSLCertificateError(
|
| }
|
|
|
| // static
|
| +void SSLManager::OnAuthDialog(int render_process_id,
|
| + int render_frame_id,
|
| + const std::string& serialized_security_info,
|
| + bool is_main_frame) {
|
| + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
| + BrowserThread::PostTask(
|
| + BrowserThread::UI, FROM_HERE,
|
| + base::Bind(SSLManager::OnAuthDialog, render_process_id, render_frame_id,
|
| + serialized_security_info, is_main_frame));
|
| + return;
|
| + }
|
| + RenderFrameHost* render_frame_host =
|
| + RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
|
| + WebContents* web_contents =
|
| + WebContents::FromRenderFrameHost(render_frame_host);
|
| + if (!web_contents)
|
| + return;
|
| + NavigationControllerImpl* controller =
|
| + static_cast<NavigationControllerImpl*>(&web_contents->GetController());
|
| + NavigationEntryImpl* entry = controller->GetPendingEntry();
|
| + controller->ssl_manager()->UpdateEntry(serialized_security_info,
|
| + is_main_frame, entry);
|
| +}
|
| +
|
| +// static
|
| void SSLManager::NotifySSLInternalStateChanged(BrowserContext* context) {
|
| SSLManagerSet* managers = static_cast<SSLManagerSet*>(
|
| context->GetUserData(kSSLManagerKeyName));
|
| @@ -111,14 +137,38 @@ SSLManager::~SSLManager() {
|
| }
|
|
|
| void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) {
|
| - NavigationEntryImpl* entry = controller_->GetLastCommittedEntry();
|
| -
|
| - if (details.is_main_frame) {
|
| - if (entry) {
|
| - // We may not have an entry if this is a navigation to an initial blank
|
| - // page. Add the new data we have.
|
| - entry->GetSSL() = details.ssl_status;
|
| - }
|
| + // NavigationEntryImpl* entry = controller_->GetLastCommittedEntry();
|
| + // UpdateEntry(details.serialized_security_info, details.is_main_frame,
|
| + // entry);
|
| + // TODO(palmer): Should make use of details.SSLStatus instead.
|
| +}
|
| +
|
| +void SSLManager::UpdateEntry(const std::string& serialized_security_info,
|
| + bool is_main_frame,
|
| + NavigationEntryImpl* entry) {
|
| + if (is_main_frame && entry) {
|
| + // Decode the security details.
|
| + int ssl_cert_id = 0;
|
| + net::CertStatus ssl_cert_status = 0;
|
| + int ssl_security_bits = 0;
|
| + int ssl_connection_status = 0;
|
| + SignedCertificateTimestampIDStatusList ssl_signed_certificate_timestamp_ids;
|
| + /*
|
| + DeserializeSecurityInfo(serialized_security_info, &ssl_cert_id,
|
| + &ssl_cert_status, &ssl_security_bits,
|
| + &ssl_connection_status,
|
| + &ssl_signed_certificate_timestamp_ids);
|
| + */
|
| +
|
| + // We may not have an entry if this is a navigation to an initial blank
|
| + // page. Reset the SSL information and add the new data we have.
|
| + entry->GetSSL() = SSLStatus();
|
| + entry->GetSSL().cert_id = ssl_cert_id;
|
| + entry->GetSSL().cert_status = ssl_cert_status;
|
| + entry->GetSSL().security_bits = ssl_security_bits;
|
| + entry->GetSSL().connection_status = ssl_connection_status;
|
| + entry->GetSSL().signed_certificate_timestamp_ids =
|
| + ssl_signed_certificate_timestamp_ids;
|
| }
|
|
|
| policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents());
|
|
|