Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 710113002: DevTools: remove TimelineModel.Events.RecordAdded event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Buf ferUsage, this._onTracingBufferUsage, this); 51 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Buf ferUsage, this._onTracingBufferUsage, this);
52 52
53 this._tracingModel = new WebInspector.TracingModel(); 53 this._tracingModel = new WebInspector.TracingModel();
54 this._uiUtils = new WebInspector.TracingTimelineUIUtils(); 54 this._uiUtils = new WebInspector.TracingTimelineUIUtils();
55 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this._tra cingManager, this._tracingModel, this._uiUtils.hiddenRecordsFilter()); 55 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this._tra cingManager, this._tracingModel, this._uiUtils.hiddenRecordsFilter());
56 this._model = this._tracingTimelineModel; 56 this._model = this._tracingTimelineModel;
57 57
58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this); 58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this);
59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this); 59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this);
60 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this); 60 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this);
61 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this);
62 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this); 61 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this);
63 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
64 62
65 this._categoryFilter = new WebInspector.TimelineCategoryFilter(this._uiUtils ); 63 this._categoryFilter = new WebInspector.TimelineCategoryFilter(this._uiUtils );
66 this._durationFilter = new WebInspector.TimelineIsLongFilter(); 64 this._durationFilter = new WebInspector.TimelineIsLongFilter();
67 this._textFilter = new WebInspector.TimelineTextFilter(this._uiUtils); 65 this._textFilter = new WebInspector.TimelineTextFilter(this._uiUtils);
68 66
69 var hiddenEmptyRecordsFilter = this._uiUtils.hiddenEmptyRecordsFilter(); 67 var hiddenEmptyRecordsFilter = this._uiUtils.hiddenEmptyRecordsFilter();
70 if (hiddenEmptyRecordsFilter) 68 if (hiddenEmptyRecordsFilter)
71 this._model.addFilter(hiddenEmptyRecordsFilter); 69 this._model.addFilter(hiddenEmptyRecordsFilter);
72 this._model.addFilter(this._uiUtils.hiddenRecordsFilter()); 70 this._model.addFilter(this._uiUtils.hiddenRecordsFilter());
73 this._model.addFilter(this._categoryFilter); 71 this._model.addFilter(this._categoryFilter);
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 }, 751 },
754 752
755 _recordingInProgress: function() 753 _recordingInProgress: function()
756 { 754 {
757 return this.toggleTimelineButton.toggled; 755 return this.toggleTimelineButton.toggled;
758 }, 756 },
759 757
760 /** 758 /**
761 * @param {!WebInspector.Event} event 759 * @param {!WebInspector.Event} event
762 */ 760 */
763 _onRecordingProgress: function(event)
764 {
765 this._updateProgress(WebInspector.UIString("%d events collected", event. data));
766 },
767
768 /**
769 * @param {!WebInspector.Event} event
770 */
771 _onTracingBufferUsage: function(event) 761 _onTracingBufferUsage: function(event)
772 { 762 {
773 var usage = /** @type {number} */ (event.data); 763 var usage = /** @type {number} */ (event.data);
774 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun d(usage * 100))); 764 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun d(usage * 100)));
775 }, 765 },
776 766
777 /** 767 /**
778 * @param {string} progressMessage 768 * @param {string} progressMessage
779 */ 769 */
780 _updateProgress: function(progressMessage) 770 _updateProgress: function(progressMessage)
(...skipping 27 matching lines...) Expand all
808 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime(), this._tracingTimelineModel.maximumRecordTime()); 798 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime(), this._tracingTimelineModel.maximumRecordTime());
809 this._refreshViews(); 799 this._refreshViews();
810 this._hideProgressPane(); 800 this._hideProgressPane();
811 this._overviewPane.update(); 801 this._overviewPane.update();
812 this._updateSearchHighlight(false, true); 802 this._updateSearchHighlight(false, true);
813 }, 803 },
814 804
815 /** 805 /**
816 * @param {!WebInspector.Event} event 806 * @param {!WebInspector.Event} event
817 */ 807 */
818 _onRecordAdded: function(event)
819 {
820 var record = /** @type {!WebInspector.TimelineModel.Record} */ (event.da ta);
821 if (this._lazyFrameModel && !this._tracingModel)
822 this._lazyFrameModel.addRecord(record);
823 for (var i = 0; i < this._currentViews.length; ++i)
824 this._currentViews[i].addRecord(record);
825 },
826
827 /**
828 * @param {!WebInspector.Event} event
829 */
830 _willReloadPage: function(event) 808 _willReloadPage: function(event)
831 { 809 {
832 if (this._operationInProgress || this._userInitiatedRecording || !this.i sShowing()) 810 if (this._operationInProgress || this._userInitiatedRecording || !this.i sShowing())
833 return; 811 return;
834 this._startRecording(false); 812 this._startRecording(false);
835 }, 813 },
836 814
837 /** 815 /**
838 * @param {!WebInspector.Event} event 816 * @param {!WebInspector.Event} event
839 */ 817 */
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 dispose: function() {}, 1296 dispose: function() {},
1319 1297
1320 reset: function() {}, 1298 reset: function() {},
1321 1299
1322 /** 1300 /**
1323 * @param {?RegExp} textFilter 1301 * @param {?RegExp} textFilter
1324 */ 1302 */
1325 refreshRecords: function(textFilter) {}, 1303 refreshRecords: function(textFilter) {},
1326 1304
1327 /** 1305 /**
1328 * @param {!WebInspector.TimelineModel.Record} record
1329 */
1330 addRecord: function(record) {},
1331
1332 /**
1333 * @param {?WebInspector.TimelineModel.Record} record 1306 * @param {?WebInspector.TimelineModel.Record} record
1334 * @param {string=} regex 1307 * @param {string=} regex
1335 * @param {boolean=} selectRecord 1308 * @param {boolean=} selectRecord
1336 */ 1309 */
1337 highlightSearchResult: function(record, regex, selectRecord) {}, 1310 highlightSearchResult: function(record, regex, selectRecord) {},
1338 1311
1339 /** 1312 /**
1340 * @param {number} startTime 1313 * @param {number} startTime
1341 * @param {number} endTime 1314 * @param {number} endTime
1342 */ 1315 */
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1478
1506 WebInspector.TimelinePanelFactory.prototype = { 1479 WebInspector.TimelinePanelFactory.prototype = {
1507 /** 1480 /**
1508 * @return {!WebInspector.Panel} 1481 * @return {!WebInspector.Panel}
1509 */ 1482 */
1510 createPanel: function() 1483 createPanel: function()
1511 { 1484 {
1512 return WebInspector.TimelinePanel._instance(); 1485 return WebInspector.TimelinePanel._instance();
1513 } 1486 }
1514 } 1487 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModel.js ('k') | Source/devtools/front_end/timeline/TimelinePowerGraph.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698