| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |