| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 WebInspector.Throttler = class { | 7 Common.Throttler = class { |
| 8 /** | 8 /** |
| 9 * @param {number} timeout | 9 * @param {number} timeout |
| 10 */ | 10 */ |
| 11 constructor(timeout) { | 11 constructor(timeout) { |
| 12 this._timeout = timeout; | 12 this._timeout = timeout; |
| 13 this._isRunningProcess = false; | 13 this._isRunningProcess = false; |
| 14 this._asSoonAsPossible = false; | 14 this._asSoonAsPossible = false; |
| 15 /** @type {?function():(!Promise.<?>)} */ | 15 /** @type {?function():(!Promise.<?>)} */ |
| 16 this._process = null; | 16 this._process = null; |
| 17 this._lastCompleteTime = 0; | 17 this._lastCompleteTime = 0; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 * @param {function()} operation | 88 * @param {function()} operation |
| 89 * @param {number} timeout | 89 * @param {number} timeout |
| 90 * @return {number} | 90 * @return {number} |
| 91 */ | 91 */ |
| 92 _setTimeout(operation, timeout) { | 92 _setTimeout(operation, timeout) { |
| 93 return setTimeout(operation, timeout); | 93 return setTimeout(operation, timeout); |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 /** @typedef {function(!Error=)} */ | 97 /** @typedef {function(!Error=)} */ |
| 98 WebInspector.Throttler.FinishCallback; | 98 Common.Throttler.FinishCallback; |
| OLD | NEW |