Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 638 return Promise.all(this._targets.map(this._startProfilingOnTarget)); | 638 return Promise.all(this._targets.map(this._startProfilingOnTarget)); |
| 639 }, | 639 }, |
| 640 | 640 |
| 641 /** | 641 /** |
| 642 * @param {!WebInspector.Target} target | 642 * @param {!WebInspector.Target} target |
| 643 * @return {!Promise} | 643 * @return {!Promise} |
| 644 */ | 644 */ |
| 645 _stopProfilingOnTarget: function(target) | 645 _stopProfilingOnTarget: function(target) |
| 646 { | 646 { |
| 647 /** | 647 /** |
| 648 * @param {?{profile: !ProfilerAgent.CPUProfile}} value | 648 * @param {?Protocol.Error} error |
| 649 * @param {?ProfilerAgent.CPUProfile} profile | |
| 649 * @return {?ProfilerAgent.CPUProfile} | 650 * @return {?ProfilerAgent.CPUProfile} |
| 650 */ | 651 */ |
| 651 function extractProfile(value) | 652 function extractProfile(error, profile) |
| 652 { | 653 { |
| 653 return value && value.profile; | 654 return !error && profile ? profile : null; |
| 654 } | 655 } |
| 655 return target.profilerAgent().stop().then(extractProfile).then(this._add CpuProfile.bind(this, target.id())); | 656 return target.profilerAgent().stop(extractProfile).then(this._addCpuProf ile.bind(this, target.id())); |
|
alph
2015/06/24 16:54:18
what's that? why stop gets a callback as a paramet
| |
| 656 }, | 657 }, |
| 657 | 658 |
| 658 /** | 659 /** |
| 659 * @return {!Promise} | 660 * @return {!Promise} |
| 660 */ | 661 */ |
| 661 _stopProfilingOnAllTargets: function() | 662 _stopProfilingOnAllTargets: function() |
| 662 { | 663 { |
| 663 var targets = this._profiling ? this._targets : []; | 664 var targets = this._profiling ? this._targets : []; |
| 664 this._profiling = false; | 665 this._profiling = false; |
| 665 return Promise.all(targets.map(this._stopProfilingOnTarget, this)); | 666 return Promise.all(targets.map(this._stopProfilingOnTarget, this)); |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2083 /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ | 2084 /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ |
| 2084 this._invalidations = {}; | 2085 this._invalidations = {}; |
| 2085 /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ | 2086 /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ |
| 2086 this._invalidationsByNodeId = {}; | 2087 this._invalidationsByNodeId = {}; |
| 2087 | 2088 |
| 2088 this._lastRecalcStyle = undefined; | 2089 this._lastRecalcStyle = undefined; |
| 2089 this._lastPaintWithLayer = undefined; | 2090 this._lastPaintWithLayer = undefined; |
| 2090 this._didPaint = false; | 2091 this._didPaint = false; |
| 2091 } | 2092 } |
| 2092 } | 2093 } |
| OLD | NEW |