OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @implements {WebInspector.Searchable} | 7 * @implements {WebInspector.Searchable} |
8 * @extends {WebInspector.ProfileView} | 8 * @extends {WebInspector.ProfileView} |
9 * @param {!WebInspector.SamplingHeapProfileHeader} profileHeader | 9 * @param {!WebInspector.SamplingHeapProfileHeader} profileHeader |
10 */ | 10 */ |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 __proto__: WebInspector.ProfileView.prototype | 38 __proto__: WebInspector.ProfileView.prototype |
39 } | 39 } |
40 | 40 |
41 /** | 41 /** |
42 * @constructor | 42 * @constructor |
43 * @extends {WebInspector.ProfileType} | 43 * @extends {WebInspector.ProfileType} |
44 */ | 44 */ |
45 WebInspector.SamplingHeapProfileType = function() | 45 WebInspector.SamplingHeapProfileType = function() |
46 { | 46 { |
47 WebInspector.ProfileType.call(this, WebInspector.SamplingHeapProfileType.Typ
eId, WebInspector.UIString("Collect JavaScript Heap Profile")); | 47 WebInspector.ProfileType.call(this, WebInspector.SamplingHeapProfileType.Typ
eId, WebInspector.UIString("Record Allocation Profile")); |
48 this._recording = false; | 48 this._recording = false; |
49 WebInspector.SamplingHeapProfileType.instance = this; | 49 WebInspector.SamplingHeapProfileType.instance = this; |
50 } | 50 } |
51 | 51 |
52 WebInspector.SamplingHeapProfileType.TypeId = "SamplingHeap"; | 52 WebInspector.SamplingHeapProfileType.TypeId = "SamplingHeap"; |
53 | 53 |
54 WebInspector.SamplingHeapProfileType.prototype = { | 54 WebInspector.SamplingHeapProfileType.prototype = { |
55 /** | 55 /** |
56 * @override | 56 * @override |
57 * @return {string} | 57 * @return {string} |
(...skipping 26 matching lines...) Expand all Loading... |
84 var wasRecording = this._recording; | 84 var wasRecording = this._recording; |
85 if (wasRecording) | 85 if (wasRecording) |
86 this.stopRecordingProfile(); | 86 this.stopRecordingProfile(); |
87 else | 87 else |
88 this.startRecordingProfile(); | 88 this.startRecordingProfile(); |
89 return !wasRecording; | 89 return !wasRecording; |
90 }, | 90 }, |
91 | 91 |
92 get treeItemTitle() | 92 get treeItemTitle() |
93 { | 93 { |
94 return WebInspector.UIString("HEAP PROFILES"); | 94 return WebInspector.UIString("ALLOCATION PROFILES"); |
95 }, | 95 }, |
96 | 96 |
97 get description() | 97 get description() |
98 { | 98 { |
99 return WebInspector.UIString("Heap profiles show where the most memory a
llocations took place in JavaScript functions."); | 99 return WebInspector.UIString("Allocation profiles show memory allocation
s from your JavaScript functions."); |
100 }, | 100 }, |
101 | 101 |
102 startRecordingProfile: function() | 102 startRecordingProfile: function() |
103 { | 103 { |
104 var target = WebInspector.context.flavor(WebInspector.Target); | 104 var target = WebInspector.context.flavor(WebInspector.Target); |
105 if (this._profileBeingRecorded || !target) | 105 if (this._profileBeingRecorded || !target) |
106 return; | 106 return; |
107 var profile = new WebInspector.SamplingHeapProfileHeader(target, this); | 107 var profile = new WebInspector.SamplingHeapProfileHeader(target, this); |
108 this.setProfileBeingRecorded(profile); | 108 this.setProfileBeingRecorded(profile); |
109 WebInspector.targetManager.suspendAllTargets(); | 109 WebInspector.targetManager.suspendAllTargets(); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 * @override | 289 * @override |
290 * @param {!WebInspector.ProfileDataGridNode} node | 290 * @param {!WebInspector.ProfileDataGridNode} node |
291 * @return {!Element} | 291 * @return {!Element} |
292 */ | 292 */ |
293 linkifyNode: function(node) | 293 linkifyNode: function(node) |
294 { | 294 { |
295 var callFrame = node.profileNode.frame; | 295 var callFrame = node.profileNode.frame; |
296 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi
leView.target(), callFrame, "profile-node-file"); | 296 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi
leView.target(), callFrame, "profile-node-file"); |
297 } | 297 } |
298 } | 298 } |
OLD | NEW |