| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 | 2117 |
| 2118 /** | 2118 /** |
| 2119 * @constructor | 2119 * @constructor |
| 2120 * @extends {WebInspector.Object} | 2120 * @extends {WebInspector.Object} |
| 2121 * @implements {WebInspector.TargetManager.Observer} | 2121 * @implements {WebInspector.TargetManager.Observer} |
| 2122 */ | 2122 */ |
| 2123 WebInspector.CPUThrottlingManager = function() | 2123 WebInspector.CPUThrottlingManager = function() |
| 2124 { | 2124 { |
| 2125 this._targets = []; | 2125 this._targets = []; |
| 2126 this._throttlingRate = 1.; // No throttling | 2126 this._throttlingRate = 1.; // No throttling |
| 2127 WebInspector.targetManager.observeTargets(this); | 2127 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag
e); |
| 2128 } | 2128 } |
| 2129 | 2129 |
| 2130 WebInspector.CPUThrottlingManager.prototype = { | 2130 WebInspector.CPUThrottlingManager.prototype = { |
| 2131 /** | 2131 /** |
| 2132 * @param {number} value | 2132 * @param {number} value |
| 2133 */ | 2133 */ |
| 2134 setRate: function(value) | 2134 setRate: function(value) |
| 2135 { | 2135 { |
| 2136 this._throttlingRate = value; | 2136 this._throttlingRate = value; |
| 2137 this._targets.forEach(target => target.emulationAgent().setCPUThrottling
Rate(value)); | 2137 this._targets.forEach(target => target.emulationAgent().setCPUThrottling
Rate(value)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2159 * @override | 2159 * @override |
| 2160 * @param {!WebInspector.Target} target | 2160 * @param {!WebInspector.Target} target |
| 2161 */ | 2161 */ |
| 2162 targetRemoved: function(target) | 2162 targetRemoved: function(target) |
| 2163 { | 2163 { |
| 2164 this._targets.remove(target, true); | 2164 this._targets.remove(target, true); |
| 2165 }, | 2165 }, |
| 2166 | 2166 |
| 2167 __proto__: WebInspector.Object.prototype | 2167 __proto__: WebInspector.Object.prototype |
| 2168 } | 2168 } |
| OLD | NEW |