| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 return -1; | 437 return -1; |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 | 440 |
| 441 /** | 441 /** |
| 442 * @constructor | 442 * @constructor |
| 443 * @implements {WebInspector.FlameChartDataProvider} | 443 * @implements {WebInspector.FlameChartDataProvider} |
| 444 * @implements {WebInspector.TimelineFlameChart.SelectionProvider} | 444 * @implements {WebInspector.TimelineFlameChart.SelectionProvider} |
| 445 * @param {!WebInspector.TracingTimelineModel} model | 445 * @param {!WebInspector.TracingTimelineModel} model |
| 446 * @param {!WebInspector.TimelineFrameModelBase} frameModel | 446 * @param {!WebInspector.TimelineFrameModelBase} frameModel |
| 447 * @param {!WebInspector.Target} target | |
| 448 */ | 447 */ |
| 449 WebInspector.TracingBasedTimelineFlameChartDataProvider = function(model, frameM
odel, target) | 448 WebInspector.TracingBasedTimelineFlameChartDataProvider = function(model, frameM
odel) |
| 450 { | 449 { |
| 451 WebInspector.FlameChartDataProvider.call(this); | 450 WebInspector.FlameChartDataProvider.call(this); |
| 452 this._model = model; | 451 this._model = model; |
| 453 this._frameModel = frameModel; | 452 this._frameModel = frameModel; |
| 454 this._target = target; | |
| 455 this._font = "12px " + WebInspector.fontFamily(); | 453 this._font = "12px " + WebInspector.fontFamily(); |
| 456 this._linkifier = new WebInspector.Linkifier(); | 454 this._linkifier = new WebInspector.Linkifier(); |
| 457 this._palette = new WebInspector.TraceViewPalette(); | 455 this._palette = new WebInspector.TraceViewPalette(); |
| 458 this._entryIndexToTitle = {}; | 456 this._entryIndexToTitle = {}; |
| 459 this._filters = []; | 457 this._filters = []; |
| 460 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); | 458 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); |
| 461 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte
r([WebInspector.TracingTimelineModel.RecordType.Program])); | 459 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte
r([WebInspector.TracingTimelineModel.RecordType.Program])); |
| 462 } | 460 } |
| 463 | 461 |
| 464 WebInspector.TracingBasedTimelineFlameChartDataProvider.prototype = { | 462 WebInspector.TracingBasedTimelineFlameChartDataProvider.prototype = { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 /** | 496 /** |
| 499 * @param {number} entryIndex | 497 * @param {number} entryIndex |
| 500 * @return {?string} | 498 * @return {?string} |
| 501 */ | 499 */ |
| 502 entryTitle: function(entryIndex) | 500 entryTitle: function(entryIndex) |
| 503 { | 501 { |
| 504 var event = this._entryEvents[entryIndex]; | 502 var event = this._entryEvents[entryIndex]; |
| 505 if (event) { | 503 if (event) { |
| 506 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev
ent.name).title; | 504 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev
ent.name).title; |
| 507 // TODO(yurys): support event dividers | 505 // TODO(yurys): support event dividers |
| 508 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo
rTraceEvent(event, this._linkifier, false, this._target); | 506 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo
rTraceEvent(event, this._linkifier); |
| 509 return details ? WebInspector.UIString("%s (%s)", name, details.text
Content) : name; | 507 return details ? WebInspector.UIString("%s (%s)", name, details.text
Content) : name; |
| 510 } | 508 } |
| 511 var title = this._entryIndexToTitle[entryIndex]; | 509 var title = this._entryIndexToTitle[entryIndex]; |
| 512 if (!title) { | 510 if (!title) { |
| 513 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex
); | 511 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex
); |
| 514 console.error(title); | 512 console.error(title); |
| 515 } | 513 } |
| 516 return title; | 514 return title; |
| 517 }, | 515 }, |
| 518 | 516 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 * @param {!WebInspector.TimelineUIUtils} uiUtils | 847 * @param {!WebInspector.TimelineUIUtils} uiUtils |
| 850 */ | 848 */ |
| 851 WebInspector.TimelineFlameChart = function(delegate, model, tracingModel, frameM
odel, uiUtils) | 849 WebInspector.TimelineFlameChart = function(delegate, model, tracingModel, frameM
odel, uiUtils) |
| 852 { | 850 { |
| 853 WebInspector.VBox.call(this); | 851 WebInspector.VBox.call(this); |
| 854 this.element.classList.add("timeline-flamechart"); | 852 this.element.classList.add("timeline-flamechart"); |
| 855 this.registerRequiredCSS("flameChart.css"); | 853 this.registerRequiredCSS("flameChart.css"); |
| 856 this._delegate = delegate; | 854 this._delegate = delegate; |
| 857 this._model = model; | 855 this._model = model; |
| 858 this._dataProvider = tracingModel | 856 this._dataProvider = tracingModel |
| 859 ? new WebInspector.TracingBasedTimelineFlameChartDataProvider(tracingMod
el, frameModel, model.target()) | 857 ? new WebInspector.TracingBasedTimelineFlameChartDataProvider(tracingMod
el, frameModel) |
| 860 : new WebInspector.TimelineFlameChartDataProvider(/** @type {!WebInspect
or.TimelineModelImpl} */(model), frameModel, uiUtils); | 858 : new WebInspector.TimelineFlameChartDataProvider(/** @type {!WebInspect
or.TimelineModelImpl} */(model), frameModel, uiUtils); |
| 861 this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true)
; | 859 this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true)
; |
| 862 this._mainView.show(this.element); | 860 this._mainView.show(this.element); |
| 863 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 861 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
| 864 this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected
, this._onEntrySelected, this); | 862 this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected
, this._onEntrySelected, this); |
| 865 } | 863 } |
| 866 | 864 |
| 867 WebInspector.TimelineFlameChart.prototype = { | 865 WebInspector.TimelineFlameChart.prototype = { |
| 868 dispose: function() | 866 dispose: function() |
| 869 { | 867 { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 * @param {number} entryIndex | 1010 * @param {number} entryIndex |
| 1013 * @return {?WebInspector.TimelineSelection} | 1011 * @return {?WebInspector.TimelineSelection} |
| 1014 */ | 1012 */ |
| 1015 createSelection: function(entryIndex) { }, | 1013 createSelection: function(entryIndex) { }, |
| 1016 /** | 1014 /** |
| 1017 * @param {?WebInspector.TimelineSelection} selection | 1015 * @param {?WebInspector.TimelineSelection} selection |
| 1018 * @return {number} | 1016 * @return {number} |
| 1019 */ | 1017 */ |
| 1020 entryIndexForSelection: function(selection) { } | 1018 entryIndexForSelection: function(selection) { } |
| 1021 } | 1019 } |
| OLD | NEW |