| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 cr.define('serviceworker', function() { | 5 cr.define('serviceworker', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 function initialize() { | 8 function initialize() { |
| 9 if (window.location.hash == "#iframe") { | 9 if (window.location.hash == "#iframe") { |
| 10 // This page is loaded from chrome://inspect. | 10 // This page is loaded from chrome://inspect. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 function sendToInspectPage(live_registrations, | 89 function sendToInspectPage(live_registrations, |
| 90 partition_id) { | 90 partition_id) { |
| 91 var workers = []; | 91 var workers = []; |
| 92 live_registrations.forEach(function(registration) { | 92 live_registrations.forEach(function(registration) { |
| 93 [registration.active, registration.waiting].forEach(function(version) { | 93 [registration.active, registration.waiting].forEach(function(version) { |
| 94 if (!version || version.running_status != 'RUNNING') { | 94 if (!version || version.running_status != 'RUNNING') { |
| 95 return; | 95 return; |
| 96 } | 96 } |
| 97 workers.push({ | 97 workers.push({ |
| 98 'scope': registration.scope, | 98 'scope': registration.scope, |
| 99 'url': registration.script_url, | 99 'url': version.script_url, |
| 100 'partition_id': partition_id, | 100 'partition_id': partition_id, |
| 101 'version_id': version.version_id, | 101 'version_id': version.version_id, |
| 102 'process_id': version.process_id, | 102 'process_id': version.process_id, |
| 103 'devtools_agent_route_id': | 103 'devtools_agent_route_id': |
| 104 version.devtools_agent_route_id | 104 version.devtools_agent_route_id |
| 105 }); | 105 }); |
| 106 }); | 106 }); |
| 107 }); | 107 }); |
| 108 window.parent.postMessage( | 108 window.parent.postMessage( |
| 109 {'partition_id': partition_id, 'workers': workers}, | 109 {'partition_id': partition_id, 'workers': workers}, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 onWorkerStopped: onWorkerStopped, | 295 onWorkerStopped: onWorkerStopped, |
| 296 onErrorReported: onErrorReported, | 296 onErrorReported: onErrorReported, |
| 297 onConsoleMessageReported: onConsoleMessageReported, | 297 onConsoleMessageReported: onConsoleMessageReported, |
| 298 onVersionStateChanged: onVersionStateChanged, | 298 onVersionStateChanged: onVersionStateChanged, |
| 299 onRegistrationStored: onRegistrationStored, | 299 onRegistrationStored: onRegistrationStored, |
| 300 onRegistrationDeleted: onRegistrationDeleted, | 300 onRegistrationDeleted: onRegistrationDeleted, |
| 301 }; | 301 }; |
| 302 }); | 302 }); |
| 303 | 303 |
| 304 document.addEventListener('DOMContentLoaded', serviceworker.initialize); | 304 document.addEventListener('DOMContentLoaded', serviceworker.initialize); |
| OLD | NEW |