Index: content/browser/loader/resource_dispatcher_host_impl.cc |
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
index f4ae9b56475e71fe8d99865b0c280e63ef639781..96076f9ffc21099a0077efaf45fa4b5b94b2cf41 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -422,6 +422,16 @@ void NotifyForEachFrameFromUI( |
base::Passed(std::move(routing_ids)))); |
} |
+void SetTransferredRFHSSLStatus(int render_process_id, |
+ int render_frame_id, |
+ const GURL& url, |
+ const SSLStatus& ssl_status) { |
+ RenderFrameHostImpl* rfh = |
+ RenderFrameHostImpl::FromID(render_process_id, render_frame_id); |
+ if (rfh) |
+ rfh->SetSSLStatusForPendingNavigate(url, ssl_status); |
+} |
+ |
} // namespace |
ResourceDispatcherHostImpl::HeaderInterceptorInfo::HeaderInterceptorInfo() {} |
@@ -1208,8 +1218,8 @@ void ResourceDispatcherHostImpl::UpdateRequestForTransfer( |
// updated to be associated with the new process. |
if (loader->transferring_response()) { |
UpdateResponseCertificateForTransfer(loader->transferring_response(), |
- loader->request()->ssl_info(), |
- child_id); |
+ loader->request(), |
+ info); |
} |
// Update maps that used the old IDs, if necessary. Some transfers in tests |
@@ -2648,8 +2658,9 @@ int ResourceDispatcherHostImpl::BuildLoadFlagsForRequest( |
void ResourceDispatcherHostImpl::UpdateResponseCertificateForTransfer( |
ResourceResponse* response, |
- const net::SSLInfo& ssl_info, |
- int child_id) { |
+ net::URLRequest* request, |
+ ResourceRequestInfoImpl* info) { |
+ const net::SSLInfo& ssl_info = request->ssl_info(); |
if (!ssl_info.cert) |
return; |
SSLStatus ssl; |
@@ -2662,8 +2673,28 @@ void ResourceDispatcherHostImpl::UpdateResponseCertificateForTransfer( |
bool deserialized = |
DeserializeSecurityInfo(response->head.security_info, &ssl); |
DCHECK(deserialized); |
- ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); |
+ ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), |
+ info->GetChildID()); |
response->head.security_info = SerializeSecurityInfo(ssl); |
+ |
+ if (info->GetResourceType() != RESOURCE_TYPE_MAIN_FRAME) |
+ return; |
+ |
+ // TODO(jam): eventually we'll get rid of this serialized SSLStatus in the |
+ // response and won't send it to the child process. So for preparation, don't |
+ // use it below. |
+ SSLStatus ssl_status; |
+ ResourceLoader::GetSSLStatusForRequest( |
+ request->url(), ssl_info, info->GetChildID(), |
+ ResourceDispatcherHostImpl::Get()->GetCertStore(), &ssl_status); |
+ |
+ BrowserThread::PostTask(BrowserThread::UI, |
+ FROM_HERE, |
+ base::Bind(SetTransferredRFHSSLStatus, |
+ info->GetChildID(), |
+ info->GetRenderFrameID(), |
+ request->url(), |
+ ssl_status)); |
} |
CertStore* ResourceDispatcherHostImpl::GetCertStore() { |