OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.element, thi
s._getHoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), undefine
d, true); | 152 this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.element, thi
s._getHoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), undefine
d, true); |
153 | 153 |
154 this._currentPerspectiveIndex = 0; | 154 this._currentPerspectiveIndex = 0; |
155 this._currentPerspective = this._perspectives[0]; | 155 this._currentPerspective = this._perspectives[0]; |
156 this._currentPerspective.activate(this); | 156 this._currentPerspective.activate(this); |
157 this._dataGrid = this._currentPerspective.masterGrid(this); | 157 this._dataGrid = this._currentPerspective.masterGrid(this); |
158 | 158 |
159 this._populate(); | 159 this._populate(); |
160 this._searchThrottler = new WebInspector.Throttler(0); | 160 this._searchThrottler = new WebInspector.Throttler(0); |
161 } | 161 }; |
162 | 162 |
163 /** | 163 /** |
164 * @constructor | 164 * @constructor |
165 * @param {string} title | 165 * @param {string} title |
166 */ | 166 */ |
167 WebInspector.HeapSnapshotView.Perspective = function(title) | 167 WebInspector.HeapSnapshotView.Perspective = function(title) |
168 { | 168 { |
169 this._title = title; | 169 this._title = title; |
170 } | 170 }; |
171 | 171 |
172 WebInspector.HeapSnapshotView.Perspective.prototype = { | 172 WebInspector.HeapSnapshotView.Perspective.prototype = { |
173 /** | 173 /** |
174 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 174 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
175 */ | 175 */ |
176 activate: function(heapSnapshotView) { }, | 176 activate: function(heapSnapshotView) { }, |
177 | 177 |
178 /** | 178 /** |
179 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 179 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
180 */ | 180 */ |
(...skipping 30 matching lines...) Expand all Loading... |
211 return this._title; | 211 return this._title; |
212 }, | 212 }, |
213 | 213 |
214 /** | 214 /** |
215 * @return {boolean} | 215 * @return {boolean} |
216 */ | 216 */ |
217 supportsSearch: function() | 217 supportsSearch: function() |
218 { | 218 { |
219 return false; | 219 return false; |
220 } | 220 } |
221 } | 221 }; |
222 | 222 |
223 /** | 223 /** |
224 * @constructor | 224 * @constructor |
225 * @extends {WebInspector.HeapSnapshotView.Perspective} | 225 * @extends {WebInspector.HeapSnapshotView.Perspective} |
226 */ | 226 */ |
227 WebInspector.HeapSnapshotView.SummaryPerspective = function() | 227 WebInspector.HeapSnapshotView.SummaryPerspective = function() |
228 { | 228 { |
229 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Summary")); | 229 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Summary")); |
230 } | 230 }; |
231 | 231 |
232 WebInspector.HeapSnapshotView.SummaryPerspective.prototype = { | 232 WebInspector.HeapSnapshotView.SummaryPerspective.prototype = { |
233 /** | 233 /** |
234 * @override | 234 * @override |
235 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 235 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
236 */ | 236 */ |
237 activate: function(heapSnapshotView) | 237 activate: function(heapSnapshotView) |
238 { | 238 { |
239 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._constructo
rsWidget); | 239 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._constructo
rsWidget); |
240 heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectD
etailsView); | 240 heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectD
etailsView); |
(...skipping 20 matching lines...) Expand all Loading... |
261 /** | 261 /** |
262 * @override | 262 * @override |
263 * @return {boolean} | 263 * @return {boolean} |
264 */ | 264 */ |
265 supportsSearch: function() | 265 supportsSearch: function() |
266 { | 266 { |
267 return true; | 267 return true; |
268 }, | 268 }, |
269 | 269 |
270 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 270 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
271 } | 271 }; |
272 | 272 |
273 /** | 273 /** |
274 * @constructor | 274 * @constructor |
275 * @extends {WebInspector.HeapSnapshotView.Perspective} | 275 * @extends {WebInspector.HeapSnapshotView.Perspective} |
276 */ | 276 */ |
277 WebInspector.HeapSnapshotView.ComparisonPerspective = function() | 277 WebInspector.HeapSnapshotView.ComparisonPerspective = function() |
278 { | 278 { |
279 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Comparison")); | 279 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Comparison")); |
280 } | 280 }; |
281 | 281 |
282 WebInspector.HeapSnapshotView.ComparisonPerspective.prototype = { | 282 WebInspector.HeapSnapshotView.ComparisonPerspective.prototype = { |
283 /** | 283 /** |
284 * @override | 284 * @override |
285 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 285 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
286 */ | 286 */ |
287 activate: function(heapSnapshotView) | 287 activate: function(heapSnapshotView) |
288 { | 288 { |
289 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._diffWidget
); | 289 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._diffWidget
); |
290 heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectD
etailsView); | 290 heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectD
etailsView); |
(...skipping 15 matching lines...) Expand all Loading... |
306 /** | 306 /** |
307 * @override | 307 * @override |
308 * @return {boolean} | 308 * @return {boolean} |
309 */ | 309 */ |
310 supportsSearch: function() | 310 supportsSearch: function() |
311 { | 311 { |
312 return true; | 312 return true; |
313 }, | 313 }, |
314 | 314 |
315 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 315 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
316 } | 316 }; |
317 | 317 |
318 /** | 318 /** |
319 * @constructor | 319 * @constructor |
320 * @extends {WebInspector.HeapSnapshotView.Perspective} | 320 * @extends {WebInspector.HeapSnapshotView.Perspective} |
321 */ | 321 */ |
322 WebInspector.HeapSnapshotView.ContainmentPerspective = function() | 322 WebInspector.HeapSnapshotView.ContainmentPerspective = function() |
323 { | 323 { |
324 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Containment")); | 324 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Containment")); |
325 } | 325 }; |
326 | 326 |
327 WebInspector.HeapSnapshotView.ContainmentPerspective.prototype = { | 327 WebInspector.HeapSnapshotView.ContainmentPerspective.prototype = { |
328 /** | 328 /** |
329 * @override | 329 * @override |
330 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 330 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
331 */ | 331 */ |
332 activate: function(heapSnapshotView) | 332 activate: function(heapSnapshotView) |
333 { | 333 { |
334 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._containmen
tWidget); | 334 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._containmen
tWidget); |
335 heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectD
etailsView); | 335 heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectD
etailsView); |
336 heapSnapshotView._splitWidget.show(heapSnapshotView._searchableView.elem
ent); | 336 heapSnapshotView._splitWidget.show(heapSnapshotView._searchableView.elem
ent); |
337 }, | 337 }, |
338 | 338 |
339 /** | 339 /** |
340 * @override | 340 * @override |
341 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 341 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
342 * @return {?WebInspector.DataGrid} | 342 * @return {?WebInspector.DataGrid} |
343 */ | 343 */ |
344 masterGrid: function(heapSnapshotView) | 344 masterGrid: function(heapSnapshotView) |
345 { | 345 { |
346 return heapSnapshotView._containmentDataGrid; | 346 return heapSnapshotView._containmentDataGrid; |
347 }, | 347 }, |
348 | 348 |
349 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 349 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
350 } | 350 }; |
351 | 351 |
352 /** | 352 /** |
353 * @constructor | 353 * @constructor |
354 * @extends {WebInspector.HeapSnapshotView.Perspective} | 354 * @extends {WebInspector.HeapSnapshotView.Perspective} |
355 */ | 355 */ |
356 WebInspector.HeapSnapshotView.AllocationPerspective = function() | 356 WebInspector.HeapSnapshotView.AllocationPerspective = function() |
357 { | 357 { |
358 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Allocation")); | 358 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Allocation")); |
359 this._allocationSplitWidget = new WebInspector.SplitWidget(false, true, "hea
pSnapshotAllocationSplitViewState", 200, 200); | 359 this._allocationSplitWidget = new WebInspector.SplitWidget(false, true, "hea
pSnapshotAllocationSplitViewState", 200, 200); |
360 this._allocationSplitWidget.setSidebarWidget(new WebInspector.VBox()); | 360 this._allocationSplitWidget.setSidebarWidget(new WebInspector.VBox()); |
361 | 361 |
362 } | 362 }; |
363 | 363 |
364 WebInspector.HeapSnapshotView.AllocationPerspective.prototype = { | 364 WebInspector.HeapSnapshotView.AllocationPerspective.prototype = { |
365 /** | 365 /** |
366 * @override | 366 * @override |
367 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 367 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
368 */ | 368 */ |
369 activate: function(heapSnapshotView) | 369 activate: function(heapSnapshotView) |
370 { | 370 { |
371 this._allocationSplitWidget.setMainWidget(heapSnapshotView._allocationWi
dget); | 371 this._allocationSplitWidget.setMainWidget(heapSnapshotView._allocationWi
dget); |
372 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._constructo
rsWidget); | 372 heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._constructo
rsWidget); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 * @override | 404 * @override |
405 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 405 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
406 * @return {?WebInspector.DataGrid} | 406 * @return {?WebInspector.DataGrid} |
407 */ | 407 */ |
408 masterGrid: function(heapSnapshotView) | 408 masterGrid: function(heapSnapshotView) |
409 { | 409 { |
410 return heapSnapshotView._allocationDataGrid; | 410 return heapSnapshotView._allocationDataGrid; |
411 }, | 411 }, |
412 | 412 |
413 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 413 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
414 } | 414 }; |
415 | 415 |
416 /** | 416 /** |
417 * @constructor | 417 * @constructor |
418 * @extends {WebInspector.HeapSnapshotView.Perspective} | 418 * @extends {WebInspector.HeapSnapshotView.Perspective} |
419 */ | 419 */ |
420 WebInspector.HeapSnapshotView.StatisticsPerspective = function() | 420 WebInspector.HeapSnapshotView.StatisticsPerspective = function() |
421 { | 421 { |
422 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Statistics")); | 422 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Statistics")); |
423 } | 423 }; |
424 | 424 |
425 WebInspector.HeapSnapshotView.StatisticsPerspective.prototype = { | 425 WebInspector.HeapSnapshotView.StatisticsPerspective.prototype = { |
426 /** | 426 /** |
427 * @override | 427 * @override |
428 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 428 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
429 */ | 429 */ |
430 activate: function(heapSnapshotView) | 430 activate: function(heapSnapshotView) |
431 { | 431 { |
432 heapSnapshotView._statisticsView.show(heapSnapshotView._searchableView.e
lement); | 432 heapSnapshotView._statisticsView.show(heapSnapshotView._searchableView.e
lement); |
433 }, | 433 }, |
434 | 434 |
435 /** | 435 /** |
436 * @override | 436 * @override |
437 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 437 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
438 * @return {?WebInspector.DataGrid} | 438 * @return {?WebInspector.DataGrid} |
439 */ | 439 */ |
440 masterGrid: function(heapSnapshotView) | 440 masterGrid: function(heapSnapshotView) |
441 { | 441 { |
442 return null; | 442 return null; |
443 }, | 443 }, |
444 | 444 |
445 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 445 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
446 } | 446 }; |
447 | 447 |
448 | 448 |
449 WebInspector.HeapSnapshotView.prototype = { | 449 WebInspector.HeapSnapshotView.prototype = { |
450 /** | 450 /** |
451 * @return {!WebInspector.SearchableView} | 451 * @return {!WebInspector.SearchableView} |
452 */ | 452 */ |
453 searchableView: function() | 453 searchableView: function() |
454 { | 454 { |
455 return this._searchableView; | 455 return this._searchableView; |
456 }, | 456 }, |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 { | 1003 { |
1004 if (this._allocationStackView) { | 1004 if (this._allocationStackView) { |
1005 this._allocationStackView.clear(); | 1005 this._allocationStackView.clear(); |
1006 this._allocationDataGrid.dispose(); | 1006 this._allocationDataGrid.dispose(); |
1007 } | 1007 } |
1008 if (this._trackingOverviewGrid) | 1008 if (this._trackingOverviewGrid) |
1009 this._trackingOverviewGrid.dispose(); | 1009 this._trackingOverviewGrid.dispose(); |
1010 }, | 1010 }, |
1011 | 1011 |
1012 __proto__: WebInspector.SimpleView.prototype | 1012 __proto__: WebInspector.SimpleView.prototype |
1013 } | 1013 }; |
1014 | 1014 |
1015 /** | 1015 /** |
1016 * @constructor | 1016 * @constructor |
1017 * @extends {WebInspector.ProfileType} | 1017 * @extends {WebInspector.ProfileType} |
1018 * @implements {WebInspector.TargetManager.Observer} | 1018 * @implements {WebInspector.TargetManager.Observer} |
1019 * @param {string=} id | 1019 * @param {string=} id |
1020 * @param {string=} title | 1020 * @param {string=} title |
1021 */ | 1021 */ |
1022 WebInspector.HeapSnapshotProfileType = function(id, title) | 1022 WebInspector.HeapSnapshotProfileType = function(id, title) |
1023 { | 1023 { |
1024 WebInspector.ProfileType.call(this, id || WebInspector.HeapSnapshotProfileTy
pe.TypeId, title || WebInspector.UIString("Take Heap Snapshot")); | 1024 WebInspector.ProfileType.call(this, id || WebInspector.HeapSnapshotProfileTy
pe.TypeId, title || WebInspector.UIString("Take Heap Snapshot")); |
1025 WebInspector.targetManager.observeTargets(this); | 1025 WebInspector.targetManager.observeTargets(this); |
1026 WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel,
WebInspector.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this); | 1026 WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel,
WebInspector.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this); |
1027 WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel,
WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, this._addHeapSnapsho
tChunk, this); | 1027 WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel,
WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, this._addHeapSnapsho
tChunk, this); |
1028 WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel,
WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, this._reportHe
apSnapshotProgress, this); | 1028 WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel,
WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, this._reportHe
apSnapshotProgress, this); |
1029 } | 1029 }; |
1030 | 1030 |
1031 WebInspector.HeapSnapshotProfileType.TypeId = "HEAP"; | 1031 WebInspector.HeapSnapshotProfileType.TypeId = "HEAP"; |
1032 WebInspector.HeapSnapshotProfileType.SnapshotReceived = "SnapshotReceived"; | 1032 WebInspector.HeapSnapshotProfileType.SnapshotReceived = "SnapshotReceived"; |
1033 | 1033 |
1034 WebInspector.HeapSnapshotProfileType.prototype = { | 1034 WebInspector.HeapSnapshotProfileType.prototype = { |
1035 /** | 1035 /** |
1036 * @override | 1036 * @override |
1037 * @param {!WebInspector.Target} target | 1037 * @param {!WebInspector.Target} target |
1038 */ | 1038 */ |
1039 targetAdded: function(target) | 1039 targetAdded: function(target) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 }, | 1160 }, |
1161 | 1161 |
1162 _snapshotReceived: function(profile) | 1162 _snapshotReceived: function(profile) |
1163 { | 1163 { |
1164 if (this._profileBeingRecorded === profile) | 1164 if (this._profileBeingRecorded === profile) |
1165 this.setProfileBeingRecorded(null); | 1165 this.setProfileBeingRecorded(null); |
1166 this.dispatchEventToListeners(WebInspector.HeapSnapshotProfileType.Snaps
hotReceived, profile); | 1166 this.dispatchEventToListeners(WebInspector.HeapSnapshotProfileType.Snaps
hotReceived, profile); |
1167 }, | 1167 }, |
1168 | 1168 |
1169 __proto__: WebInspector.ProfileType.prototype | 1169 __proto__: WebInspector.ProfileType.prototype |
1170 } | 1170 }; |
1171 | 1171 |
1172 | 1172 |
1173 /** | 1173 /** |
1174 * @constructor | 1174 * @constructor |
1175 * @extends {WebInspector.HeapSnapshotProfileType} | 1175 * @extends {WebInspector.HeapSnapshotProfileType} |
1176 */ | 1176 */ |
1177 WebInspector.TrackingHeapSnapshotProfileType = function() | 1177 WebInspector.TrackingHeapSnapshotProfileType = function() |
1178 { | 1178 { |
1179 WebInspector.HeapSnapshotProfileType.call(this, WebInspector.TrackingHeapSna
pshotProfileType.TypeId, WebInspector.UIString("Record Allocation Timeline")); | 1179 WebInspector.HeapSnapshotProfileType.call(this, WebInspector.TrackingHeapSna
pshotProfileType.TypeId, WebInspector.UIString("Record Allocation Timeline")); |
1180 } | 1180 }; |
1181 | 1181 |
1182 WebInspector.TrackingHeapSnapshotProfileType.TypeId = "HEAP-RECORD"; | 1182 WebInspector.TrackingHeapSnapshotProfileType.TypeId = "HEAP-RECORD"; |
1183 | 1183 |
1184 WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate = "HeapStatsUpdate"
; | 1184 WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate = "HeapStatsUpdate"
; |
1185 WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted = "TrackingStarted"
; | 1185 WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted = "TrackingStarted"
; |
1186 WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped = "TrackingStopped"
; | 1186 WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped = "TrackingStopped"
; |
1187 | 1187 |
1188 | 1188 |
1189 /** | 1189 /** |
1190 * @constructor | 1190 * @constructor |
1191 */ | 1191 */ |
1192 WebInspector.TrackingHeapSnapshotProfileType.Samples = function() | 1192 WebInspector.TrackingHeapSnapshotProfileType.Samples = function() |
1193 { | 1193 { |
1194 /** @type {!Array.<number>} */ | 1194 /** @type {!Array.<number>} */ |
1195 this.sizes = []; | 1195 this.sizes = []; |
1196 /** @type {!Array.<number>} */ | 1196 /** @type {!Array.<number>} */ |
1197 this.ids = []; | 1197 this.ids = []; |
1198 /** @type {!Array.<number>} */ | 1198 /** @type {!Array.<number>} */ |
1199 this.timestamps = []; | 1199 this.timestamps = []; |
1200 /** @type {!Array.<number>} */ | 1200 /** @type {!Array.<number>} */ |
1201 this.max = []; | 1201 this.max = []; |
1202 /** @type {number} */ | 1202 /** @type {number} */ |
1203 this.totalTime = 30000; | 1203 this.totalTime = 30000; |
1204 } | 1204 }; |
1205 | 1205 |
1206 WebInspector.TrackingHeapSnapshotProfileType.prototype = { | 1206 WebInspector.TrackingHeapSnapshotProfileType.prototype = { |
1207 | 1207 |
1208 /** | 1208 /** |
1209 * @override | 1209 * @override |
1210 * @param {!WebInspector.Target} target | 1210 * @param {!WebInspector.Target} target |
1211 */ | 1211 */ |
1212 targetAdded: function(target) | 1212 targetAdded: function(target) |
1213 { | 1213 { |
1214 WebInspector.HeapSnapshotProfileType.prototype.targetAdded.call(this, ta
rget); | 1214 WebInspector.HeapSnapshotProfileType.prototype.targetAdded.call(this, ta
rget); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 /** | 1388 /** |
1389 * @override | 1389 * @override |
1390 */ | 1390 */ |
1391 profileBeingRecordedRemoved: function() | 1391 profileBeingRecordedRemoved: function() |
1392 { | 1392 { |
1393 this._stopRecordingProfile(); | 1393 this._stopRecordingProfile(); |
1394 this._profileSamples = null; | 1394 this._profileSamples = null; |
1395 }, | 1395 }, |
1396 | 1396 |
1397 __proto__: WebInspector.HeapSnapshotProfileType.prototype | 1397 __proto__: WebInspector.HeapSnapshotProfileType.prototype |
1398 } | 1398 }; |
1399 | 1399 |
1400 /** | 1400 /** |
1401 * @constructor | 1401 * @constructor |
1402 * @extends {WebInspector.ProfileHeader} | 1402 * @extends {WebInspector.ProfileHeader} |
1403 * @param {?WebInspector.Target} target | 1403 * @param {?WebInspector.Target} target |
1404 * @param {!WebInspector.HeapSnapshotProfileType} type | 1404 * @param {!WebInspector.HeapSnapshotProfileType} type |
1405 * @param {string=} title | 1405 * @param {string=} title |
1406 */ | 1406 */ |
1407 WebInspector.HeapProfileHeader = function(target, type, title) | 1407 WebInspector.HeapProfileHeader = function(target, type, title) |
1408 { | 1408 { |
(...skipping 19 matching lines...) Expand all Loading... |
1428 this._bufferedWriter = null; | 1428 this._bufferedWriter = null; |
1429 | 1429 |
1430 /** | 1430 /** |
1431 * @param {function(!WebInspector.HeapSnapshotProxy)} fulfill | 1431 * @param {function(!WebInspector.HeapSnapshotProxy)} fulfill |
1432 * @this {WebInspector.HeapProfileHeader} | 1432 * @this {WebInspector.HeapProfileHeader} |
1433 */ | 1433 */ |
1434 function loadResolver(fulfill) | 1434 function loadResolver(fulfill) |
1435 { | 1435 { |
1436 this._fulfillLoad = fulfill; | 1436 this._fulfillLoad = fulfill; |
1437 } | 1437 } |
1438 } | 1438 }; |
1439 | 1439 |
1440 WebInspector.HeapProfileHeader.prototype = { | 1440 WebInspector.HeapProfileHeader.prototype = { |
1441 /** | 1441 /** |
1442 * @override | 1442 * @override |
1443 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e | 1443 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
1444 * @return {!WebInspector.ProfileSidebarTreeElement} | 1444 * @return {!WebInspector.ProfileSidebarTreeElement} |
1445 */ | 1445 */ |
1446 createSidebarTreeElement: function(dataDisplayDelegate) | 1446 createSidebarTreeElement: function(dataDisplayDelegate) |
1447 { | 1447 { |
1448 return new WebInspector.ProfileSidebarTreeElement(dataDisplayDelegate, t
his, "heap-snapshot-sidebar-tree-item"); | 1448 return new WebInspector.ProfileSidebarTreeElement(dataDisplayDelegate, t
his, "heap-snapshot-sidebar-tree-item"); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 var fileReader = this._createFileReader(file, delegate); | 1637 var fileReader = this._createFileReader(file, delegate); |
1638 fileReader.start(this._receiver); | 1638 fileReader.start(this._receiver); |
1639 }, | 1639 }, |
1640 | 1640 |
1641 _createFileReader: function(file, delegate) | 1641 _createFileReader: function(file, delegate) |
1642 { | 1642 { |
1643 return new WebInspector.ChunkedFileReader(file, 10000000, delegate); | 1643 return new WebInspector.ChunkedFileReader(file, 10000000, delegate); |
1644 }, | 1644 }, |
1645 | 1645 |
1646 __proto__: WebInspector.ProfileHeader.prototype | 1646 __proto__: WebInspector.ProfileHeader.prototype |
1647 } | 1647 }; |
1648 | 1648 |
1649 /** | 1649 /** |
1650 * @constructor | 1650 * @constructor |
1651 * @implements {WebInspector.OutputStreamDelegate} | 1651 * @implements {WebInspector.OutputStreamDelegate} |
1652 */ | 1652 */ |
1653 WebInspector.HeapSnapshotLoadFromFileDelegate = function(snapshotHeader) | 1653 WebInspector.HeapSnapshotLoadFromFileDelegate = function(snapshotHeader) |
1654 { | 1654 { |
1655 this._snapshotHeader = snapshotHeader; | 1655 this._snapshotHeader = snapshotHeader; |
1656 } | 1656 }; |
1657 | 1657 |
1658 WebInspector.HeapSnapshotLoadFromFileDelegate.prototype = { | 1658 WebInspector.HeapSnapshotLoadFromFileDelegate.prototype = { |
1659 /** | 1659 /** |
1660 * @override | 1660 * @override |
1661 */ | 1661 */ |
1662 onTransferStarted: function() | 1662 onTransferStarted: function() |
1663 { | 1663 { |
1664 }, | 1664 }, |
1665 | 1665 |
1666 /** | 1666 /** |
(...skipping 26 matching lines...) Expand all Loading... |
1693 case e.target.error.NOT_READABLE_ERR: | 1693 case e.target.error.NOT_READABLE_ERR: |
1694 subtitle = WebInspector.UIString("'%s' is not readable", reader.file
Name()); | 1694 subtitle = WebInspector.UIString("'%s' is not readable", reader.file
Name()); |
1695 break; | 1695 break; |
1696 case e.target.error.ABORT_ERR: | 1696 case e.target.error.ABORT_ERR: |
1697 return; | 1697 return; |
1698 default: | 1698 default: |
1699 subtitle = WebInspector.UIString("'%s' error %d", reader.fileName(),
e.target.error.code); | 1699 subtitle = WebInspector.UIString("'%s' error %d", reader.fileName(),
e.target.error.code); |
1700 } | 1700 } |
1701 this._snapshotHeader.updateStatus(subtitle); | 1701 this._snapshotHeader.updateStatus(subtitle); |
1702 } | 1702 } |
1703 } | 1703 }; |
1704 | 1704 |
1705 /** | 1705 /** |
1706 * @constructor | 1706 * @constructor |
1707 * @implements {WebInspector.OutputStreamDelegate} | 1707 * @implements {WebInspector.OutputStreamDelegate} |
1708 * @param {!WebInspector.HeapProfileHeader} profileHeader | 1708 * @param {!WebInspector.HeapProfileHeader} profileHeader |
1709 */ | 1709 */ |
1710 WebInspector.SaveSnapshotOutputStreamDelegate = function(profileHeader) | 1710 WebInspector.SaveSnapshotOutputStreamDelegate = function(profileHeader) |
1711 { | 1711 { |
1712 this._profileHeader = profileHeader; | 1712 this._profileHeader = profileHeader; |
1713 } | 1713 }; |
1714 | 1714 |
1715 WebInspector.SaveSnapshotOutputStreamDelegate.prototype = { | 1715 WebInspector.SaveSnapshotOutputStreamDelegate.prototype = { |
1716 /** | 1716 /** |
1717 * @override | 1717 * @override |
1718 */ | 1718 */ |
1719 onTransferStarted: function() | 1719 onTransferStarted: function() |
1720 { | 1720 { |
1721 this._profileHeader._updateSaveProgress(0, 1); | 1721 this._profileHeader._updateSaveProgress(0, 1); |
1722 }, | 1722 }, |
1723 | 1723 |
(...skipping 17 matching lines...) Expand all Loading... |
1741 /** | 1741 /** |
1742 * @override | 1742 * @override |
1743 * @param {!WebInspector.ChunkedReader} reader | 1743 * @param {!WebInspector.ChunkedReader} reader |
1744 * @param {!Event} event | 1744 * @param {!Event} event |
1745 */ | 1745 */ |
1746 onError: function(reader, event) | 1746 onError: function(reader, event) |
1747 { | 1747 { |
1748 WebInspector.console.error("Failed to read heap snapshot from temp file:
" + /** @type {!ErrorEvent} */ (event).message); | 1748 WebInspector.console.error("Failed to read heap snapshot from temp file:
" + /** @type {!ErrorEvent} */ (event).message); |
1749 this.onTransferFinished(); | 1749 this.onTransferFinished(); |
1750 } | 1750 } |
1751 } | 1751 }; |
1752 | 1752 |
1753 /** | 1753 /** |
1754 * @constructor | 1754 * @constructor |
1755 * @extends {WebInspector.VBox} | 1755 * @extends {WebInspector.VBox} |
1756 * @param {!WebInspector.HeapProfileHeader} heapProfileHeader | 1756 * @param {!WebInspector.HeapProfileHeader} heapProfileHeader |
1757 */ | 1757 */ |
1758 WebInspector.HeapTrackingOverviewGrid = function(heapProfileHeader) | 1758 WebInspector.HeapTrackingOverviewGrid = function(heapProfileHeader) |
1759 { | 1759 { |
1760 WebInspector.VBox.call(this); | 1760 WebInspector.VBox.call(this); |
1761 this.element.id = "heap-recording-view"; | 1761 this.element.id = "heap-recording-view"; |
(...skipping 12 matching lines...) Expand all Loading... |
1774 this._profileType = heapProfileHeader.profileType(); | 1774 this._profileType = heapProfileHeader.profileType(); |
1775 if (!heapProfileHeader.fromFile() && heapProfileHeader.profileType().profile
BeingRecorded() === heapProfileHeader) { | 1775 if (!heapProfileHeader.fromFile() && heapProfileHeader.profileType().profile
BeingRecorded() === heapProfileHeader) { |
1776 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); | 1776 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); |
1777 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.TrackingStopped, this._onStopTracking, this); | 1777 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.TrackingStopped, this._onStopTracking, this); |
1778 } | 1778 } |
1779 this._windowLeft = 0.0; | 1779 this._windowLeft = 0.0; |
1780 this._windowRight = 1.0; | 1780 this._windowRight = 1.0; |
1781 this._overviewGrid.setWindow(this._windowLeft, this._windowRight); | 1781 this._overviewGrid.setWindow(this._windowLeft, this._windowRight); |
1782 this._yScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); | 1782 this._yScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); |
1783 this._xScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); | 1783 this._xScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); |
1784 } | 1784 }; |
1785 | 1785 |
1786 WebInspector.HeapTrackingOverviewGrid.IdsRangeChanged = "IdsRangeChanged"; | 1786 WebInspector.HeapTrackingOverviewGrid.IdsRangeChanged = "IdsRangeChanged"; |
1787 | 1787 |
1788 WebInspector.HeapTrackingOverviewGrid.prototype = { | 1788 WebInspector.HeapTrackingOverviewGrid.prototype = { |
1789 dispose: function() | 1789 dispose: function() |
1790 { | 1790 { |
1791 this._onStopTracking(); | 1791 this._onStopTracking(); |
1792 }, | 1792 }, |
1793 | 1793 |
1794 _onStopTracking: function() | 1794 _onStopTracking: function() |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 minId = ids[i]; | 2014 minId = ids[i]; |
2015 continue; | 2015 continue; |
2016 } | 2016 } |
2017 size += sizes[i]; | 2017 size += sizes[i]; |
2018 } | 2018 } |
2019 | 2019 |
2020 this.dispatchEventToListeners(WebInspector.HeapTrackingOverviewGrid.IdsR
angeChanged, {minId: minId, maxId: maxId, size: size}); | 2020 this.dispatchEventToListeners(WebInspector.HeapTrackingOverviewGrid.IdsR
angeChanged, {minId: minId, maxId: maxId, size: size}); |
2021 }, | 2021 }, |
2022 | 2022 |
2023 __proto__: WebInspector.VBox.prototype | 2023 __proto__: WebInspector.VBox.prototype |
2024 } | 2024 }; |
2025 | 2025 |
2026 | 2026 |
2027 /** | 2027 /** |
2028 * @constructor | 2028 * @constructor |
2029 */ | 2029 */ |
2030 WebInspector.HeapTrackingOverviewGrid.SmoothScale = function() | 2030 WebInspector.HeapTrackingOverviewGrid.SmoothScale = function() |
2031 { | 2031 { |
2032 this._lastUpdate = 0; | 2032 this._lastUpdate = 0; |
2033 this._currentScale = 0.0; | 2033 this._currentScale = 0.0; |
2034 } | 2034 }; |
2035 | 2035 |
2036 WebInspector.HeapTrackingOverviewGrid.SmoothScale.prototype = { | 2036 WebInspector.HeapTrackingOverviewGrid.SmoothScale.prototype = { |
2037 /** | 2037 /** |
2038 * @param {number} target | 2038 * @param {number} target |
2039 * @return {number} | 2039 * @return {number} |
2040 */ | 2040 */ |
2041 nextScale: function(target) { | 2041 nextScale: function(target) { |
2042 target = target || this._currentScale; | 2042 target = target || this._currentScale; |
2043 if (this._currentScale) { | 2043 if (this._currentScale) { |
2044 var now = Date.now(); | 2044 var now = Date.now(); |
2045 var timeDeltaMs = now - this._lastUpdate; | 2045 var timeDeltaMs = now - this._lastUpdate; |
2046 this._lastUpdate = now; | 2046 this._lastUpdate = now; |
2047 var maxChangePerSec = 20; | 2047 var maxChangePerSec = 20; |
2048 var maxChangePerDelta = Math.pow(maxChangePerSec, timeDeltaMs / 1000
); | 2048 var maxChangePerDelta = Math.pow(maxChangePerSec, timeDeltaMs / 1000
); |
2049 var scaleChange = target / this._currentScale; | 2049 var scaleChange = target / this._currentScale; |
2050 this._currentScale *= Number.constrain(scaleChange, 1 / maxChangePer
Delta, maxChangePerDelta); | 2050 this._currentScale *= Number.constrain(scaleChange, 1 / maxChangePer
Delta, maxChangePerDelta); |
2051 } else { | 2051 } else { |
2052 this._currentScale = target; | 2052 this._currentScale = target; |
2053 } | 2053 } |
2054 return this._currentScale; | 2054 return this._currentScale; |
2055 } | 2055 } |
2056 } | 2056 }; |
2057 | 2057 |
2058 | 2058 |
2059 /** | 2059 /** |
2060 * @constructor | 2060 * @constructor |
2061 * @implements {WebInspector.TimelineGrid.Calculator} | 2061 * @implements {WebInspector.TimelineGrid.Calculator} |
2062 */ | 2062 */ |
2063 WebInspector.HeapTrackingOverviewGrid.OverviewCalculator = function() | 2063 WebInspector.HeapTrackingOverviewGrid.OverviewCalculator = function() |
2064 { | 2064 { |
2065 } | 2065 }; |
2066 | 2066 |
2067 WebInspector.HeapTrackingOverviewGrid.OverviewCalculator.prototype = { | 2067 WebInspector.HeapTrackingOverviewGrid.OverviewCalculator.prototype = { |
2068 /** | 2068 /** |
2069 * @override | 2069 * @override |
2070 * @return {number} | 2070 * @return {number} |
2071 */ | 2071 */ |
2072 paddingLeft: function() | 2072 paddingLeft: function() |
2073 { | 2073 { |
2074 return 0; | 2074 return 0; |
2075 }, | 2075 }, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2133 }, | 2133 }, |
2134 | 2134 |
2135 /** | 2135 /** |
2136 * @override | 2136 * @override |
2137 * @return {number} | 2137 * @return {number} |
2138 */ | 2138 */ |
2139 boundarySpan: function() | 2139 boundarySpan: function() |
2140 { | 2140 { |
2141 return this._maximumBoundaries - this._minimumBoundaries; | 2141 return this._maximumBoundaries - this._minimumBoundaries; |
2142 } | 2142 } |
2143 } | 2143 }; |
2144 | 2144 |
2145 | 2145 |
2146 /** | 2146 /** |
2147 * @constructor | 2147 * @constructor |
2148 * @extends {WebInspector.VBox} | 2148 * @extends {WebInspector.VBox} |
2149 */ | 2149 */ |
2150 WebInspector.HeapSnapshotStatisticsView = function() | 2150 WebInspector.HeapSnapshotStatisticsView = function() |
2151 { | 2151 { |
2152 WebInspector.VBox.call(this); | 2152 WebInspector.VBox.call(this); |
2153 this.setMinimumSize(50, 25); | 2153 this.setMinimumSize(50, 25); |
2154 this._pieChart = new WebInspector.PieChart(150, WebInspector.HeapSnapshotSta
tisticsView._valueFormatter, true); | 2154 this._pieChart = new WebInspector.PieChart(150, WebInspector.HeapSnapshotSta
tisticsView._valueFormatter, true); |
2155 this._pieChart.element.classList.add("heap-snapshot-stats-pie-chart"); | 2155 this._pieChart.element.classList.add("heap-snapshot-stats-pie-chart"); |
2156 this.element.appendChild(this._pieChart.element); | 2156 this.element.appendChild(this._pieChart.element); |
2157 this._labels = this.element.createChild("div", "heap-snapshot-stats-legend")
; | 2157 this._labels = this.element.createChild("div", "heap-snapshot-stats-legend")
; |
2158 } | 2158 }; |
2159 | 2159 |
2160 /** | 2160 /** |
2161 * @param {number} value | 2161 * @param {number} value |
2162 * @return {string} | 2162 * @return {string} |
2163 */ | 2163 */ |
2164 WebInspector.HeapSnapshotStatisticsView._valueFormatter = function(value) | 2164 WebInspector.HeapSnapshotStatisticsView._valueFormatter = function(value) |
2165 { | 2165 { |
2166 return WebInspector.UIString("%s KB", Number.withThousandsSeparator(Math.rou
nd(value / 1024))); | 2166 return WebInspector.UIString("%s KB", Number.withThousandsSeparator(Math.rou
nd(value / 1024))); |
2167 } | 2167 }; |
2168 | 2168 |
2169 WebInspector.HeapSnapshotStatisticsView.prototype = { | 2169 WebInspector.HeapSnapshotStatisticsView.prototype = { |
2170 /** | 2170 /** |
2171 * @param {number} value | 2171 * @param {number} value |
2172 */ | 2172 */ |
2173 setTotal: function(value) | 2173 setTotal: function(value) |
2174 { | 2174 { |
2175 this._pieChart.setTotal(value); | 2175 this._pieChart.setTotal(value); |
2176 }, | 2176 }, |
2177 | 2177 |
(...skipping 13 matching lines...) Expand all Loading... |
2191 var sizeDiv = node.createChild("div", "heap-snapshot-stats-size"); | 2191 var sizeDiv = node.createChild("div", "heap-snapshot-stats-size"); |
2192 if (color) | 2192 if (color) |
2193 swatchDiv.style.backgroundColor = color; | 2193 swatchDiv.style.backgroundColor = color; |
2194 else | 2194 else |
2195 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); | 2195 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); |
2196 nameDiv.textContent = name; | 2196 nameDiv.textContent = name; |
2197 sizeDiv.textContent = WebInspector.HeapSnapshotStatisticsView._valueForm
atter(value); | 2197 sizeDiv.textContent = WebInspector.HeapSnapshotStatisticsView._valueForm
atter(value); |
2198 }, | 2198 }, |
2199 | 2199 |
2200 __proto__: WebInspector.VBox.prototype | 2200 __proto__: WebInspector.VBox.prototype |
2201 } | 2201 }; |
2202 | 2202 |
2203 /** | 2203 /** |
2204 * @constructor | 2204 * @constructor |
2205 * @extends {WebInspector.Widget} | 2205 * @extends {WebInspector.Widget} |
2206 * @param {?WebInspector.Target} target | 2206 * @param {?WebInspector.Target} target |
2207 */ | 2207 */ |
2208 WebInspector.HeapAllocationStackView = function(target) | 2208 WebInspector.HeapAllocationStackView = function(target) |
2209 { | 2209 { |
2210 WebInspector.Widget.call(this); | 2210 WebInspector.Widget.call(this); |
2211 this._target = target; | 2211 this._target = target; |
2212 this._linkifier = new WebInspector.Linkifier(); | 2212 this._linkifier = new WebInspector.Linkifier(); |
2213 } | 2213 }; |
2214 | 2214 |
2215 WebInspector.HeapAllocationStackView.prototype = { | 2215 WebInspector.HeapAllocationStackView.prototype = { |
2216 /** | 2216 /** |
2217 * @param {!WebInspector.HeapSnapshotProxy} snapshot | 2217 * @param {!WebInspector.HeapSnapshotProxy} snapshot |
2218 * @param {number} snapshotNodeIndex | 2218 * @param {number} snapshotNodeIndex |
2219 */ | 2219 */ |
2220 setAllocatedObject: function(snapshot, snapshotNodeIndex) | 2220 setAllocatedObject: function(snapshot, snapshotNodeIndex) |
2221 { | 2221 { |
2222 this.clear(); | 2222 this.clear(); |
2223 snapshot.allocationStack(snapshotNodeIndex, this._didReceiveAllocationSt
ack.bind(this)); | 2223 snapshot.allocationStack(snapshotNodeIndex, this._didReceiveAllocationSt
ack.bind(this)); |
(...skipping 23 matching lines...) Expand all Loading... |
2247 var name = frameDiv.createChild("div"); | 2247 var name = frameDiv.createChild("div"); |
2248 name.textContent = WebInspector.beautifyFunctionName(frame.functionN
ame); | 2248 name.textContent = WebInspector.beautifyFunctionName(frame.functionN
ame); |
2249 if (frame.scriptId) { | 2249 if (frame.scriptId) { |
2250 var urlElement = this._linkifier.linkifyScriptLocation(this._tar
get, String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1)
; | 2250 var urlElement = this._linkifier.linkifyScriptLocation(this._tar
get, String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1)
; |
2251 frameDiv.appendChild(urlElement); | 2251 frameDiv.appendChild(urlElement); |
2252 } | 2252 } |
2253 } | 2253 } |
2254 }, | 2254 }, |
2255 | 2255 |
2256 __proto__: WebInspector.Widget.prototype | 2256 __proto__: WebInspector.Widget.prototype |
2257 } | 2257 }; |
OLD | NEW |