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

Side by Side Diff: content/browser/service_worker/service_worker_version.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: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_version.h" 5 #include "content/browser/service_worker/service_worker_version.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 662
663 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) { 663 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) {
664 embedded_worker()->set_devtools_attached(attached); 664 embedded_worker()->set_devtools_attached(attached);
665 if (!attached && !stop_worker_timer_.IsRunning()) { 665 if (!attached && !stop_worker_timer_.IsRunning()) {
666 // If devtools is detached from this version and stop-worker-timer is not 666 // If devtools is detached from this version and stop-worker-timer is not
667 // running, try scheduling stop-worker-timer now. 667 // running, try scheduling stop-worker-timer now.
668 ScheduleStopWorker(); 668 ScheduleStopWorker();
669 } 669 }
670 } 670 }
671 671
672 void ServiceWorkerVersion::SetMainScriptSSLInfo(const net::SSLInfo& ssl_info) {
673 main_script_ssl_info_ = ssl_info;
674 }
675
676 const net::SSLInfo& ServiceWorkerVersion::GetMainScriptSSLInfo() {
677 return main_script_ssl_info_;
678 }
679
672 void ServiceWorkerVersion::OnStarted() { 680 void ServiceWorkerVersion::OnStarted() {
673 DCHECK_EQ(RUNNING, running_status()); 681 DCHECK_EQ(RUNNING, running_status());
674 DCHECK(cache_listener_.get()); 682 DCHECK(cache_listener_.get());
675 ScheduleStopWorker(); 683 ScheduleStopWorker();
676 684
677 // Fire all start callbacks. 685 // Fire all start callbacks.
678 scoped_refptr<ServiceWorkerVersion> protect(this); 686 scoped_refptr<ServiceWorkerVersion> protect(this);
679 RunCallbacks(this, &start_callbacks_, SERVICE_WORKER_OK); 687 RunCallbacks(this, &start_callbacks_, SERVICE_WORKER_OK);
680 FOR_EACH_OBSERVER(Listener, listeners_, OnWorkerStarted(this)); 688 FOR_EACH_OBSERVER(Listener, listeners_, OnWorkerStarted(this));
681 } 689 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 int request_id) { 1180 int request_id) {
1173 callbacks->Remove(request_id); 1181 callbacks->Remove(request_id);
1174 if (is_doomed_) { 1182 if (is_doomed_) {
1175 // The stop should be already scheduled, but try to stop immediately, in 1183 // The stop should be already scheduled, but try to stop immediately, in
1176 // order to release worker resources soon. 1184 // order to release worker resources soon.
1177 StopWorkerIfIdle(); 1185 StopWorkerIfIdle();
1178 } 1186 }
1179 } 1187 }
1180 1188
1181 } // namespace content 1189 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698