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 b8258b664b497d738eeb121d887ae66bc3690897..f04ee55706e6b60f880ab3ba3bde54073379b41f 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -416,6 +416,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() {} |
@@ -1189,8 +1199,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 |
@@ -2594,8 +2604,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; |
@@ -2608,8 +2619,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->IsMainFrame()) |
+ 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() { |