Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / profiler / ProfileTypeRegistry.js
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
3 // found in the LICENSE file.
4
5 /**
6  * @constructor
7  */
8 WebInspector.ProfileTypeRegistry = function()
9 {
10     this._profileTypes = [];
11
12     this.cpuProfileType = new WebInspector.CPUProfileType();
13     this._addProfileType(this.cpuProfileType);
14     this.heapSnapshotProfileType = new WebInspector.HeapSnapshotProfileType();
15     this._addProfileType(this.heapSnapshotProfileType);
16     this.trackingHeapSnapshotProfileType = new WebInspector.TrackingHeapSnapshotProfileType();
17     this._addProfileType(this.trackingHeapSnapshotProfileType);
18
19     if (!WebInspector.isWorkerFrontend() && Runtime.experiments.isEnabled("canvasInspection")) {
20         this.canvasProfileType = new WebInspector.CanvasProfileType();
21         this._addProfileType(this.canvasProfileType);
22     }
23 }
24
25 WebInspector.ProfileTypeRegistry.prototype = {
26     /**
27      * @param {!WebInspector.ProfileType} profileType
28      */
29     _addProfileType: function(profileType)
30     {
31         this._profileTypes.push(profileType);
32     },
33
34     /**
35      * @return {!Array.<!WebInspector.ProfileType>}
36      */
37     profileTypes: function()
38     {
39         return this._profileTypes;
40     }
41 }
42
43 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry();