Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: content/browser/service_worker/service_worker_url_loader_job.cc

Issue 2936623002: Implement dumb URLLoader{Factory} for ServiceWorker script loading (for try)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698