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

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

Issue 877623002: [ServiceWorker] Fills SSLInfo of the response from a SW with the SSLInfo of the SW script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated falken's comment Created 5 years, 11 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_request_job.cc
diff --git a/content/browser/service_worker/service_worker_url_request_job.cc b/content/browser/service_worker/service_worker_url_request_job.cc
index ecac952807c5e12ea09151ff96629d61d62c9215..1a3e753e07e2a890d18171eb6a852c2724ed11e2 100644
--- a/content/browser/service_worker/service_worker_url_request_job.cc
+++ b/content/browser/service_worker/service_worker_url_request_job.cc
@@ -538,6 +538,14 @@ void ServiceWorkerURLRequestJob::DidDispatchFetchEvent(
fetch_end_time_ = base::TimeTicks::Now();
load_timing_info_.send_end = fetch_end_time_;
+ // Fills SSLInfo using the ServiceWorker script's SSLInfo 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.
falken 2015/01/27 06:39:58 can we DCHECK(!http_response_info_)
horo 2015/01/27 06:48:15 Done.
+ http_response_info_.reset(new net::HttpResponseInfo());
+ http_response_info_->ssl_info =
+ provider_host_->active_version()->GetMainScriptSSLInfo();
+
// Set up a request for reading the stream.
if (response.stream_url.is_valid()) {
DCHECK(response.blob_uuid.empty());
@@ -610,7 +618,8 @@ void ServiceWorkerURLRequestJob::CreateResponseHeader(
}
void ServiceWorkerURLRequestJob::CommitResponseHeader() {
- http_response_info_.reset(new net::HttpResponseInfo());
+ if (!http_response_info_)
+ http_response_info_.reset(new net::HttpResponseInfo());
http_response_info_->headers.swap(http_response_headers_);
NotifyHeadersComplete();
}

Powered by Google App Engine
This is Rietveld 408576698