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

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

Issue 336183005: Remove title() from TimelineModel.Record (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this); 91 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this);
92 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this); 92 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this);
93 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this); 93 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this);
94 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this); 94 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this);
95 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this); 95 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
96 96
97 this._model.target().profilingLock.addEventListener(WebInspector.Lock.Events .StateChanged, this._onProfilingStateChanged, this); 97 this._model.target().profilingLock.addEventListener(WebInspector.Lock.Events .StateChanged, this._onProfilingStateChanged, this);
98 98
99 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); 99 this._categoryFilter = new WebInspector.TimelineCategoryFilter();
100 this._durationFilter = new WebInspector.TimelineIsLongFilter(); 100 this._durationFilter = new WebInspector.TimelineIsLongFilter();
101 this._textFilter = new WebInspector.TimelineTextFilter(); 101 this._textFilter = new WebInspector.TimelineTextFilter(this._uiUtils);
102 102
103 this._model.addFilter(new WebInspector.TimelineHiddenFilter()); 103 this._model.addFilter(new WebInspector.TimelineHiddenFilter());
104 this._model.addFilter(this._categoryFilter); 104 this._model.addFilter(this._categoryFilter);
105 this._model.addFilter(this._durationFilter); 105 this._model.addFilter(this._durationFilter);
106 this._model.addFilter(this._textFilter); 106 this._model.addFilter(this._textFilter);
107 107
108 /** @type {!Array.<!WebInspector.TimelineModeView>} */ 108 /** @type {!Array.<!WebInspector.TimelineModeView>} */
109 this._currentViews = []; 109 this._currentViews = [];
110 110
111 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve rviewMode", WebInspector.TimelinePanel.OverviewMode.Events); 111 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve rviewMode", WebInspector.TimelinePanel.OverviewMode.Events);
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 930
931 /** 931 /**
932 * @param {!WebInspector.TimelineModel.Record} record 932 * @param {!WebInspector.TimelineModel.Record} record
933 * @this {WebInspector.TimelinePanel} 933 * @this {WebInspector.TimelinePanel}
934 */ 934 */
935 function processRecord(record) 935 function processRecord(record)
936 { 936 {
937 if (record.endTime() < this._windowStartTime || 937 if (record.endTime() < this._windowStartTime ||
938 record.startTime() > this._windowEndTime) 938 record.startTime() > this._windowEndTime)
939 return; 939 return;
940 if (record.testContentMatching(searchRegExp)) 940 if (this._uiUtils.testContentMatching(record, searchRegExp))
941 matches.push(record); 941 matches.push(record);
942 } 942 }
943 this._model.forAllFilteredRecords(processRecord.bind(this)); 943 this._model.forAllFilteredRecords(processRecord.bind(this));
944 944
945 var matchesCount = matches.length; 945 var matchesCount = matches.length;
946 if (matchesCount) { 946 if (matchesCount) {
947 this._searchResults = matches; 947 this._searchResults = matches;
948 this._searchableView.updateSearchMatchesCount(matchesCount); 948 this._searchableView.updateSearchMatchesCount(matchesCount);
949 949
950 var selectedIndex = matches.indexOf(this._selectedSearchResult); 950 var selectedIndex = matches.indexOf(this._selectedSearchResult);
(...skipping 28 matching lines...) Expand all
979 979
980 _updateSelectionDetails: function() 980 _updateSelectionDetails: function()
981 { 981 {
982 if (!this._selection) { 982 if (!this._selection) {
983 this._updateSelectedRangeStats(); 983 this._updateSelectedRangeStats();
984 return; 984 return;
985 } 985 }
986 switch (this._selection.type()) { 986 switch (this._selection.type()) {
987 case WebInspector.TimelineSelection.Type.Record: 987 case WebInspector.TimelineSelection.Type.Record:
988 var record = /** @type {!WebInspector.TimelineModel.Record} */ (this ._selection.object()); 988 var record = /** @type {!WebInspector.TimelineModel.Record} */ (this ._selection.object());
989 this._uiUtils.generateDetailsContent(record, this._model, this._deta ilsLinkifier, this.showInDetails.bind(this, record.title()), this._model.loadedF romFile()); 989 var title = this._uiUtils.titleForRecord(record);
990 this._uiUtils.generateDetailsContent(record, this._model, this._deta ilsLinkifier, this.showInDetails.bind(this, title), this._model.loadedFromFile() );
990 break; 991 break;
991 case WebInspector.TimelineSelection.Type.TraceEvent: 992 case WebInspector.TimelineSelection.Type.TraceEvent:
992 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._s election.object()); 993 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._s election.object());
993 var title = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(e vent.name).title; 994 var title = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(e vent.name).title;
994 WebInspector.TracingTimelineUIUtils.buildTraceEventDetails(event, th is._tracingTimelineModel, this._detailsLinkifier, this.showInDetails.bind(this, title), false, this._model.target()); 995 WebInspector.TracingTimelineUIUtils.buildTraceEventDetails(event, th is._tracingTimelineModel, this._detailsLinkifier, this.showInDetails.bind(this, title), false, this._model.target());
995 break; 996 break;
996 case WebInspector.TimelineSelection.Type.Frame: 997 case WebInspector.TimelineSelection.Type.Frame:
997 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._select ion.object()); 998 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._select ion.object());
998 this.showInDetails(WebInspector.UIString("Frame Statistics"), WebIns pector.TimelineUIUtils.generateDetailsContentForFrame(this._lazyFrameModel, fram e)); 999 this.showInDetails(WebInspector.UIString("Frame Statistics"), WebIns pector.TimelineUIUtils.generateDetailsContentForFrame(this._lazyFrameModel, fram e));
999 if (frame.layerTree) { 1000 if (frame.layerTree) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 return this._minimumRecordDuration ? ((record.endTime() - record.startTi me()) >= this._minimumRecordDuration) : true; 1373 return this._minimumRecordDuration ? ((record.endTime() - record.startTi me()) >= this._minimumRecordDuration) : true;
1373 }, 1374 },
1374 1375
1375 __proto__: WebInspector.TimelineModel.Filter.prototype 1376 __proto__: WebInspector.TimelineModel.Filter.prototype
1376 1377
1377 } 1378 }
1378 1379
1379 /** 1380 /**
1380 * @constructor 1381 * @constructor
1381 * @extends {WebInspector.TimelineModel.Filter} 1382 * @extends {WebInspector.TimelineModel.Filter}
1383 * @param {!WebInspector.TimelineUIUtils} uiUtils
1382 */ 1384 */
1383 WebInspector.TimelineTextFilter = function() 1385 WebInspector.TimelineTextFilter = function(uiUtils)
1384 { 1386 {
1385 WebInspector.TimelineModel.Filter.call(this); 1387 WebInspector.TimelineModel.Filter.call(this);
1388 this._uiUtils = uiUtils;
1386 } 1389 }
1387 1390
1388 WebInspector.TimelineTextFilter.prototype = { 1391 WebInspector.TimelineTextFilter.prototype = {
1389 /** 1392 /**
1390 * @return {boolean} 1393 * @return {boolean}
1391 */ 1394 */
1392 isEmpty: function() 1395 isEmpty: function()
1393 { 1396 {
1394 return !this._regex; 1397 return !this._regex;
1395 }, 1398 },
1396 1399
1397 /** 1400 /**
1398 * @param {?RegExp} regex 1401 * @param {?RegExp} regex
1399 */ 1402 */
1400 setRegex: function(regex) 1403 setRegex: function(regex)
1401 { 1404 {
1402 this._regex = regex; 1405 this._regex = regex;
1403 this.notifyFilterChanged(); 1406 this.notifyFilterChanged();
1404 }, 1407 },
1405 1408
1406 /** 1409 /**
1407 * @param {!WebInspector.TimelineModel.Record} record 1410 * @param {!WebInspector.TimelineModel.Record} record
1408 * @return {boolean} 1411 * @return {boolean}
1409 */ 1412 */
1410 accept: function(record) 1413 accept: function(record)
1411 { 1414 {
1412 return !this._regex || record.testContentMatching(this._regex); 1415 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex);
1413 }, 1416 },
1414 1417
1415 __proto__: WebInspector.TimelineModel.Filter.prototype 1418 __proto__: WebInspector.TimelineModel.Filter.prototype
1416 } 1419 }
1417 1420
1418 /** 1421 /**
1419 * @constructor 1422 * @constructor
1420 * @extends {WebInspector.TimelineModel.Filter} 1423 * @extends {WebInspector.TimelineModel.Filter}
1421 */ 1424 */
1422 WebInspector.TimelineHiddenFilter = function() 1425 WebInspector.TimelineHiddenFilter = function()
(...skipping 18 matching lines...) Expand all
1441 * @param {!WebInspector.TimelineModel.Record} record 1444 * @param {!WebInspector.TimelineModel.Record} record
1442 * @return {boolean} 1445 * @return {boolean}
1443 */ 1446 */
1444 accept: function(record) 1447 accept: function(record)
1445 { 1448 {
1446 return !this._hiddenRecords[record.type()]; 1449 return !this._hiddenRecords[record.type()];
1447 }, 1450 },
1448 1451
1449 __proto__: WebInspector.TimelineModel.Filter.prototype 1452 __proto__: WebInspector.TimelineModel.Filter.prototype
1450 } 1453 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModelImpl.js ('k') | Source/devtools/front_end/timeline/TimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698