Index: content/browser/service_worker/service_worker_url_loader_job.cc |
diff --git a/content/browser/service_worker/service_worker_url_loader_job.cc b/content/browser/service_worker/service_worker_url_loader_job.cc |
index 70e925b9b8649470129bf89410f89c8c082def2a..271a1ce73f9c75bfcb06c37a8e15a1b5617476ce 100644 |
--- a/content/browser/service_worker/service_worker_url_loader_job.cc |
+++ b/content/browser/service_worker/service_worker_url_loader_job.cc |
@@ -182,9 +182,8 @@ void ServiceWorkerURLLoaderJob::SaveResponseHeaders( |
void ServiceWorkerURLLoaderJob::CommitResponseHeaders() { |
DCHECK_EQ(Status::kStarted, status_); |
status_ = Status::kSentHeader; |
- url_loader_client_->OnReceiveResponse( |
- response_head_, base::nullopt /* TODO(scottmg): ssl info */, |
- mojom::DownloadedTempFilePtr()); |
+ url_loader_client_->OnReceiveResponse(response_head_, ssl_info_, |
+ mojom::DownloadedTempFilePtr()); |
} |
void ServiceWorkerURLLoaderJob::CommitCompleted(int error_code) { |
@@ -247,6 +246,15 @@ void ServiceWorkerURLLoaderJob::DidDispatchFetchEvent( |
return; |
} |
+ // Creates a new HttpResponseInfo using the the ServiceWorker script's |
+ // HttpResponseInfo to show HTTPS padlock. |
+ // TODO(horo): When we support mixed-content (HTTP) no-cors requests from a |
+ // ServiceWorker, we have to check the security level of the responses. |
+ const net::HttpResponseInfo* main_script_http_info = |
+ version->GetMainScriptHttpResponseInfo(); |
+ DCHECK(main_script_http_info); |
+ ssl_info_ = main_script_http_info->ssl_info; |
+ |
std::move(loader_callback_) |
.Run(base::Bind(&ServiceWorkerURLLoaderJob::StartResponse, |
weak_factory_.GetWeakPtr(), response, |