| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 this._windowEndTime = Infinity; | 61 this._windowEndTime = Infinity; |
| 62 | 62 |
| 63 // Create model. | 63 // Create model. |
| 64 this._model = new WebInspector.TimelineModel(); | 64 this._model = new WebInspector.TimelineModel(); |
| 65 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 65 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
| 66 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); | 66 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); |
| 67 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); | 67 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); |
| 68 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded,
this._onRecordAdded, this); | 68 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded,
this._onRecordAdded, this); |
| 69 | 69 |
| 70 // Create presentation model. | 70 // Create presentation model. |
| 71 this._presentationModel = new WebInspector.TimelinePresentationModel(); | 71 this._presentationModel = new WebInspector.TimelinePresentationModel(this._m
odel); |
| 72 this._durationFilter = new WebInspector.TimelineIsLongFilter(); | 72 this._durationFilter = new WebInspector.TimelineIsLongFilter(); |
| 73 this._windowFilter = new WebInspector.TimelineWindowFilter(); | 73 this._windowFilter = new WebInspector.TimelineWindowFilter(); |
| 74 this._presentationModel.addFilter(this._windowFilter); | 74 this._presentationModel.addFilter(this._windowFilter); |
| 75 this._presentationModel.addFilter(new WebInspector.TimelineCategoryFilter())
; | 75 this._presentationModel.addFilter(new WebInspector.TimelineCategoryFilter())
; |
| 76 this._presentationModel.addFilter(this._durationFilter); | 76 this._presentationModel.addFilter(this._durationFilter); |
| 77 | 77 |
| 78 this._presentationModeSetting = WebInspector.settings.createSetting("timelin
eOverviewMode", WebInspector.TimelinePanel.Mode.Events); | 78 this._presentationModeSetting = WebInspector.settings.createSetting("timelin
eOverviewMode", WebInspector.TimelinePanel.Mode.Events); |
| 79 | 79 |
| 80 this._createStatusBarItems(); | 80 this._createStatusBarItems(); |
| 81 | 81 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 * @param {string} mode | 219 * @param {string} mode |
| 220 */ | 220 */ |
| 221 _viewsForMode: function(mode) | 221 _viewsForMode: function(mode) |
| 222 { | 222 { |
| 223 var views = this._viewsMap[mode]; | 223 var views = this._viewsMap[mode]; |
| 224 if (!views) { | 224 if (!views) { |
| 225 views = {}; | 225 views = {}; |
| 226 switch (mode) { | 226 switch (mode) { |
| 227 case WebInspector.TimelinePanel.Mode.Events: | 227 case WebInspector.TimelinePanel.Mode.Events: |
| 228 views.overviewView = new WebInspector.TimelineEventOverview(this
._model); | 228 views.overviewView = new WebInspector.TimelineEventOverview(this
._model); |
| 229 views.mainViews = [new WebInspector.TimelineView(this, this._pre
sentationModel, null)]; | 229 views.mainViews = [new WebInspector.TimelineView(this, this._mod
el, this._presentationModel, null)]; |
| 230 break; | 230 break; |
| 231 case WebInspector.TimelinePanel.Mode.Frames: | 231 case WebInspector.TimelinePanel.Mode.Frames: |
| 232 views.overviewView = new WebInspector.TimelineFrameOverview(this
._model, this.frameModel()); | 232 views.overviewView = new WebInspector.TimelineFrameOverview(this
._model, this.frameModel()); |
| 233 views.mainViews = [new WebInspector.TimelineView(this, this._pre
sentationModel, this.frameModel())]; | 233 views.mainViews = [new WebInspector.TimelineView(this, this._mod
el, this._presentationModel, this.frameModel())]; |
| 234 break; | 234 break; |
| 235 case WebInspector.TimelinePanel.Mode.Memory: | 235 case WebInspector.TimelinePanel.Mode.Memory: |
| 236 views.overviewView = new WebInspector.TimelineMemoryOverview(thi
s._model); | 236 views.overviewView = new WebInspector.TimelineMemoryOverview(thi
s._model); |
| 237 var timelineView = new WebInspector.TimelineView(this, this._pre
sentationModel, null); | 237 var timelineView = new WebInspector.TimelineView(this, this._mod
el, this._presentationModel, null); |
| 238 views.mainViews = [timelineView]; | 238 views.mainViews = [timelineView]; |
| 239 var memoryStatistics = new WebInspector.CountersGraph(this, this
._presentationModel); | 239 var memoryStatistics = new WebInspector.CountersGraph(this, this
._presentationModel); |
| 240 views.mainViews.push(memoryStatistics); | 240 views.mainViews.push(memoryStatistics); |
| 241 break; | 241 break; |
| 242 case WebInspector.TimelinePanel.Mode.FlameChart: | 242 case WebInspector.TimelinePanel.Mode.FlameChart: |
| 243 views.overviewView = new WebInspector.TimelineFrameOverview(this
._model, this.frameModel()); | 243 views.overviewView = new WebInspector.TimelineFrameOverview(this
._model, this.frameModel()); |
| 244 views.mainViews = [ | 244 views.mainViews = [ |
| 245 new WebInspector.TimelineFlameChart(this, this._model, this.
frameModel(), true), | 245 new WebInspector.TimelineFlameChart(this, this._model, this.
frameModel(), true), |
| 246 new WebInspector.TimelineFlameChart(this, this._model, this.
frameModel(), false) | 246 new WebInspector.TimelineFlameChart(this, this._model, this.
frameModel(), false) |
| 247 ]; | 247 ]; |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 | 1046 |
| 1047 /** | 1047 /** |
| 1048 * @param {!WebInspector.TimelinePresentationModel.Record} record | 1048 * @param {!WebInspector.TimelinePresentationModel.Record} record |
| 1049 * @return {boolean} | 1049 * @return {boolean} |
| 1050 */ | 1050 */ |
| 1051 accept: function(record) | 1051 accept: function(record) |
| 1052 { | 1052 { |
| 1053 return record.lastChildEndTime >= this._windowStartTime && record.startT
ime <= this._windowEndTime; | 1053 return record.lastChildEndTime >= this._windowStartTime && record.startT
ime <= this._windowEndTime; |
| 1054 } | 1054 } |
| 1055 } | 1055 } |
| OLD | NEW |