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) 2010, 2011, 2012, 2013, 2014 Google Inc. All rights reserved. | 4 * Copyright (C) 2010, 2011, 2012, 2013, 2014 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 this._recordButton.addEventListener("click", this._onRecordButtonClicked
, this); | 724 this._recordButton.addEventListener("click", this._onRecordButtonClicked
, this); |
725 | 725 |
726 this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIStri
ng("Clear"), "clear-status-bar-item"); | 726 this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIStri
ng("Clear"), "clear-status-bar-item"); |
727 this._clearButton.addEventListener("click", this._reset, this); | 727 this._clearButton.addEventListener("click", this._reset, this); |
728 | 728 |
729 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect
or.UIString("Use small resource rows."), "network-larger-resources-status-bar-it
em"); | 729 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect
or.UIString("Use small resource rows."), "network-larger-resources-status-bar-it
em"); |
730 this._largerRequestsButton.toggled = WebInspector.settings.resourcesLarg
eRows.get(); | 730 this._largerRequestsButton.toggled = WebInspector.settings.resourcesLarg
eRows.get(); |
731 this._largerRequestsButton.addEventListener("click", this._toggleLargerR
equests, this); | 731 this._largerRequestsButton.addEventListener("click", this._toggleLargerR
equests, this); |
732 | 732 |
733 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec
tor.UIString("Preserve log")); | 733 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec
tor.UIString("Preserve log")); |
| 734 this._preserveLogCheckbox.inputElement.addEventListener("change", this._
preserveLogCheckboxChanged.bind(this)); |
734 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."); |
735 | 736 |
736 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe
ctor.UIString("Disable cache")); | 737 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe
ctor.UIString("Disable cache")); |
737 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle
ment, WebInspector.settings.cacheDisabled); | 738 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle
ment, WebInspector.settings.cacheDisabled); |
738 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)."); |
739 }, | 740 }, |
740 | 741 |
741 /** | 742 /** |
742 * @param {!WebInspector.Event} event | 743 * @param {!WebInspector.Event} event |
743 */ | 744 */ |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 this._updateDividersIfNeeded(); | 823 this._updateDividersIfNeeded(); |
823 var nodes = this._nodesByRequestId.valuesArray(); | 824 var nodes = this._nodesByRequestId.valuesArray(); |
824 for (var i = 0; i < nodes.length; ++i) | 825 for (var i = 0; i < nodes.length; ++i) |
825 nodes[i].refreshGraph(); | 826 nodes[i].refreshGraph(); |
826 } | 827 } |
827 | 828 |
828 this._staleRequestIds = {}; | 829 this._staleRequestIds = {}; |
829 this._updateSummaryBar(); | 830 this._updateSummaryBar(); |
830 }, | 831 }, |
831 | 832 |
832 _onRecordButtonClicked: function() | 833 /** |
| 834 * @param {!WebInspector.Event} event |
| 835 */ |
| 836 _onRecordButtonClicked: function(event) |
833 { | 837 { |
834 if (!this._recordButton.toggled) | 838 if (!this._recordButton.toggled) |
835 this._reset(); | 839 this._reset(); |
836 this._toggleRecordButton(!this._recordButton.toggled); | 840 this._toggleRecordButton(!this._recordButton.toggled); |
837 }, | 841 }, |
838 | 842 |
839 /** | 843 /** |
840 * @param {boolean} toggled | 844 * @param {boolean} toggled |
841 */ | 845 */ |
842 _toggleRecordButton: function(toggled) | 846 _toggleRecordButton: function(toggled) |
843 { | 847 { |
844 this._recordButton.toggled = toggled; | 848 this._recordButton.toggled = toggled; |
845 this._recordButton.title = toggled ? WebInspector.UIString("Stop Recordi
ng Network Log") : WebInspector.UIString("Record Network Log"); | 849 this._recordButton.title = toggled ? WebInspector.UIString("Stop Recordi
ng Network Log") : WebInspector.UIString("Record Network Log"); |
846 }, | 850 }, |
847 | 851 |
| 852 /** |
| 853 * @param {?Event} event |
| 854 */ |
| 855 _preserveLogCheckboxChanged: function(event) |
| 856 { |
| 857 if (!this._preserveLogCheckbox.checked()) |
| 858 return; |
| 859 var requests = this._nodesByRequestId.valuesArray().map(function(node) {
return node.request(); }); |
| 860 for (var i = 0; i < requests.length; ++i) |
| 861 this._forceContentLoading(requests[i]); |
| 862 }, |
| 863 |
848 _reset: function() | 864 _reset: function() |
849 { | 865 { |
850 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Vie
wCleared); | 866 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Vie
wCleared); |
851 | 867 |
852 this._clearSearchMatchedList(); | 868 this._clearSearchMatchedList(); |
853 if (this._popoverHelper) | 869 if (this._popoverHelper) |
854 this._popoverHelper.hidePopover(); | 870 this._popoverHelper.hidePopover(); |
855 | 871 |
856 if (this._calculator) | 872 if (this._calculator) |
857 this._calculator.reset(); | 873 this._calculator.reset(); |
(...skipping 23 matching lines...) Expand all Loading... |
881 { | 897 { |
882 if (this._recordButton.toggled) { | 898 if (this._recordButton.toggled) { |
883 var request = /** @type {!WebInspector.NetworkRequest} */ (event.dat
a); | 899 var request = /** @type {!WebInspector.NetworkRequest} */ (event.dat
a); |
884 this._appendRequest(request); | 900 this._appendRequest(request); |
885 } | 901 } |
886 }, | 902 }, |
887 | 903 |
888 /** | 904 /** |
889 * @param {!WebInspector.NetworkRequest} request | 905 * @param {!WebInspector.NetworkRequest} request |
890 */ | 906 */ |
| 907 _forceContentLoading: function(request) |
| 908 { |
| 909 /** |
| 910 * @param {?string} content |
| 911 */ |
| 912 function dummyContentCallback(content) { } |
| 913 |
| 914 request.requestContent(dummyContentCallback); |
| 915 }, |
| 916 |
| 917 /** |
| 918 * @param {!WebInspector.NetworkRequest} request |
| 919 */ |
891 _appendRequest: function(request) | 920 _appendRequest: function(request) |
892 { | 921 { |
893 var node = new WebInspector.NetworkDataGridNode(this, request); | 922 var node = new WebInspector.NetworkDataGridNode(this, request); |
894 node[WebInspector.NetworkLogView._isFilteredOutSymbol] = true; | 923 node[WebInspector.NetworkLogView._isFilteredOutSymbol] = true; |
895 node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = false; | 924 node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = false; |
| 925 // TODO: _forceContentLoading |
896 | 926 |
897 // In case of redirect request id is reassigned to a redirected | 927 // In case of redirect request id is reassigned to a redirected |
898 // request and we need to update _nodesByRequestId and search results. | 928 // request and we need to update _nodesByRequestId and search results. |
899 var originalRequestNode = this._nodesByRequestId.get(request.requestId); | 929 var originalRequestNode = this._nodesByRequestId.get(request.requestId); |
900 if (originalRequestNode) | 930 if (originalRequestNode) |
901 this._nodesByRequestId.set(originalRequestNode.request().requestId,
originalRequestNode); | 931 this._nodesByRequestId.set(originalRequestNode.request().requestId,
originalRequestNode); |
902 this._nodesByRequestId.set(request.requestId, node); | 932 this._nodesByRequestId.set(request.requestId, node); |
903 | 933 |
904 // Pull all the redirects of the main request upon commit load. | 934 // Pull all the redirects of the main request upon commit load. |
905 if (request.redirects) { | 935 if (request.redirects) { |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 return request.finished; | 1923 return request.finished; |
1894 } | 1924 } |
1895 | 1925 |
1896 WebInspector.NetworkLogView.EventTypes = { | 1926 WebInspector.NetworkLogView.EventTypes = { |
1897 ViewCleared: "ViewCleared", | 1927 ViewCleared: "ViewCleared", |
1898 RowSizeChanged: "RowSizeChanged", | 1928 RowSizeChanged: "RowSizeChanged", |
1899 RequestSelected: "RequestSelected", | 1929 RequestSelected: "RequestSelected", |
1900 SearchCountUpdated: "SearchCountUpdated", | 1930 SearchCountUpdated: "SearchCountUpdated", |
1901 SearchIndexUpdated: "SearchIndexUpdated" | 1931 SearchIndexUpdated: "SearchIndexUpdated" |
1902 }; | 1932 }; |
OLD | NEW |