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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 this._detailsLinkifier = new WebInspector.Linkifier(); | 60 this._detailsLinkifier = new WebInspector.Linkifier(); |
61 this._windowStartTime = 0; | 61 this._windowStartTime = 0; |
62 this._windowEndTime = Infinity; | 62 this._windowEndTime = Infinity; |
63 | 63 |
64 // Create model. | 64 // Create model. |
65 this._model = new WebInspector.TimelineModel(); | 65 this._model = new WebInspector.TimelineModel(); |
66 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 66 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
67 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); | 67 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); |
68 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); | 68 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); |
| 69 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg
ress, this._onRecordingProgress, this); |
69 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); | 70 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); |
70 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded,
this._onRecordAdded, this); | 71 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded,
this._onRecordAdded, this); |
71 | 72 |
72 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); | 73 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); |
73 this._durationFilter = new WebInspector.TimelineIsLongFilter(); | 74 this._durationFilter = new WebInspector.TimelineIsLongFilter(); |
74 this._textFilter = new WebInspector.TimelineTextFilter(); | 75 this._textFilter = new WebInspector.TimelineTextFilter(); |
75 | 76 |
76 this._model.addFilter(new WebInspector.TimelineHiddenFilter()); | 77 this._model.addFilter(new WebInspector.TimelineHiddenFilter()); |
77 this._model.addFilter(this._categoryFilter); | 78 this._model.addFilter(this._categoryFilter); |
78 this._model.addFilter(this._durationFilter); | 79 this._model.addFilter(this._durationFilter); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 panelStatusBarElement.appendChild(this.clearButton.element); | 321 panelStatusBarElement.appendChild(this.clearButton.element); |
321 | 322 |
322 this._filterBar = this._createFilterBar(); | 323 this._filterBar = this._createFilterBar(); |
323 panelStatusBarElement.appendChild(this._filterBar.filterButton().element
); | 324 panelStatusBarElement.appendChild(this._filterBar.filterButton().element
); |
324 | 325 |
325 this.garbageCollectButton = new WebInspector.StatusBarButton(WebInspecto
r.UIString("Collect Garbage"), "garbage-collect-status-bar-item"); | 326 this.garbageCollectButton = new WebInspector.StatusBarButton(WebInspecto
r.UIString("Collect Garbage"), "garbage-collect-status-bar-item"); |
326 this.garbageCollectButton.addEventListener("click", this._garbageCollect
ButtonClicked, this); | 327 this.garbageCollectButton.addEventListener("click", this._garbageCollect
ButtonClicked, this); |
327 this._statusBarButtons.push(this.garbageCollectButton); | 328 this._statusBarButtons.push(this.garbageCollectButton); |
328 panelStatusBarElement.appendChild(this.garbageCollectButton.element); | 329 panelStatusBarElement.appendChild(this.garbageCollectButton.element); |
329 | 330 |
330 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) { | |
331 panelStatusBarElement.appendChild(WebInspector.SettingsUI.createSett
ingCheckbox(WebInspector.UIString("Live update"), | |
332 WebInspector.settings.timelineLive
Update, true, undefined, | |
333 WebInspector.UIString("Show timeli
ne records while recording"))); | |
334 } | |
335 | |
336 panelStatusBarElement.appendChild(WebInspector.SettingsUI.createSettingC
heckbox(WebInspector.UIString("Capture stacks"), | 331 panelStatusBarElement.appendChild(WebInspector.SettingsUI.createSettingC
heckbox(WebInspector.UIString("Capture stacks"), |
337 WebInspector.settings.timelineCaptureS
tacks, true, undefined, | 332 WebInspector.settings.timelineCaptureS
tacks, true, undefined, |
338 WebInspector.UIString("Capture JavaScr
ipt stack on every timeline event"))); | 333 WebInspector.UIString("Capture JavaScr
ipt stack on every timeline event"))); |
339 | 334 |
340 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta
tus-bar-item"); | 335 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta
tus-bar-item"); |
341 | 336 |
342 this._filtersContainer = this.element.createChild("div", "timeline-filte
rs-header hidden"); | 337 this._filtersContainer = this.element.createChild("div", "timeline-filte
rs-header hidden"); |
343 this._filtersContainer.appendChild(this._filterBar.filtersElement()); | 338 this._filtersContainer.appendChild(this._filterBar.filtersElement()); |
344 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo
ggled, this._onFiltersToggled, this); | 339 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo
ggled, this._onFiltersToggled, this); |
345 }, | 340 }, |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 for (var i = 0; i < this._currentViews.length; ++i) | 605 for (var i = 0; i < this._currentViews.length; ++i) |
611 this._currentViews[i].reset(); | 606 this._currentViews[i].reset(); |
612 this._overviewControl.reset(); | 607 this._overviewControl.reset(); |
613 this._updateSelectionDetails(); | 608 this._updateSelectionDetails(); |
614 }, | 609 }, |
615 | 610 |
616 _onRecordingStarted: function() | 611 _onRecordingStarted: function() |
617 { | 612 { |
618 this.toggleTimelineButton.title = WebInspector.UIString("Stop"); | 613 this.toggleTimelineButton.title = WebInspector.UIString("Stop"); |
619 this.toggleTimelineButton.toggled = true; | 614 this.toggleTimelineButton.toggled = true; |
| 615 this._showProgressPane(); |
620 }, | 616 }, |
621 | 617 |
622 _recordingInProgress: function() | 618 _recordingInProgress: function() |
623 { | 619 { |
624 return this.toggleTimelineButton.toggled; | 620 return this.toggleTimelineButton.toggled; |
625 }, | 621 }, |
626 | 622 |
| 623 _showProgressPane: function() |
| 624 { |
| 625 if (!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) |
| 626 return; |
| 627 this._hideProgressPane(); |
| 628 this._progressElement = this._detailsSplitView.mainElement().createChild
("div", "timeline-progress-pane"); |
| 629 this._progressElement.textContent = WebInspector.UIString("%d events col
lected", 0); |
| 630 }, |
| 631 |
| 632 _hideProgressPane: function() |
| 633 { |
| 634 if (!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) |
| 635 return; |
| 636 if (this._progressElement) |
| 637 this._progressElement.remove(); |
| 638 }, |
| 639 |
| 640 /** |
| 641 * @param {!WebInspector.Event} event |
| 642 */ |
| 643 _onRecordingProgress: function(event) |
| 644 { |
| 645 if (!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) |
| 646 return; |
| 647 this._progressElement.textContent = WebInspector.UIString("%d events col
lected", event.data); |
| 648 }, |
| 649 |
627 _onRecordingStopped: function() | 650 _onRecordingStopped: function() |
628 { | 651 { |
629 this.toggleTimelineButton.title = WebInspector.UIString("Record"); | 652 this.toggleTimelineButton.title = WebInspector.UIString("Record"); |
630 this.toggleTimelineButton.toggled = false; | 653 this.toggleTimelineButton.toggled = false; |
| 654 this._hideProgressPane(); |
631 }, | 655 }, |
632 | 656 |
633 _onRecordAdded: function(event) | 657 _onRecordAdded: function(event) |
634 { | 658 { |
635 this._addRecord(/** @type {!WebInspector.TimelineModel.Record} */(event.
data)); | 659 this._addRecord(/** @type {!WebInspector.TimelineModel.Record} */(event.
data)); |
636 }, | 660 }, |
637 | 661 |
638 /** | 662 /** |
639 * @param {!WebInspector.TimelineModel.Record} record | 663 * @param {!WebInspector.TimelineModel.Record} record |
640 */ | 664 */ |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 * @param {!WebInspector.TimelineModel.Record} record | 1146 * @param {!WebInspector.TimelineModel.Record} record |
1123 * @return {boolean} | 1147 * @return {boolean} |
1124 */ | 1148 */ |
1125 accept: function(record) | 1149 accept: function(record) |
1126 { | 1150 { |
1127 return !this._hiddenRecords[record.type]; | 1151 return !this._hiddenRecords[record.type]; |
1128 }, | 1152 }, |
1129 | 1153 |
1130 __proto__: WebInspector.TimelineModel.Filter.prototype | 1154 __proto__: WebInspector.TimelineModel.Filter.prototype |
1131 } | 1155 } |
OLD | NEW |