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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2887923002: DevTools: fix network grid scroll to bottom, render group node frame icon. (Closed)
Patch Set: dropped the datagrid check Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 29 matching lines...) Expand all
40 */ 40 */
41 constructor(filterBar, progressBarContainer, networkLogLargeRowsSetting) { 41 constructor(filterBar, progressBarContainer, networkLogLargeRowsSetting) {
42 super(); 42 super();
43 this.setMinimumSize(50, 64); 43 this.setMinimumSize(50, 64);
44 this.registerRequiredCSS('network/networkLogView.css'); 44 this.registerRequiredCSS('network/networkLogView.css');
45 45
46 this._networkHideDataURLSetting = Common.settings.createSetting('networkHide DataURL', false); 46 this._networkHideDataURLSetting = Common.settings.createSetting('networkHide DataURL', false);
47 this._networkResourceTypeFiltersSetting = Common.settings.createSetting('net workResourceTypeFilters', {}); 47 this._networkResourceTypeFiltersSetting = Common.settings.createSetting('net workResourceTypeFilters', {});
48 48
49 this._filterBar = filterBar; 49 this._filterBar = filterBar;
50 this._rawRowHeight = 0;
50 this._progressBarContainer = progressBarContainer; 51 this._progressBarContainer = progressBarContainer;
51 this._networkLogLargeRowsSetting = networkLogLargeRowsSetting; 52 this._networkLogLargeRowsSetting = networkLogLargeRowsSetting;
52 this._networkLogLargeRowsSetting.addChangeListener(updateRowHeight.bind(this ), this); 53 this._networkLogLargeRowsSetting.addChangeListener(updateRowHeight.bind(this ), this);
53 54
54 /** @type {!Network.NetworkTransferTimeCalculator} */ 55 /** @type {!Network.NetworkTransferTimeCalculator} */
55 this._timeCalculator = new Network.NetworkTransferTimeCalculator(); 56 this._timeCalculator = new Network.NetworkTransferTimeCalculator();
56 /** @type {!Network.NetworkTransferDurationCalculator} */ 57 /** @type {!Network.NetworkTransferDurationCalculator} */
57 this._durationCalculator = new Network.NetworkTransferDurationCalculator(); 58 this._durationCalculator = new Network.NetworkTransferDurationCalculator();
58 this._calculator = this._timeCalculator; 59 this._calculator = this._timeCalculator;
59 60
60 /** 61 /**
61 * @this {Network.NetworkLogView} 62 * @this {Network.NetworkLogView}
62 */ 63 */
63 function updateRowHeight() { 64 function updateRowHeight() {
64 /** @type {number} */ 65 /** @type {number} */
65 this._rowHeight = !!this._networkLogLargeRowsSetting.get() ? 41 : 21; 66 this._rawRowHeight = !!this._networkLogLargeRowsSetting.get() ? 41 : 21;
67 this._updateRowHeight();
66 } 68 }
67 updateRowHeight.call(this); 69 updateRowHeight.call(this);
68 70
69 this._columns = new Network.NetworkLogViewColumns( 71 this._columns = new Network.NetworkLogViewColumns(
70 this, this._timeCalculator, this._durationCalculator, networkLogLargeRow sSetting); 72 this, this._timeCalculator, this._durationCalculator, networkLogLargeRow sSetting);
71 73
72 /** @type {!Map.<string, !Network.NetworkRequestNode>} */ 74 /** @type {!Map.<string, !Network.NetworkRequestNode>} */
73 this._nodesByRequestId = new Map(); 75 this._nodesByRequestId = new Map();
74 /** @type {!Object.<string, boolean>} */ 76 /** @type {!Object.<string, boolean>} */
75 this._staleRequestIds = {}; 77 this._staleRequestIds = {};
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 * @param {?string} groupKey 364 * @param {?string} groupKey
363 */ 365 */
364 _setGrouping(groupKey) { 366 _setGrouping(groupKey) {
365 var groupLookup = groupKey ? this._groupLookups.get(groupKey) || null : null ; 367 var groupLookup = groupKey ? this._groupLookups.get(groupKey) || null : null ;
366 this._activeGroupLookup = groupLookup; 368 this._activeGroupLookup = groupLookup;
367 if (groupLookup) 369 if (groupLookup)
368 groupLookup.reset(); 370 groupLookup.reset();
369 this._invalidateAllItems(); 371 this._invalidateAllItems();
370 } 372 }
371 373
374 _updateRowHeight() {
375 this._rowHeight = Math.floor(this._rawRowHeight * window.devicePixelRatio) / window.devicePixelRatio;
376 }
377
372 /** 378 /**
373 * @param {!SDK.NetworkRequest} request 379 * @param {!SDK.NetworkRequest} request
374 * @return {?Network.NetworkRequestNode} 380 * @return {?Network.NetworkRequestNode}
375 */ 381 */
376 nodeForRequest(request) { 382 nodeForRequest(request) {
377 return this._nodesByRequestId.get(request.requestId()); 383 return this._nodesByRequestId.get(request.requestId());
378 } 384 }
379 385
380 /** 386 /**
381 * @return {number} 387 * @return {number}
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 } 797 }
792 798
793 /** 799 /**
794 * @override 800 * @override
795 */ 801 */
796 willHide() { 802 willHide() {
797 this._columns.willHide(); 803 this._columns.willHide();
798 } 804 }
799 805
800 /** 806 /**
807 * @override
808 */
809 onResize() {
810 this._updateRowHeight();
811 }
812
813 /**
801 * @return {!Array<!Network.NetworkNode>} 814 * @return {!Array<!Network.NetworkNode>}
802 */ 815 */
803 flatNodesList() { 816 flatNodesList() {
804 return this._dataGrid.rootNode().flatChildren(); 817 return this._dataGrid.rootNode().flatChildren();
805 } 818 }
806 819
807 stylesChanged() { 820 stylesChanged() {
808 this._columns.scheduleRefresh(); 821 this._columns.scheduleRefresh();
809 } 822 }
810 823
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 933
921 if (this._activeGroupLookup) 934 if (this._activeGroupLookup)
922 this._activeGroupLookup.reset(); 935 this._activeGroupLookup.reset();
923 this._nodesByRequestId.clear(); 936 this._nodesByRequestId.clear();
924 this._staleRequestIds = {}; 937 this._staleRequestIds = {};
925 this._resetSuggestionBuilder(); 938 this._resetSuggestionBuilder();
926 939
927 this._mainRequestLoadTime = -1; 940 this._mainRequestLoadTime = -1;
928 this._mainRequestDOMContentLoadedTime = -1; 941 this._mainRequestDOMContentLoadedTime = -1;
929 942
930 if (this._dataGrid) { 943 this._dataGrid.rootNode().removeChildren();
931 this._dataGrid.rootNode().removeChildren(); 944 this._updateSummaryBar();
932 this._updateSummaryBar(); 945 this._dataGrid.setStickToBottom(true);
933 }
934 } 946 }
935 947
936 /** 948 /**
937 * @param {string} filterString 949 * @param {string} filterString
938 */ 950 */
939 setTextFilterValue(filterString) { 951 setTextFilterValue(filterString) {
940 this._textFilterUI.setValue(filterString); 952 this._textFilterUI.setValue(filterString);
941 this._textFilterUI.setRegexChecked(false); 953 this._textFilterUI.setRegexChecked(false);
942 this._dataURLFilterUI.setChecked(false); 954 this._dataURLFilterUI.setChecked(false);
943 this._resourceCategoryFilterUI.reset(); 955 this._resourceCategoryFilterUI.reset();
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 1830
1819 Network.GroupLookupInterface.prototype = { 1831 Network.GroupLookupInterface.prototype = {
1820 /** 1832 /**
1821 * @param {!SDK.NetworkRequest} request 1833 * @param {!SDK.NetworkRequest} request
1822 * @return {?Network.NetworkGroupNode} 1834 * @return {?Network.NetworkGroupNode}
1823 */ 1835 */
1824 groupNodeForRequest: function(request) {}, 1836 groupNodeForRequest: function(request) {},
1825 1837
1826 reset: function() {} 1838 reset: function() {}
1827 }; 1839 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698