| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 */ | 7 */ |
| 8 WebInspector.ProfileTypeRegistry = function() | 8 WebInspector.ProfileTypeRegistry = function() |
| 9 { | 9 { |
| 10 this._profileTypes = []; | 10 this._profileTypes = []; |
| 11 | 11 |
| 12 this.cpuProfileType = new WebInspector.CPUProfileType(); | 12 this.cpuProfileType = new WebInspector.CPUProfileType(); |
| 13 this._addProfileType(this.cpuProfileType); | 13 this._addProfileType(this.cpuProfileType); |
| 14 this.heapSnapshotProfileType = new WebInspector.HeapSnapshotProfileType(); | 14 this.heapSnapshotProfileType = new WebInspector.HeapSnapshotProfileType(); |
| 15 this._addProfileType(this.heapSnapshotProfileType); | 15 this._addProfileType(this.heapSnapshotProfileType); |
| 16 this.trackingHeapSnapshotProfileType = new WebInspector.TrackingHeapSnapshot
ProfileType(); | 16 this.trackingHeapSnapshotProfileType = new WebInspector.TrackingHeapSnapshot
ProfileType(); |
| 17 this._addProfileType(this.trackingHeapSnapshotProfileType); | 17 this._addProfileType(this.trackingHeapSnapshotProfileType); |
| 18 | |
| 19 if (Runtime.experiments.isEnabled("canvasInspection")) { | |
| 20 this.canvasProfileType = new WebInspector.CanvasProfileType(); | |
| 21 this._addProfileType(this.canvasProfileType); | |
| 22 } | |
| 23 } | 18 } |
| 24 | 19 |
| 25 WebInspector.ProfileTypeRegistry.prototype = { | 20 WebInspector.ProfileTypeRegistry.prototype = { |
| 26 /** | 21 /** |
| 27 * @param {!WebInspector.ProfileType} profileType | 22 * @param {!WebInspector.ProfileType} profileType |
| 28 */ | 23 */ |
| 29 _addProfileType: function(profileType) | 24 _addProfileType: function(profileType) |
| 30 { | 25 { |
| 31 this._profileTypes.push(profileType); | 26 this._profileTypes.push(profileType); |
| 32 }, | 27 }, |
| 33 | 28 |
| 34 /** | 29 /** |
| 35 * @return {!Array.<!WebInspector.ProfileType>} | 30 * @return {!Array.<!WebInspector.ProfileType>} |
| 36 */ | 31 */ |
| 37 profileTypes: function() | 32 profileTypes: function() |
| 38 { | 33 { |
| 39 return this._profileTypes; | 34 return this._profileTypes; |
| 40 } | 35 } |
| 41 } | 36 } |
| 42 | 37 |
| 43 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry
(); | 38 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry
(); |
| OLD | NEW |