| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @constructor |
| 7 * @extends {WebInspector.Panel} |
| 8 */ |
| 9 WebInspector.Audits2Panel = function() |
| 10 { |
| 11 WebInspector.Panel.call(this, "audits2"); |
| 12 this.contentElement.classList.add("vbox"); |
| 13 this.contentElement.appendChild(createTextButton(WebInspector.UIString("Star
t"), this._start.bind(this))); |
| 14 this.contentElement.appendChild(createTextButton(WebInspector.UIString("Stop
"), this._stop.bind(this))); |
| 15 } |
| 16 |
| 17 WebInspector.Audits2Panel.prototype = { |
| 18 _start: function() |
| 19 { |
| 20 this._backend().then(backend => backend ? backend.send("start") : undefi
ned).then(console.error.bind(console, "STARTED")); |
| 21 }, |
| 22 |
| 23 _stop: function() |
| 24 { |
| 25 this._backend().then(backend => backend ? backend.send("stop") : undefin
ed).then(console.error.bind(console, "STOPPED")); |
| 26 }, |
| 27 |
| 28 /** |
| 29 * @return {!Promise<?WebInspector.ServiceManager.Service>} |
| 30 */ |
| 31 _backend: function() |
| 32 { |
| 33 if (!this._backendPromise) |
| 34 this._backendPromise = WebInspector.serviceManager.createAppService(
"audits2_worker", "Audits2Service", false); |
| 35 return this._backendPromise; |
| 36 }, |
| 37 |
| 38 __proto__: WebInspector.Panel.prototype |
| 39 } |
| OLD | NEW |