| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 this._model.addFilter(this._durationFilter); | 106 this._model.addFilter(this._durationFilter); |
| 107 this._model.addFilter(this._textFilter); | 107 this._model.addFilter(this._textFilter); |
| 108 | 108 |
| 109 /** @type {!Array.<!WebInspector.TimelineModeView>} */ | 109 /** @type {!Array.<!WebInspector.TimelineModeView>} */ |
| 110 this._currentViews = []; | 110 this._currentViews = []; |
| 111 | 111 |
| 112 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve
rviewMode", WebInspector.TimelinePanel.OverviewMode.Events); | 112 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve
rviewMode", WebInspector.TimelinePanel.OverviewMode.Events); |
| 113 this._flameChartEnabledSetting = WebInspector.settings.createSetting("timeli
neFlameChartEnabled", false); | 113 this._flameChartEnabledSetting = WebInspector.settings.createSetting("timeli
neFlameChartEnabled", false); |
| 114 this._createStatusBarItems(); | 114 this._createStatusBarItems(); |
| 115 | 115 |
| 116 this._topPane = new WebInspector.SplitView(true, false); | 116 var topPaneElement = this.element.createChild("div", "hbox"); |
| 117 this._topPane.element.id = "timeline-overview-panel"; | 117 topPaneElement.id = "timeline-overview-panel"; |
| 118 this._topPane.show(this.element); | |
| 119 this._topPane.addEventListener(WebInspector.SplitView.Events.SidebarSizeChan
ged, this._sidebarResized, this); | |
| 120 this._topPane.setResizable(false); | |
| 121 this._createRecordingOptions(); | |
| 122 | 118 |
| 123 // Create top overview component. | 119 // Create top overview component. |
| 124 this._overviewPane = new WebInspector.TimelineOverviewPane(this._model, this
._uiUtils); | 120 this._overviewPane = new WebInspector.TimelineOverviewPane(this._model, this
._uiUtils); |
| 125 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events
.WindowChanged, this._onWindowChanged.bind(this)); | 121 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events
.WindowChanged, this._onWindowChanged.bind(this)); |
| 126 this._overviewPane.show(this._topPane.mainElement()); | 122 this._overviewPane.show(topPaneElement); |
| 127 | 123 |
| 128 this._createFileSelector(); | 124 this._createFileSelector(); |
| 129 this._registerShortcuts(); | 125 this._registerShortcuts(); |
| 130 | 126 |
| 131 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.WillReloadPage, this._willReloadPage, this); | 127 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.WillReloadPage, this._willReloadPage, this); |
| 132 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.Load, this._loadEventFired, this); | 128 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.Load, this._loadEventFired, this); |
| 133 | 129 |
| 134 // Create top level properties splitter. | 130 // Create top level properties splitter. |
| 135 this._detailsSplitView = new WebInspector.SplitView(false, true, "timelinePa
nelDetailsSplitViewState"); | 131 this._detailsSplitView = new WebInspector.SplitView(false, true, "timelinePa
nelDetailsSplitViewState"); |
| 136 this._detailsSplitView.element.classList.add("timeline-details-split"); | 132 this._detailsSplitView.element.classList.add("timeline-details-split"); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return this._windowEndTime; | 230 return this._windowEndTime; |
| 235 return this._model.maximumRecordTime() || Infinity; | 231 return this._model.maximumRecordTime() || Infinity; |
| 236 }, | 232 }, |
| 237 | 233 |
| 238 /** | 234 /** |
| 239 * @param {!WebInspector.Event} event | 235 * @param {!WebInspector.Event} event |
| 240 */ | 236 */ |
| 241 _sidebarResized: function(event) | 237 _sidebarResized: function(event) |
| 242 { | 238 { |
| 243 var width = /** @type {number} */ (event.data); | 239 var width = /** @type {number} */ (event.data); |
| 244 this._topPane.setSidebarSize(width); | |
| 245 for (var i = 0; i < this._currentViews.length; ++i) | 240 for (var i = 0; i < this._currentViews.length; ++i) |
| 246 this._currentViews[i].setSidebarSize(width); | 241 this._currentViews[i].setSidebarSize(width); |
| 247 }, | 242 }, |
| 248 | 243 |
| 249 /** | 244 /** |
| 250 * @param {!WebInspector.Event} event | 245 * @param {!WebInspector.Event} event |
| 251 */ | 246 */ |
| 252 _onWindowChanged: function(event) | 247 _onWindowChanged: function(event) |
| 253 { | 248 { |
| 254 this._windowStartTime = event.data.startTime; | 249 this._windowStartTime = event.data.startTime; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return this._lazyPaintProfilerView; | 311 return this._lazyPaintProfilerView; |
| 317 }, | 312 }, |
| 318 | 313 |
| 319 /** | 314 /** |
| 320 * @param {!WebInspector.TimelineModeView} modeView | 315 * @param {!WebInspector.TimelineModeView} modeView |
| 321 */ | 316 */ |
| 322 _addModeView: function(modeView) | 317 _addModeView: function(modeView) |
| 323 { | 318 { |
| 324 modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime()); | 319 modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime()); |
| 325 modeView.refreshRecords(this._textFilter._regex); | 320 modeView.refreshRecords(this._textFilter._regex); |
| 326 modeView.view().setSidebarSize(this._topPane.sidebarSize()); | |
| 327 this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackS
plitViewState"); | 321 this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackS
plitViewState"); |
| 328 modeView.view().addEventListener(WebInspector.SplitView.Events.SidebarSi
zeChanged, this._sidebarResized, this); | 322 modeView.view().addEventListener(WebInspector.SplitView.Events.SidebarSi
zeChanged, this._sidebarResized, this); |
| 329 this._currentViews.push(modeView); | 323 this._currentViews.push(modeView); |
| 330 }, | 324 }, |
| 331 | 325 |
| 332 _removeAllModeViews: function() | 326 _removeAllModeViews: function() |
| 333 { | 327 { |
| 334 for (var i = 0; i < this._currentViews.length; ++i) { | 328 for (var i = 0; i < this._currentViews.length; ++i) { |
| 335 this._currentViews[i].removeEventListener(WebInspector.SplitView.Eve
nts.SidebarSizeChanged, this._sidebarResized, this); | 329 this._currentViews[i].removeEventListener(WebInspector.SplitView.Eve
nts.SidebarSizeChanged, this._sidebarResized, this); |
| 336 this._currentViews[i].dispose(); | 330 this._currentViews[i].dispose(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 349 { | 343 { |
| 350 if (!this._recordingOptionUIControls) | 344 if (!this._recordingOptionUIControls) |
| 351 this._recordingOptionUIControls = []; | 345 this._recordingOptionUIControls = []; |
| 352 | 346 |
| 353 var checkboxElement = document.createElement("input"); | 347 var checkboxElement = document.createElement("input"); |
| 354 var labelElement = WebInspector.SettingsUI.createSettingCheckbox(name, s
etting, true, checkboxElement, tooltip); | 348 var labelElement = WebInspector.SettingsUI.createSettingCheckbox(name, s
etting, true, checkboxElement, tooltip); |
| 355 this._recordingOptionUIControls.push({ "label": labelElement, "checkbox"
: checkboxElement }); | 349 this._recordingOptionUIControls.push({ "label": labelElement, "checkbox"
: checkboxElement }); |
| 356 return labelElement; | 350 return labelElement; |
| 357 }, | 351 }, |
| 358 | 352 |
| 359 _createRecordingOptions: function() | |
| 360 { | |
| 361 var topPaneSidebarElement = this._topPane.sidebarElement(); | |
| 362 this._captureStacksSetting = WebInspector.settings.createSetting("timeli
neCaptureStacks", true); | |
| 363 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Capture stacks"), | |
| 364 this._capt
ureStacksSetting, | |
| 365 WebInspect
or.UIString("Capture JavaScript stack on every timeline event"))); | |
| 366 | |
| 367 this._captureMemorySetting = WebInspector.settings.createSetting("timeli
neCaptureMemory", false); | |
| 368 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Capture memory"), | |
| 369 this._capt
ureMemorySetting, | |
| 370 WebInspect
or.UIString("Capture memory information on every timeline event"))); | |
| 371 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); | |
| 372 | |
| 373 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled())
{ | |
| 374 this._capturePowerSetting = WebInspector.settings.createSetting("tim
elineCapturePower", false); | |
| 375 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Capture power"), | |
| 376 this._
capturePowerSetting, | |
| 377 WebIns
pector.UIString("Capture power information"))); | |
| 378 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi
s); | |
| 379 } | |
| 380 | |
| 381 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ | |
| 382 this._captureLayersAndPicturesSetting = WebInspector.settings.create
Setting("timelineCaptureLayersAndPictures", false); | |
| 383 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Capture pictures"), | |
| 384 this._
captureLayersAndPicturesSetting, | |
| 385 WebIns
pector.UIString("Capture graphics layer positions and painted pictures"))); | |
| 386 } | |
| 387 }, | |
| 388 | |
| 389 _createStatusBarItems: function() | 353 _createStatusBarItems: function() |
| 390 { | 354 { |
| 391 var panelStatusBarElement = this.element.createChild("div", "panel-statu
s-bar"); | 355 var panelStatusBarElement = this.element.createChild("div", "panel-statu
s-bar"); |
| 392 this._statusBarButtons = /** @type {!Array.<!WebInspector.StatusBarItem>
} */ ([]); | 356 this._statusBarButtons = /** @type {!Array.<!WebInspector.StatusBarItem>
} */ ([]); |
| 393 | 357 |
| 394 this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record
-profile-status-bar-item"); | 358 this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record
-profile-status-bar-item"); |
| 395 this.toggleTimelineButton.addEventListener("click", this._toggleTimeline
ButtonClicked, this); | 359 this.toggleTimelineButton.addEventListener("click", this._toggleTimeline
ButtonClicked, this); |
| 396 this._statusBarButtons.push(this.toggleTimelineButton); | 360 this._statusBarButtons.push(this.toggleTimelineButton); |
| 397 panelStatusBarElement.appendChild(this.toggleTimelineButton.element); | 361 panelStatusBarElement.appendChild(this.toggleTimelineButton.element); |
| 398 this._updateToggleTimelineButton(false); | 362 this._updateToggleTimelineButton(false); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 417 panelStatusBarElement.appendChild(framesToggleButton.element); | 381 panelStatusBarElement.appendChild(framesToggleButton.element); |
| 418 | 382 |
| 419 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ | 383 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ |
| 420 var flameChartToggleButton = new WebInspector.StatusBarButton(WebIns
pector.UIString("Tracing mode"), "timeline-flame-chart-status-bar-item"); | 384 var flameChartToggleButton = new WebInspector.StatusBarButton(WebIns
pector.UIString("Tracing mode"), "timeline-flame-chart-status-bar-item"); |
| 421 flameChartToggleButton.toggled = this._flameChartEnabledSetting.get(
); | 385 flameChartToggleButton.toggled = this._flameChartEnabledSetting.get(
); |
| 422 flameChartToggleButton.addEventListener("click", this._flameChartEna
bledChanged.bind(this, flameChartToggleButton)); | 386 flameChartToggleButton.addEventListener("click", this._flameChartEna
bledChanged.bind(this, flameChartToggleButton)); |
| 423 this._statusBarButtons.push(flameChartToggleButton); | 387 this._statusBarButtons.push(flameChartToggleButton); |
| 424 panelStatusBarElement.appendChild(flameChartToggleButton.element); | 388 panelStatusBarElement.appendChild(flameChartToggleButton.element); |
| 425 } | 389 } |
| 426 | 390 |
| 391 this._captureStacksSetting = WebInspector.settings.createSetting("timeli
neCaptureStacks", true); |
| 392 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Stacks"), |
| 393 this._capt
ureStacksSetting, |
| 394 WebInspect
or.UIString("Capture JavaScript stack on every timeline event"))); |
| 395 this._captureMemorySetting = WebInspector.settings.createSetting("timeli
neCaptureMemory", false); |
| 396 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Memory"), |
| 397 this._capt
ureMemorySetting, |
| 398 WebInspect
or.UIString("Capture memory information on every timeline event"))); |
| 399 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); |
| 400 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled())
{ |
| 401 this._capturePowerSetting = WebInspector.settings.createSetting("tim
elineCapturePower", false); |
| 402 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Power"), |
| 403 this._
capturePowerSetting, |
| 404 WebIns
pector.UIString("Capture power information"))); |
| 405 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi
s); |
| 406 } |
| 407 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ |
| 408 this._captureLayersAndPicturesSetting = WebInspector.settings.create
Setting("timelineCaptureLayersAndPictures", false); |
| 409 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Paint"), |
| 410 this._
captureLayersAndPicturesSetting, |
| 411 WebIns
pector.UIString("Capture graphics layer positions and painted pictures"))); |
| 412 } |
| 413 |
| 427 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta
tus-bar-item"); | 414 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta
tus-bar-item"); |
| 428 | 415 |
| 429 this._filtersContainer = this.element.createChild("div", "timeline-filte
rs-header hidden"); | 416 this._filtersContainer = this.element.createChild("div", "timeline-filte
rs-header hidden"); |
| 430 this._filtersContainer.appendChild(this._filterBar.filtersElement()); | 417 this._filtersContainer.appendChild(this._filterBar.filtersElement()); |
| 431 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo
ggled, this._onFiltersToggled, this); | 418 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo
ggled, this._onFiltersToggled, this); |
| 432 this._filterBar.setName("timelinePanel"); | 419 this._filterBar.setName("timelinePanel"); |
| 433 }, | 420 }, |
| 434 | 421 |
| 435 /** | 422 /** |
| 436 * @return {!WebInspector.FilterBar} | 423 * @return {!WebInspector.FilterBar} |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 * @param {!WebInspector.TimelineModel.Record} record | 1463 * @param {!WebInspector.TimelineModel.Record} record |
| 1477 * @return {boolean} | 1464 * @return {boolean} |
| 1478 */ | 1465 */ |
| 1479 accept: function(record) | 1466 accept: function(record) |
| 1480 { | 1467 { |
| 1481 return !this._regex || this._uiUtils.testContentMatching(record, this._r
egex); | 1468 return !this._regex || this._uiUtils.testContentMatching(record, this._r
egex); |
| 1482 }, | 1469 }, |
| 1483 | 1470 |
| 1484 __proto__: WebInspector.TimelineModel.Filter.prototype | 1471 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1485 } | 1472 } |
| OLD | NEW |