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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 this._matchedRequestCount = 0; | 56 this._matchedRequestCount = 0; |
57 this._highlightedSubstringChanges = []; | 57 this._highlightedSubstringChanges = []; |
58 | 58 |
59 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ | 59 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ |
60 this._filters = []; | 60 this._filters = []; |
61 | 61 |
62 this._currentMatchedRequestNode = null; | 62 this._currentMatchedRequestNode = null; |
63 this._currentMatchedRequestIndex = -1; | 63 this._currentMatchedRequestIndex = -1; |
64 | 64 |
65 this._createStatusbarButtons(); | 65 this._createStatusbarButtons(); |
66 this._createStatusBarItems(); | |
67 this._linkifier = new WebInspector.Linkifier(); | 66 this._linkifier = new WebInspector.Linkifier(); |
68 | 67 |
69 this._allowPopover = true; | 68 this._allowPopover = true; |
70 | 69 |
71 /** @type {number} */ | 70 /** @type {number} */ |
72 this._rowHeight = 0; | 71 this._rowHeight = 0; |
73 | 72 |
74 this._addFilters(); | 73 this._addFilters(); |
75 this._resetSuggestionBuilder(); | 74 this._resetSuggestionBuilder(); |
76 this._initializeView(); | 75 this._initializeView(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 this._updateRowsSize(); | 222 this._updateRowsSize(); |
224 | 223 |
225 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this.
_getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.
bind(this)); | 224 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this.
_getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.
bind(this)); |
226 // Enable faster hint. | 225 // Enable faster hint. |
227 this._popoverHelper.setTimeout(250, 250); | 226 this._popoverHelper.setTimeout(250, 250); |
228 | 227 |
229 this.switchViewMode(true); | 228 this.switchViewMode(true); |
230 }, | 229 }, |
231 | 230 |
232 /** | 231 /** |
233 * @return {!Array.<!Element>} | 232 * @return {!Array.<!WebInspector.StatusBarItem>} |
234 */ | 233 */ |
235 statusBarItems: function() | 234 statusBarItems: function() |
236 { | 235 { |
237 return [ | 236 return [ |
238 this._recordButton.element, | 237 this._recordButton, |
239 this._clearButton.element, | 238 this._clearButton, |
240 this._filterBar.filterButton().element, | 239 this._filterBar.filterButton(), |
241 this._largerRequestsButton.element, | 240 this._largerRequestsButton, |
242 this._preserveLogCheckbox.element, | 241 this._preserveLogCheckbox, |
243 this._disableCacheCheckbox.element, | 242 this._disableCacheCheckbox, |
244 this._progressBarContainer]; | 243 new WebInspector.StatusBarItem(this._progressBarContainer) ]; |
245 }, | 244 }, |
246 | 245 |
247 /** | 246 /** |
248 * @return {boolean} | 247 * @return {boolean} |
249 */ | 248 */ |
250 usesLargeRows: function() | 249 usesLargeRows: function() |
251 { | 250 { |
252 return !!WebInspector.settings.resourcesLargeRows.get(); | 251 return !!WebInspector.settings.resourcesLargeRows.get(); |
253 }, | 252 }, |
254 | 253 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 var selectedOption = this._timelineSortSelector[selectedIndex]; | 550 var selectedOption = this._timelineSortSelector[selectedIndex]; |
552 var value = selectedOption.value; | 551 var value = selectedOption.value; |
553 | 552 |
554 this._setCalculator(this._calculators[value]); | 553 this._setCalculator(this._calculators[value]); |
555 var sortingFunction = this._sortingFunctions[value]; | 554 var sortingFunction = this._sortingFunctions[value]; |
556 this._dataGrid.sortNodes(sortingFunction); | 555 this._dataGrid.sortNodes(sortingFunction); |
557 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM
atchIndex(this._currentMatchedRequestNode), false); | 556 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM
atchIndex(this._currentMatchedRequestNode), false); |
558 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or
der.Ascending); | 557 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or
der.Ascending); |
559 }, | 558 }, |
560 | 559 |
561 _createStatusBarItems: function() | |
562 { | |
563 this._progressBarContainer = createElement("div"); | |
564 this._progressBarContainer.className = "status-bar-item"; | |
565 }, | |
566 | |
567 _updateSummaryBar: function() | 560 _updateSummaryBar: function() |
568 { | 561 { |
569 var requestsNumber = this._nodesByRequestId.size; | 562 var requestsNumber = this._nodesByRequestId.size; |
570 | 563 |
571 if (!requestsNumber) { | 564 if (!requestsNumber) { |
572 if (this._summaryBarElement._isDisplayingWarning) | 565 if (this._summaryBarElement._isDisplayingWarning) |
573 return; | 566 return; |
574 this._summaryBarElement._isDisplayingWarning = true; | 567 this._summaryBarElement._isDisplayingWarning = true; |
575 this._summaryBarElement.removeChildren(); | 568 this._summaryBarElement.removeChildren(); |
576 this._summaryBarElement.createChild("div", "warning-icon-small"); | 569 this._summaryBarElement.createChild("div", "warning-icon-small"); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect
or.UIString("Use small resource rows."), "network-larger-resources-status-bar-it
em"); | 730 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect
or.UIString("Use small resource rows."), "network-larger-resources-status-bar-it
em"); |
738 this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLar
geRows.get()); | 731 this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLar
geRows.get()); |
739 this._largerRequestsButton.addEventListener("click", this._toggleLargerR
equests, this); | 732 this._largerRequestsButton.addEventListener("click", this._toggleLargerR
equests, this); |
740 | 733 |
741 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec
tor.UIString("Preserve log")); | 734 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec
tor.UIString("Preserve log")); |
742 this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not
clear log on page reload / navigation."); | 735 this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not
clear log on page reload / navigation."); |
743 | 736 |
744 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe
ctor.UIString("Disable cache")); | 737 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe
ctor.UIString("Disable cache")); |
745 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle
ment, WebInspector.settings.cacheDisabled); | 738 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle
ment, WebInspector.settings.cacheDisabled); |
746 this._disableCacheCheckbox.element.title = WebInspector.UIString("Disabl
e cache (while DevTools is open)."); | 739 this._disableCacheCheckbox.element.title = WebInspector.UIString("Disabl
e cache (while DevTools is open)."); |
| 740 |
| 741 this._progressBarContainer = createElement("div"); |
747 }, | 742 }, |
748 | 743 |
749 /** | 744 /** |
750 * @param {!WebInspector.Event} event | 745 * @param {!WebInspector.Event} event |
751 */ | 746 */ |
752 _loadEventFired: function(event) | 747 _loadEventFired: function(event) |
753 { | 748 { |
754 if (!this._recordButton.toggled()) | 749 if (!this._recordButton.toggled()) |
755 return; | 750 return; |
756 | 751 |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 * @constructor | 1906 * @constructor |
1912 * @implements {WebInspector.ContextMenu.Provider} | 1907 * @implements {WebInspector.ContextMenu.Provider} |
1913 * @implements {WebInspector.Searchable} | 1908 * @implements {WebInspector.Searchable} |
1914 * @extends {WebInspector.Panel} | 1909 * @extends {WebInspector.Panel} |
1915 */ | 1910 */ |
1916 WebInspector.NetworkPanel = function() | 1911 WebInspector.NetworkPanel = function() |
1917 { | 1912 { |
1918 WebInspector.Panel.call(this, "network"); | 1913 WebInspector.Panel.call(this, "network"); |
1919 this.registerRequiredCSS("network/networkPanel.css"); | 1914 this.registerRequiredCSS("network/networkPanel.css"); |
1920 | 1915 |
1921 this._panelStatusBarElement = this.element.createChild("div", "panel-status-
bar"); | 1916 this._panelStatusBar = new WebInspector.StatusBar(this.element); |
1922 this._filterBar = new WebInspector.FilterBar(); | 1917 this._filterBar = new WebInspector.FilterBar(); |
1923 this._filtersContainer = this.element.createChild("div", "network-filters-he
ader hidden"); | 1918 this._filtersContainer = this.element.createChild("div", "network-filters-he
ader hidden"); |
1924 this._filtersContainer.appendChild(this._filterBar.filtersElement()); | 1919 this._filtersContainer.appendChild(this._filterBar.filtersElement()); |
1925 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggle
d, this._onFiltersToggled, this); | 1920 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggle
d, this._onFiltersToggled, this); |
1926 this._filterBar.setName("networkPanel"); | 1921 this._filterBar.setName("networkPanel"); |
1927 | 1922 |
1928 this._searchableView = new WebInspector.SearchableView(this); | 1923 this._searchableView = new WebInspector.SearchableView(this); |
1929 this._searchableView.show(this.element); | 1924 this._searchableView.show(this.element); |
1930 var contentsElement = this._searchableView.element; | 1925 var contentsElement = this._searchableView.element; |
1931 | 1926 |
(...skipping 26 matching lines...) Expand all Loading... |
1958 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchCountUpdated, this._onSearchCountUpdated, this); | 1953 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchCountUpdated, this._onSearchCountUpdated, this); |
1959 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchIndexUpdated, this._onSearchIndexUpdated, this); | 1954 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes
.SearchIndexUpdated, this._onSearchIndexUpdated, this); |
1960 | 1955 |
1961 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c
lose-button"); | 1956 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c
lose-button"); |
1962 this._closeButtonElement.id = "network-close-button"; | 1957 this._closeButtonElement.id = "network-close-button"; |
1963 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind
(this), false); | 1958 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind
(this), false); |
1964 this._viewsContainerElement.appendChild(this._closeButtonElement); | 1959 this._viewsContainerElement.appendChild(this._closeButtonElement); |
1965 | 1960 |
1966 var statusBarItems = this._networkLogView.statusBarItems(); | 1961 var statusBarItems = this._networkLogView.statusBarItems(); |
1967 for (var i = 0; i < statusBarItems.length; ++i) | 1962 for (var i = 0; i < statusBarItems.length; ++i) |
1968 this._panelStatusBarElement.appendChild(statusBarItems[i]); | 1963 this._panelStatusBar.appendStatusBarItem(statusBarItems[i]); |
1969 | 1964 |
1970 /** | 1965 /** |
1971 * @this {WebInspector.NetworkPanel} | 1966 * @this {WebInspector.NetworkPanel} |
1972 * @return {?WebInspector.SourceFrame} | 1967 * @return {?WebInspector.SourceFrame} |
1973 */ | 1968 */ |
1974 function sourceFrameGetter() | 1969 function sourceFrameGetter() |
1975 { | 1970 { |
1976 return this._networkItemView.currentSourceFrame(); | 1971 return this._networkItemView.currentSourceFrame(); |
1977 } | 1972 } |
1978 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this)); | 1973 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this)); |
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3312 this._writeProgress.done(); | 3307 this._writeProgress.done(); |
3313 return; | 3308 return; |
3314 } | 3309 } |
3315 const chunkSize = 100000; | 3310 const chunkSize = 100000; |
3316 var text = this._text.substring(this._bytesWritten, this._bytesWritten +
chunkSize); | 3311 var text = this._text.substring(this._bytesWritten, this._bytesWritten +
chunkSize); |
3317 this._bytesWritten += text.length; | 3312 this._bytesWritten += text.length; |
3318 stream.write(text, this._writeNextChunk.bind(this)); | 3313 stream.write(text, this._writeNextChunk.bind(this)); |
3319 this._writeProgress.setWorked(this._bytesWritten); | 3314 this._writeProgress.setWorked(this._bytesWritten); |
3320 } | 3315 } |
3321 } | 3316 } |
OLD | NEW |