OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ | 69 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ |
70 this._filters = []; | 70 this._filters = []; |
71 | 71 |
72 this._currentMatchedRequestNode = null; | 72 this._currentMatchedRequestNode = null; |
73 this._currentMatchedRequestIndex = -1; | 73 this._currentMatchedRequestIndex = -1; |
74 | 74 |
75 this._createStatusbarButtons(); | 75 this._createStatusbarButtons(); |
76 this._createStatusBarItems(); | 76 this._createStatusBarItems(); |
77 this._linkifier = new WebInspector.Linkifier(); | 77 this._linkifier = new WebInspector.Linkifier(); |
78 | 78 |
| 79 this._allowPopover = true; |
| 80 |
79 this._addFilters(); | 81 this._addFilters(); |
80 this._resetSuggestionBuilder(); | 82 this._resetSuggestionBuilder(); |
81 this._initializeView(); | 83 this._initializeView(); |
82 this._recordButton.toggled = true; | 84 this._recordButton.toggled = true; |
83 | 85 |
84 WebInspector.targetManager.observeTargets(this); | 86 WebInspector.targetManager.observeTargets(this); |
85 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this
); | 87 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this
); |
86 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this
); | 88 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this
); |
87 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi
s); | 89 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi
s); |
88 | 90 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 185 |
184 _initializeView: function() | 186 _initializeView: function() |
185 { | 187 { |
186 this.element.id = "network-container"; | 188 this.element.id = "network-container"; |
187 | 189 |
188 this._createSortingFunctions(); | 190 this._createSortingFunctions(); |
189 this._createTable(); | 191 this._createTable(); |
190 this._createTimelineGrid(); | 192 this._createTimelineGrid(); |
191 this._summaryBarElement = this.element.createChild("div", "network-summa
ry-bar"); | 193 this._summaryBarElement = this.element.createChild("div", "network-summa
ry-bar"); |
192 | 194 |
193 if (!this.useLargeRows) | 195 if (!this.usesLargeRows()) |
194 this._setLargerRequests(this.useLargeRows); | 196 this._setLargerRequests(false); |
195 | 197 |
196 this._allowPopover = true; | |
197 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this.
_getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.
bind(this)); | 198 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this.
_getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.
bind(this)); |
198 // Enable faster hint. | 199 // Enable faster hint. |
199 this._popoverHelper.setTimeout(100); | 200 this._popoverHelper.setTimeout(100); |
200 | 201 |
201 this.calculator = new WebInspector.NetworkTransferTimeCalculator(); | 202 this._setCalculator(new WebInspector.NetworkTransferTimeCalculator()); |
202 | 203 |
203 this.switchToDetailedView(); | 204 this.switchToDetailedView(); |
204 }, | 205 }, |
205 | 206 |
206 get statusBarItems() | 207 /** |
| 208 * @return {!Array.<!Element>} |
| 209 */ |
| 210 statusBarItems: function() |
207 { | 211 { |
208 return [ | 212 return [ |
209 this._recordButton.element, | 213 this._recordButton.element, |
210 this._clearButton.element, | 214 this._clearButton.element, |
211 this._filterBar.filterButton().element, | 215 this._filterBar.filterButton().element, |
212 this._largerRequestsButton.element, | 216 this._largerRequestsButton.element, |
213 this._preserveLogCheckbox.element, | 217 this._preserveLogCheckbox.element, |
214 this._disableCacheCheckbox.element, | 218 this._disableCacheCheckbox.element, |
215 this._progressBarContainer]; | 219 this._progressBarContainer]; |
216 }, | 220 }, |
217 | 221 |
218 get useLargeRows() | 222 /** |
| 223 * @return {boolean} |
| 224 */ |
| 225 usesLargeRows: function() |
219 { | 226 { |
220 return WebInspector.settings.resourcesLargeRows.get(); | 227 return !!WebInspector.settings.resourcesLargeRows.get(); |
221 }, | 228 }, |
222 | 229 |
223 set allowPopover(flag) | 230 /** |
| 231 * @param {boolean} flag |
| 232 */ |
| 233 setAllowPopover: function(flag) |
224 { | 234 { |
225 this._allowPopover = flag; | 235 this._allowPopover = flag; |
226 }, | 236 }, |
227 | 237 |
228 /** | 238 /** |
229 * @return {!Array.<!Element>} | 239 * @return {!Array.<!Element>} |
230 */ | 240 */ |
231 elementsToRestoreScrollPositionsFor: function() | 241 elementsToRestoreScrollPositionsFor: function() |
232 { | 242 { |
233 if (!this._dataGrid) // Not initialized yet. | 243 if (!this._dataGrid) // Not initialized yet. |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 this._removeAllNodeHighlights(); | 505 this._removeAllNodeHighlights(); |
496 var selectedIndex = this._timelineSortSelector.selectedIndex; | 506 var selectedIndex = this._timelineSortSelector.selectedIndex; |
497 if (!selectedIndex) | 507 if (!selectedIndex) |
498 selectedIndex = 1; // Sort by start time by default. | 508 selectedIndex = 1; // Sort by start time by default. |
499 var selectedOption = this._timelineSortSelector[selectedIndex]; | 509 var selectedOption = this._timelineSortSelector[selectedIndex]; |
500 var value = selectedOption.value; | 510 var value = selectedOption.value; |
501 | 511 |
502 var sortingFunction = this._sortingFunctions[value]; | 512 var sortingFunction = this._sortingFunctions[value]; |
503 this._dataGrid.sortNodes(sortingFunction); | 513 this._dataGrid.sortNodes(sortingFunction); |
504 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM
atchIndex(this._currentMatchedRequestNode), false); | 514 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM
atchIndex(this._currentMatchedRequestNode), false); |
505 this.calculator = this._calculators[value]; | 515 var calculator = this._calculators[value]; |
506 if (this.calculator.startAtZero) | 516 this._setCalculator(calculator); |
| 517 if (calculator.startAtZero) |
507 this._timelineGrid.hideEventDividers(); | 518 this._timelineGrid.hideEventDividers(); |
508 else | 519 else |
509 this._timelineGrid.showEventDividers(); | 520 this._timelineGrid.showEventDividers(); |
510 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or
der.Ascending); | 521 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or
der.Ascending); |
511 }, | 522 }, |
512 | 523 |
513 _createStatusBarItems: function() | 524 _createStatusBarItems: function() |
514 { | 525 { |
515 this._progressBarContainer = document.createElement("div"); | 526 this._progressBarContainer = document.createElement("div"); |
516 this._progressBarContainer.className = "status-bar-item"; | 527 this._progressBarContainer.className = "status-bar-item"; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 594 |
584 _updateDividersIfNeeded: function() | 595 _updateDividersIfNeeded: function() |
585 { | 596 { |
586 if (!this._dataGrid) | 597 if (!this._dataGrid) |
587 return; | 598 return; |
588 var timelineOffset = this._dataGrid.columnOffset("timeline"); | 599 var timelineOffset = this._dataGrid.columnOffset("timeline"); |
589 // Position timline grid location. | 600 // Position timline grid location. |
590 if (timelineOffset) | 601 if (timelineOffset) |
591 this._timelineGrid.element.style.left = timelineOffset + "px"; | 602 this._timelineGrid.element.style.left = timelineOffset + "px"; |
592 | 603 |
| 604 var calculator = this.calculator(); |
593 var proceed = true; | 605 var proceed = true; |
594 if (!this.isShowing()) { | 606 if (!this.isShowing()) { |
595 this._scheduleRefresh(); | 607 this._scheduleRefresh(); |
596 proceed = false; | 608 proceed = false; |
597 } else { | 609 } else { |
598 this.calculator.setDisplayWindow(this._timelineGrid.dividersElement.
clientWidth); | 610 calculator.setDisplayWindow(this._timelineGrid.dividersElement.clien
tWidth); |
599 proceed = this._timelineGrid.updateDividers(this.calculator); | 611 proceed = this._timelineGrid.updateDividers(calculator); |
600 } | 612 } |
601 if (!proceed) | 613 if (!proceed) |
602 return; | 614 return; |
603 | 615 |
604 if (this.calculator.startAtZero || !this.calculator.computePercentageFro
mEventTime) { | 616 if (calculator.startAtZero || !calculator.computePercentageFromEventTime
) { |
605 // If our current sorting method starts at zero, that means it shows
all | 617 // If our current sorting method starts at zero, that means it shows
all |
606 // requests starting at the same point, and so onLoad event and DOMC
ontent | 618 // requests starting at the same point, and so onLoad event and DOMC
ontent |
607 // event lines really wouldn't make much sense here, so don't render
them. | 619 // event lines really wouldn't make much sense here, so don't render
them. |
608 // Additionally, if the calculator doesn't have the computePercentag
eFromEventTime | 620 // Additionally, if the calculator doesn't have the computePercentag
eFromEventTime |
609 // function defined, we are probably sorting by size, and event time
s aren't relevant | 621 // function defined, we are probably sorting by size, and event time
s aren't relevant |
610 // in this case. | 622 // in this case. |
611 return; | 623 return; |
612 } | 624 } |
613 | 625 |
614 this._timelineGrid.removeEventDividers(); | 626 this._timelineGrid.removeEventDividers(); |
615 if (this._mainRequestLoadTime !== -1) { | 627 if (this._mainRequestLoadTime !== -1) { |
616 var percent = this.calculator.computePercentageFromEventTime(this._m
ainRequestLoadTime); | 628 var percent = calculator.computePercentageFromEventTime(this._mainRe
questLoadTime); |
617 | 629 |
618 var loadDivider = document.createElement("div"); | 630 var loadDivider = document.createElement("div"); |
619 loadDivider.className = "network-event-divider network-red-divider"; | 631 loadDivider.className = "network-event-divider network-red-divider"; |
620 | 632 |
621 var loadDividerPadding = document.createElement("div"); | 633 var loadDividerPadding = document.createElement("div"); |
622 loadDividerPadding.className = "network-event-divider-padding"; | 634 loadDividerPadding.className = "network-event-divider-padding"; |
623 loadDividerPadding.title = WebInspector.UIString("Load event"); | 635 loadDividerPadding.title = WebInspector.UIString("Load event"); |
624 loadDividerPadding.appendChild(loadDivider); | 636 loadDividerPadding.appendChild(loadDivider); |
625 loadDividerPadding.style.left = percent + "%"; | 637 loadDividerPadding.style.left = percent + "%"; |
626 this._timelineGrid.addEventDivider(loadDividerPadding); | 638 this._timelineGrid.addEventDivider(loadDividerPadding); |
627 } | 639 } |
628 | 640 |
629 if (this._mainRequestDOMContentLoadedTime !== -1) { | 641 if (this._mainRequestDOMContentLoadedTime !== -1) { |
630 var percent = this.calculator.computePercentageFromEventTime(this._m
ainRequestDOMContentLoadedTime); | 642 var percent = calculator.computePercentageFromEventTime(this._mainRe
questDOMContentLoadedTime); |
631 | 643 |
632 var domContentLoadedDivider = document.createElement("div"); | 644 var domContentLoadedDivider = document.createElement("div"); |
633 domContentLoadedDivider.className = "network-event-divider network-b
lue-divider"; | 645 domContentLoadedDivider.className = "network-event-divider network-b
lue-divider"; |
634 | 646 |
635 var domContentLoadedDividerPadding = document.createElement("div"); | 647 var domContentLoadedDividerPadding = document.createElement("div"); |
636 domContentLoadedDividerPadding.className = "network-event-divider-pa
dding"; | 648 domContentLoadedDividerPadding.className = "network-event-divider-pa
dding"; |
637 domContentLoadedDividerPadding.title = WebInspector.UIString("DOMCon
tentLoaded event"); | 649 domContentLoadedDividerPadding.title = WebInspector.UIString("DOMCon
tentLoaded event"); |
638 domContentLoadedDividerPadding.appendChild(domContentLoadedDivider); | 650 domContentLoadedDividerPadding.appendChild(domContentLoadedDivider); |
639 domContentLoadedDividerPadding.style.left = percent + "%"; | 651 domContentLoadedDividerPadding.style.left = percent + "%"; |
640 this._timelineGrid.addEventDivider(domContentLoadedDividerPadding); | 652 this._timelineGrid.addEventDivider(domContentLoadedDividerPadding); |
641 } | 653 } |
642 }, | 654 }, |
643 | 655 |
644 _refreshIfNeeded: function() | 656 _refreshIfNeeded: function() |
645 { | 657 { |
646 if (this._needsRefresh) | 658 if (this._needsRefresh) |
647 this.refresh(); | 659 this.refresh(); |
648 }, | 660 }, |
649 | 661 |
650 _invalidateAllItems: function() | 662 _invalidateAllItems: function() |
651 { | 663 { |
652 var requestIds = this._nodesByRequestId.keys(); | 664 var requestIds = this._nodesByRequestId.keys(); |
653 for (var i = 0; i < requestIds.length; ++i) | 665 for (var i = 0; i < requestIds.length; ++i) |
654 this._staleRequestIds[requestIds[i]] = true; | 666 this._staleRequestIds[requestIds[i]] = true; |
655 }, | 667 }, |
656 | 668 |
657 get calculator() | 669 /** |
| 670 * @return {!WebInspector.NetworkBaseCalculator} |
| 671 */ |
| 672 calculator: function() |
658 { | 673 { |
659 return this._calculator; | 674 return this._calculator; |
660 }, | 675 }, |
661 | 676 |
662 set calculator(x) | 677 /** |
| 678 * @param {!WebInspector.NetworkBaseCalculator} x |
| 679 */ |
| 680 _setCalculator: function(x) |
663 { | 681 { |
664 if (!x || this._calculator === x) | 682 if (!x || this._calculator === x) |
665 return; | 683 return; |
666 | 684 |
667 this._calculator = x; | 685 this._calculator = x; |
668 this._calculator.reset(); | 686 this._calculator.reset(); |
669 | 687 |
670 this._invalidateAllItems(); | 688 this._invalidateAllItems(); |
671 this.refresh(); | 689 this.refresh(); |
672 }, | 690 }, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 { | 748 { |
731 this._needsRefresh = false; | 749 this._needsRefresh = false; |
732 if (this._refreshTimeout) { | 750 if (this._refreshTimeout) { |
733 clearTimeout(this._refreshTimeout); | 751 clearTimeout(this._refreshTimeout); |
734 delete this._refreshTimeout; | 752 delete this._refreshTimeout; |
735 } | 753 } |
736 | 754 |
737 this._removeAllNodeHighlights(); | 755 this._removeAllNodeHighlights(); |
738 var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow(); | 756 var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow(); |
739 var boundariesChanged = false; | 757 var boundariesChanged = false; |
740 if (this.calculator.updateBoundariesForEventTime) { | 758 var calculator = this.calculator(); |
741 boundariesChanged = this.calculator.updateBoundariesForEventTime(thi
s._mainRequestLoadTime) || boundariesChanged; | 759 if (calculator.updateBoundariesForEventTime) { |
742 boundariesChanged = this.calculator.updateBoundariesForEventTime(thi
s._mainRequestDOMContentLoadedTime) || boundariesChanged; | 760 boundariesChanged = calculator.updateBoundariesForEventTime(this._ma
inRequestLoadTime) || boundariesChanged; |
| 761 boundariesChanged = calculator.updateBoundariesForEventTime(this._ma
inRequestDOMContentLoadedTime) || boundariesChanged; |
743 } | 762 } |
744 | 763 |
745 var dataGrid = this._dataGrid; | 764 var dataGrid = this._dataGrid; |
746 var rootNode = dataGrid.rootNode(); | 765 var rootNode = dataGrid.rootNode(); |
747 var nodesToInsert = []; | 766 var nodesToInsert = []; |
748 for (var requestId in this._staleRequestIds) { | 767 for (var requestId in this._staleRequestIds) { |
749 var node = this._nodesByRequestId.get(requestId); | 768 var node = this._nodesByRequestId.get(requestId); |
750 if (!node) | 769 if (!node) |
751 continue; | 770 continue; |
752 if (!node._isFilteredOut) | 771 if (!node._isFilteredOut) |
753 rootNode.removeChild(node); | 772 rootNode.removeChild(node); |
754 node._isFilteredOut = !this._applyFilter(node); | 773 node._isFilteredOut = !this._applyFilter(node); |
755 if (!node._isFilteredOut) | 774 if (!node._isFilteredOut) |
756 nodesToInsert.push(node); | 775 nodesToInsert.push(node); |
757 } | 776 } |
758 | 777 |
759 for (var i = 0; i < nodesToInsert.length; ++i) { | 778 for (var i = 0; i < nodesToInsert.length; ++i) { |
760 var node = nodesToInsert[i]; | 779 var node = nodesToInsert[i]; |
761 var request = node._request; | 780 var request = node._request; |
762 node.refresh(); | 781 node.refresh(); |
763 dataGrid.insertChild(node); | 782 dataGrid.insertChild(node); |
764 node._isMatchingSearchQuery = this._matchRequest(request); | 783 node._isMatchingSearchQuery = this._matchRequest(request); |
765 if (this.calculator.updateBoundaries(request)) | 784 if (calculator.updateBoundaries(request)) |
766 boundariesChanged = true; | 785 boundariesChanged = true; |
767 } | 786 } |
768 | 787 |
769 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM
atchIndex(this._currentMatchedRequestNode), false); | 788 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM
atchIndex(this._currentMatchedRequestNode), false); |
770 | 789 |
771 if (boundariesChanged) { | 790 if (boundariesChanged) { |
772 // The boundaries changed, so all item graphs are stale. | 791 // The boundaries changed, so all item graphs are stale. |
773 this._updateDividersIfNeeded(); | 792 this._updateDividersIfNeeded(); |
774 var nodes = this._nodesByRequestId.values(); | 793 var nodes = this._nodesByRequestId.values(); |
775 for (var i = 0; i < nodes.length; ++i) | 794 for (var i = 0; i < nodes.length; ++i) |
776 nodes[i].refreshGraph(this.calculator); | 795 nodes[i].refreshGraph(calculator); |
777 } | 796 } |
778 | 797 |
779 this._staleRequestIds = {}; | 798 this._staleRequestIds = {}; |
780 this._updateSummaryBar(); | 799 this._updateSummaryBar(); |
781 if (wasScrolledToLastRow) | 800 if (wasScrolledToLastRow) |
782 this._dataGrid.scrollToLastRow(); | 801 this._dataGrid.scrollToLastRow(); |
783 }, | 802 }, |
784 | 803 |
785 _onRecordButtonClicked: function() | 804 _onRecordButtonClicked: function() |
786 { | 805 { |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 for (var columnId in defaultColumnsVisibility) | 1794 for (var columnId in defaultColumnsVisibility) |
1776 columnsVisibility[columnId] = savedColumnsVisibility.hasOwnProperty(colu
mnId) ? savedColumnsVisibility[columnId] : defaultColumnsVisibility[columnId]; | 1795 columnsVisibility[columnId] = savedColumnsVisibility.hasOwnProperty(colu
mnId) ? savedColumnsVisibility[columnId] : defaultColumnsVisibility[columnId]; |
1777 networkLogColumnsVisibilitySetting.set(columnsVisibility); | 1796 networkLogColumnsVisibilitySetting.set(columnsVisibility); |
1778 | 1797 |
1779 this._networkLogView = new WebInspector.NetworkLogView(this._filterBar, netw
orkLogColumnsVisibilitySetting); | 1798 this._networkLogView = new WebInspector.NetworkLogView(this._filterBar, netw
orkLogColumnsVisibilitySetting); |
1780 this._networkLogView.show(this._splitView.sidebarElement()); | 1799 this._networkLogView.show(this._splitView.sidebarElement()); |
1781 | 1800 |
1782 var viewsContainerView = new WebInspector.VBox(); | 1801 var viewsContainerView = new WebInspector.VBox(); |
1783 this._viewsContainerElement = viewsContainerView.element; | 1802 this._viewsContainerElement = viewsContainerView.element; |
1784 this._viewsContainerElement.id = "network-views"; | 1803 this._viewsContainerElement.id = "network-views"; |
1785 if (!this._networkLogView.useLargeRows) | 1804 if (!this._networkLogView.usesLargeRows()) |
1786 this._viewsContainerElement.classList.add("small"); | 1805 this._viewsContainerElement.classList.add("small"); |
1787 viewsContainerView.show(this._splitView.mainElement()); | 1806 viewsContainerView.show(this._splitView.mainElement()); |
1788 | 1807 |
1789 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.ViewCleared, this._onViewCleared, this); | 1808 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.ViewCleared, this._onViewCleared, this); |
1790 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.RowSizeChanged, this._onRowSizeChanged, this); | 1809 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.RowSizeChanged, this._onRowSizeChanged, this); |
1791 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.RequestSelected, this._onRequestSelected, this); | 1810 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.RequestSelected, this._onRequestSelected, this); |
1792 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchCountUpdated, this._onSearchCountUpdated, this); | 1811 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchCountUpdated, this._onSearchCountUpdated, this); |
1793 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchIndexUpdated, this._onSearchIndexUpdated, this); | 1812 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchIndexUpdated, this._onSearchIndexUpdated, this); |
1794 | 1813 |
1795 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c
lose-button"); | 1814 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c
lose-button"); |
1796 this._closeButtonElement.id = "network-close-button"; | 1815 this._closeButtonElement.id = "network-close-button"; |
1797 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind
(this), false); | 1816 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind
(this), false); |
1798 this._viewsContainerElement.appendChild(this._closeButtonElement); | 1817 this._viewsContainerElement.appendChild(this._closeButtonElement); |
1799 | 1818 |
1800 for (var i = 0; i < this._networkLogView.statusBarItems.length; ++i) | 1819 var statusBarItems = this._networkLogView.statusBarItems(); |
1801 this._panelStatusBarElement.appendChild(this._networkLogView.statusBarIt
ems[i]); | 1820 for (var i = 0; i < statusBarItems.length; ++i) |
| 1821 this._panelStatusBarElement.appendChild(statusBarItems[i]); |
1802 | 1822 |
1803 /** | 1823 /** |
1804 * @this {WebInspector.NetworkPanel} | 1824 * @this {WebInspector.NetworkPanel} |
1805 * @return {?WebInspector.SourceFrame} | 1825 * @return {?WebInspector.SourceFrame} |
1806 */ | 1826 */ |
1807 function sourceFrameGetter() | 1827 function sourceFrameGetter() |
1808 { | 1828 { |
1809 return this._networkItemView.currentSourceFrame(); | 1829 return this._networkItemView.currentSourceFrame(); |
1810 } | 1830 } |
1811 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this)); | 1831 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this)); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 | 1987 |
1968 _toggleGridMode: function() | 1988 _toggleGridMode: function() |
1969 { | 1989 { |
1970 if (this._viewingRequestMode) { | 1990 if (this._viewingRequestMode) { |
1971 this._viewingRequestMode = false; | 1991 this._viewingRequestMode = false; |
1972 this.element.classList.remove("viewing-resource"); | 1992 this.element.classList.remove("viewing-resource"); |
1973 this._splitView.hideMain(); | 1993 this._splitView.hideMain(); |
1974 } | 1994 } |
1975 | 1995 |
1976 this._networkLogView.switchToDetailedView(); | 1996 this._networkLogView.switchToDetailedView(); |
1977 this._networkLogView.allowPopover = true; | 1997 this._networkLogView.setAllowPopover(true); |
1978 this._networkLogView._allowRequestSelection = false; | 1998 this._networkLogView._allowRequestSelection = false; |
1979 }, | 1999 }, |
1980 | 2000 |
1981 _toggleViewingRequestMode: function() | 2001 _toggleViewingRequestMode: function() |
1982 { | 2002 { |
1983 if (this._viewingRequestMode) | 2003 if (this._viewingRequestMode) |
1984 return; | 2004 return; |
1985 this._viewingRequestMode = true; | 2005 this._viewingRequestMode = true; |
1986 | 2006 |
1987 this.element.classList.add("viewing-resource"); | 2007 this.element.classList.add("viewing-resource"); |
1988 this._splitView.showBoth(); | 2008 this._splitView.showBoth(); |
1989 this._networkLogView.allowPopover = false; | 2009 this._networkLogView.setAllowPopover(false); |
1990 this._networkLogView._allowRequestSelection = true; | 2010 this._networkLogView._allowRequestSelection = true; |
1991 this._networkLogView.switchToBriefView(); | 2011 this._networkLogView.switchToBriefView(); |
1992 }, | 2012 }, |
1993 | 2013 |
1994 /** | 2014 /** |
1995 * @param {string} query | 2015 * @param {string} query |
1996 * @param {boolean} shouldJump | 2016 * @param {boolean} shouldJump |
1997 * @param {boolean=} jumpBackwards | 2017 * @param {boolean=} jumpBackwards |
1998 */ | 2018 */ |
1999 performSearch: function(query, shouldJump, jumpBackwards) | 2019 performSearch: function(query, shouldJump, jumpBackwards) |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 element.classList.toggle("network-error-row", this._isFailed()); | 2523 element.classList.toggle("network-error-row", this._isFailed()); |
2504 element.classList.toggle("resource-cached", this._request.cached); | 2524 element.classList.toggle("resource-cached", this._request.cached); |
2505 var typeClassName = "network-type-" + this._request.type.name(); | 2525 var typeClassName = "network-type-" + this._request.type.name(); |
2506 if (!element.classList.contains(typeClassName)) { | 2526 if (!element.classList.contains(typeClassName)) { |
2507 element.removeMatchingStyleClasses("network-type-\\w+"); | 2527 element.removeMatchingStyleClasses("network-type-\\w+"); |
2508 element.classList.add(typeClassName); | 2528 element.classList.add(typeClassName); |
2509 } | 2529 } |
2510 | 2530 |
2511 WebInspector.SortableDataGridNode.prototype.createCells.call(this); | 2531 WebInspector.SortableDataGridNode.prototype.createCells.call(this); |
2512 | 2532 |
2513 this.refreshGraph(this._parentView.calculator); | 2533 this.refreshGraph(this._parentView.calculator()); |
2514 }, | 2534 }, |
2515 | 2535 |
2516 /** | 2536 /** |
2517 * @override | 2537 * @override |
2518 * @param {string} columnIdentifier | 2538 * @param {string} columnIdentifier |
2519 * @return {!Element} | 2539 * @return {!Element} |
2520 */ | 2540 */ |
2521 createCell: function(columnIdentifier) | 2541 createCell: function(columnIdentifier) |
2522 { | 2542 { |
2523 var cell = this.createTD(columnIdentifier); | 2543 var cell = this.createTD(columnIdentifier); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3018 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa
me, revert, a, b) | 3038 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa
me, revert, a, b) |
3019 { | 3039 { |
3020 var aValue = a._request[propertyName]; | 3040 var aValue = a._request[propertyName]; |
3021 var bValue = b._request[propertyName]; | 3041 var bValue = b._request[propertyName]; |
3022 if (aValue > bValue) | 3042 if (aValue > bValue) |
3023 return revert ? -1 : 1; | 3043 return revert ? -1 : 1; |
3024 if (bValue > aValue) | 3044 if (bValue > aValue) |
3025 return revert ? 1 : -1; | 3045 return revert ? 1 : -1; |
3026 return a._request.indentityCompare(b._request); | 3046 return a._request.indentityCompare(b._request); |
3027 } | 3047 } |
OLD | NEW |