| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @interface | 5 * @interface |
| 6 */ | 6 */ |
| 7 function Service() { | 7 function Service() { |
| 8 } | 8 } |
| 9 | 9 |
| 10 Service.prototype = { | 10 Service.prototype = { |
| 11 /** | 11 /** |
| 12 * @return {!Promise} | 12 * @return {!Promise} |
| 13 */ | 13 */ |
| 14 dispose: function() {}, | 14 dispose() {}, |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * @return {function(string)} | 17 * @return {function(string)} |
| 18 */ | 18 */ |
| 19 setNotify: function(notify) {} | 19 setNotify(notify) {} |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * @unrestricted | 23 * @unrestricted |
| 24 */ | 24 */ |
| 25 var ServiceDispatcher = class { | 25 var ServiceDispatcher = class { |
| 26 /** | 26 /** |
| 27 * @param {!ServicePort} port | 27 * @param {!ServicePort} port |
| 28 */ | 28 */ |
| 29 constructor(port) { | 29 constructor(port) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 function onNewPort(port) { | 191 function onNewPort(port) { |
| 192 var dispatcher = new ServiceDispatcher(new WorkerServicePort(port)); | 192 var dispatcher = new ServiceDispatcher(new WorkerServicePort(port)); |
| 193 dispatchers.push(dispatcher); | 193 dispatchers.push(dispatcher); |
| 194 } | 194 } |
| 195 Runtime.setSharedWorkerNewPortCallback(onNewPort); | 195 Runtime.setSharedWorkerNewPortCallback(onNewPort); |
| 196 } else { | 196 } else { |
| 197 var worker = /** @type {!Object} */ (self); | 197 var worker = /** @type {!Object} */ (self); |
| 198 var servicePort = new WorkerServicePort(/** @type {!Worker} */ (worker)); | 198 var servicePort = new WorkerServicePort(/** @type {!Worker} */ (worker)); |
| 199 dispatchers.push(new ServiceDispatcher(servicePort)); | 199 dispatchers.push(new ServiceDispatcher(servicePort)); |
| 200 } | 200 } |
| OLD | NEW |