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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 | 86 |
87 this._addFilters(); | 87 this._addFilters(); |
88 this._initializeView(); | 88 this._initializeView(); |
89 this._recordButton.toggled = true; | 89 this._recordButton.toggled = true; |
90 WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this)); | 90 WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this)); |
91 } | 91 } |
92 | 92 |
93 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true}; | 93 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true}; |
94 WebInspector.NetworkLogView._responseHeaderColumns = ["Cache-Control", "Connecti on", "Content-Encoding", "Content-Length", "ETag", "Keep-Alive", "Last-Modified" , "Server", "Vary"]; | 94 WebInspector.NetworkLogView._responseHeaderColumns = ["Cache-Control", "Connecti on", "Content-Encoding", "Content-Length", "ETag", "Keep-Alive", "Last-Modified" , "Server", "Vary"]; |
95 WebInspector.NetworkLogView._defaultColumnsVisibility = { | 95 WebInspector.NetworkLogView._defaultColumnsVisibility = { |
96 method: true, status: true, scheme: false, domain: false, type: true, initia tor: true, cookies: false, setCookies: false, size: true, time: true, | 96 method: true, status: true, scheme: false, domain: false, remoteAddress: fal se, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true, |
97 "Cache-Control": false, "Connection": false, "Content-Encoding": false, "Con tent-Length": false, "ETag": false, "Keep-Alive": false, "Last-Modified": false, "Server": false, "Vary": false | 97 "Cache-Control": false, "Connection": false, "Content-Encoding": false, "Con tent-Length": false, "ETag": false, "Keep-Alive": false, "Last-Modified": false, "Server": false, "Vary": false |
98 }; | 98 }; |
99 WebInspector.NetworkLogView._defaultRefreshDelay = 500; | 99 WebInspector.NetworkLogView._defaultRefreshDelay = 500; |
100 | 100 |
101 WebInspector.NetworkLogView.prototype = { | 101 WebInspector.NetworkLogView.prototype = { |
102 _addFilters: function() | 102 _addFilters: function() |
103 { | 103 { |
104 this._textFilterUI = new WebInspector.TextFilterUI(); | 104 this._textFilterUI = new WebInspector.TextFilterUI(); |
105 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterC hanged, this._filterChanged, this); | 105 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterC hanged, this._filterChanged, this); |
106 this._filterBar.addFilter(this._textFilterUI); | 106 this._filterBar.addFilter(this._textFilterUI); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 }); | 220 }); |
221 | 221 |
222 columns.push({ | 222 columns.push({ |
223 id: "domain", | 223 id: "domain", |
224 title: WebInspector.UIString("Domain"), | 224 title: WebInspector.UIString("Domain"), |
225 sortable: true, | 225 sortable: true, |
226 weight: 6 | 226 weight: 6 |
227 }); | 227 }); |
228 | 228 |
229 columns.push({ | 229 columns.push({ |
230 id: "remoteAddress", | |
231 title: WebInspector.UIString("Remote Address"), | |
232 sortable: true, | |
233 weight: 10, | |
234 align: WebInspector.DataGrid.Align.Right | |
235 }); | |
236 | |
237 columns.push({ | |
230 id: "type", | 238 id: "type", |
231 title: WebInspector.UIString("Type"), | 239 title: WebInspector.UIString("Type"), |
232 sortable: true, | 240 sortable: true, |
233 weight: 6 | 241 weight: 6 |
234 }); | 242 }); |
235 | 243 |
236 columns.push({ | 244 columns.push({ |
237 id: "initiator", | 245 id: "initiator", |
238 title: WebInspector.UIString("Initiator"), | 246 title: WebInspector.UIString("Initiator"), |
239 sortable: true, | 247 sortable: true, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 }, | 371 }, |
364 | 372 |
365 _createSortingFunctions: function() | 373 _createSortingFunctions: function() |
366 { | 374 { |
367 this._sortingFunctions = {}; | 375 this._sortingFunctions = {}; |
368 this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameCompa rator; | 376 this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameCompa rator; |
369 this._sortingFunctions.method = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "method", false); | 377 this._sortingFunctions.method = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "method", false); |
370 this._sortingFunctions.status = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "statusCode", false); | 378 this._sortingFunctions.status = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "statusCode", false); |
371 this._sortingFunctions.scheme = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "scheme", false); | 379 this._sortingFunctions.scheme = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "scheme", false); |
372 this._sortingFunctions.domain = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "domain", false); | 380 this._sortingFunctions.domain = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "domain", false); |
381 this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RemoteAdd ressComparator; | |
Peter Beverloo
2014/01/27 19:03:26
drive-by: s/type/remoteAddress/
eustas
2014/01/28 10:41:10
Done. Thanks.
| |
373 this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPr opertyComparator.bind(null, "mimeType", false); | 382 this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPr opertyComparator.bind(null, "mimeType", false); |
374 this._sortingFunctions.initiator = WebInspector.NetworkDataGridNode.Init iatorComparator; | 383 this._sortingFunctions.initiator = WebInspector.NetworkDataGridNode.Init iatorComparator; |
375 this._sortingFunctions.cookies = WebInspector.NetworkDataGridNode.Reques tCookiesCountComparator; | 384 this._sortingFunctions.cookies = WebInspector.NetworkDataGridNode.Reques tCookiesCountComparator; |
376 this._sortingFunctions.setCookies = WebInspector.NetworkDataGridNode.Res ponseCookiesCountComparator; | 385 this._sortingFunctions.setCookies = WebInspector.NetworkDataGridNode.Res ponseCookiesCountComparator; |
377 this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeCompa rator; | 386 this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeCompa rator; |
378 this._sortingFunctions.time = WebInspector.NetworkDataGridNode.RequestPr opertyComparator.bind(null, "duration", false); | 387 this._sortingFunctions.time = WebInspector.NetworkDataGridNode.RequestPr opertyComparator.bind(null, "duration", false); |
379 this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.Reque stPropertyComparator.bind(null, "startTime", false); | 388 this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.Reque stPropertyComparator.bind(null, "startTime", false); |
380 this._sortingFunctions.startTime = WebInspector.NetworkDataGridNode.Requ estPropertyComparator.bind(null, "startTime", false); | 389 this._sortingFunctions.startTime = WebInspector.NetworkDataGridNode.Requ estPropertyComparator.bind(null, "startTime", false); |
381 this._sortingFunctions.endTime = WebInspector.NetworkDataGridNode.Reques tPropertyComparator.bind(null, "endTime", false); | 390 this._sortingFunctions.endTime = WebInspector.NetworkDataGridNode.Reques tPropertyComparator.bind(null, "endTime", false); |
382 this._sortingFunctions.responseTime = WebInspector.NetworkDataGridNode.R equestPropertyComparator.bind(null, "responseReceivedTime", false); | 391 this._sortingFunctions.responseTime = WebInspector.NetworkDataGridNode.R equestPropertyComparator.bind(null, "responseReceivedTime", false); |
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2159 /** override */ | 2168 /** override */ |
2160 createCells: function() | 2169 createCells: function() |
2161 { | 2170 { |
2162 // Out of sight, out of mind: create nodes offscreen to save on render t ree update times when running updateOffscreenRows() | 2171 // Out of sight, out of mind: create nodes offscreen to save on render t ree update times when running updateOffscreenRows() |
2163 this._element.classList.add("offscreen"); | 2172 this._element.classList.add("offscreen"); |
2164 this._nameCell = this._createDivInTD("name"); | 2173 this._nameCell = this._createDivInTD("name"); |
2165 this._methodCell = this._createDivInTD("method"); | 2174 this._methodCell = this._createDivInTD("method"); |
2166 this._statusCell = this._createDivInTD("status"); | 2175 this._statusCell = this._createDivInTD("status"); |
2167 this._schemeCell = this._createDivInTD("scheme"); | 2176 this._schemeCell = this._createDivInTD("scheme"); |
2168 this._domainCell = this._createDivInTD("domain"); | 2177 this._domainCell = this._createDivInTD("domain"); |
2178 this._remoteAddressCell = this._createDivInTD("remoteAddress"); | |
2169 this._typeCell = this._createDivInTD("type"); | 2179 this._typeCell = this._createDivInTD("type"); |
2170 this._initiatorCell = this._createDivInTD("initiator"); | 2180 this._initiatorCell = this._createDivInTD("initiator"); |
2171 this._cookiesCell = this._createDivInTD("cookies"); | 2181 this._cookiesCell = this._createDivInTD("cookies"); |
2172 this._setCookiesCell = this._createDivInTD("setCookies"); | 2182 this._setCookiesCell = this._createDivInTD("setCookies"); |
2173 this._sizeCell = this._createDivInTD("size"); | 2183 this._sizeCell = this._createDivInTD("size"); |
2174 this._timeCell = this._createDivInTD("time"); | 2184 this._timeCell = this._createDivInTD("time"); |
2175 | 2185 |
2176 this._responseHeaderCells = {}; | 2186 this._responseHeaderCells = {}; |
2177 var responseHeaderColumns = WebInspector.NetworkLogView._responseHeaderC olumns; | 2187 var responseHeaderColumns = WebInspector.NetworkLogView._responseHeaderC olumns; |
2178 for (var i = 0; i < responseHeaderColumns.length; ++i) | 2188 for (var i = 0; i < responseHeaderColumns.length; ++i) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2274 cell.addEventListener("mouseover", this._refreshLabelPositions.bind(this ), false); | 2284 cell.addEventListener("mouseover", this._refreshLabelPositions.bind(this ), false); |
2275 }, | 2285 }, |
2276 | 2286 |
2277 refreshRequest: function() | 2287 refreshRequest: function() |
2278 { | 2288 { |
2279 this._refreshNameCell(); | 2289 this._refreshNameCell(); |
2280 this._refreshMethodCell(); | 2290 this._refreshMethodCell(); |
2281 this._refreshStatusCell(); | 2291 this._refreshStatusCell(); |
2282 this._refreshSchemeCell(); | 2292 this._refreshSchemeCell(); |
2283 this._refreshDomainCell(); | 2293 this._refreshDomainCell(); |
2294 this._refreshRemoteAddressCell(); | |
2284 this._refreshTypeCell(); | 2295 this._refreshTypeCell(); |
2285 this._refreshInitiatorCell(); | 2296 this._refreshInitiatorCell(); |
2286 this._refreshCookiesCell(); | 2297 this._refreshCookiesCell(); |
2287 this._refreshSetCookiesCell(); | 2298 this._refreshSetCookiesCell(); |
2288 this._refreshSizeCell(); | 2299 this._refreshSizeCell(); |
2289 this._refreshTimeCell(); | 2300 this._refreshTimeCell(); |
2290 | 2301 |
2291 var responseHeaderColumns = WebInspector.NetworkLogView._responseHeaderC olumns; | 2302 var responseHeaderColumns = WebInspector.NetworkLogView._responseHeaderC olumns; |
2292 for (var i = 0; i < responseHeaderColumns.length; ++i) | 2303 for (var i = 0; i < responseHeaderColumns.length; ++i) |
2293 this._refreshResponseHeaderCell(responseHeaderColumns[i]); | 2304 this._refreshResponseHeaderCell(responseHeaderColumns[i]); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2386 _refreshSchemeCell: function() | 2397 _refreshSchemeCell: function() |
2387 { | 2398 { |
2388 this._schemeCell.setTextAndTitle(this._request.scheme); | 2399 this._schemeCell.setTextAndTitle(this._request.scheme); |
2389 }, | 2400 }, |
2390 | 2401 |
2391 _refreshDomainCell: function() | 2402 _refreshDomainCell: function() |
2392 { | 2403 { |
2393 this._domainCell.setTextAndTitle(this._request.domain); | 2404 this._domainCell.setTextAndTitle(this._request.domain); |
2394 }, | 2405 }, |
2395 | 2406 |
2407 _refreshRemoteAddressCell: function() | |
2408 { | |
2409 this._remoteAddressCell.setTextAndTitle(this._request.remoteAddress()); | |
2410 }, | |
2411 | |
2396 _refreshTypeCell: function() | 2412 _refreshTypeCell: function() |
2397 { | 2413 { |
2398 if (this._request.mimeType) { | 2414 if (this._request.mimeType) { |
2399 this._typeCell.classList.remove("network-dim-cell"); | 2415 this._typeCell.classList.remove("network-dim-cell"); |
2400 this._typeCell.setTextAndTitle(this._request.mimeType); | 2416 this._typeCell.setTextAndTitle(this._request.mimeType); |
2401 } else { | 2417 } else { |
2402 this._typeCell.enableStyleClass("network-dim-cell", !this._request.i sPingRequest()); | 2418 this._typeCell.enableStyleClass("network-dim-cell", !this._request.i sPingRequest()); |
2403 this._typeCell.setTextAndTitle(this._request.requestContentType() || ""); | 2419 this._typeCell.setTextAndTitle(this._request.requestContentType() || ""); |
2404 } | 2420 } |
2405 }, | 2421 }, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2591 { | 2607 { |
2592 var aFileName = a._request.name(); | 2608 var aFileName = a._request.name(); |
2593 var bFileName = b._request.name(); | 2609 var bFileName = b._request.name(); |
2594 if (aFileName > bFileName) | 2610 if (aFileName > bFileName) |
2595 return 1; | 2611 return 1; |
2596 if (bFileName > aFileName) | 2612 if (bFileName > aFileName) |
2597 return -1; | 2613 return -1; |
2598 return 0; | 2614 return 0; |
2599 } | 2615 } |
2600 | 2616 |
2617 WebInspector.NetworkDataGridNode.RemoteAddressComparator = function(a, b) | |
2618 { | |
2619 var aRemoteAddress = a._request.remoteAddress(); | |
2620 var bRemoteAddress = b._request.remoteAddress(); | |
2621 if (aRemoteAddress > bRemoteAddress) | |
2622 return 1; | |
2623 if (bRemoteAddress > aRemoteAddress) | |
2624 return -1; | |
2625 return 0; | |
2626 } | |
2627 | |
2601 WebInspector.NetworkDataGridNode.SizeComparator = function(a, b) | 2628 WebInspector.NetworkDataGridNode.SizeComparator = function(a, b) |
2602 { | 2629 { |
2603 if (b._request.cached && !a._request.cached) | 2630 if (b._request.cached && !a._request.cached) |
2604 return 1; | 2631 return 1; |
2605 if (a._request.cached && !b._request.cached) | 2632 if (a._request.cached && !b._request.cached) |
2606 return -1; | 2633 return -1; |
2607 | 2634 |
2608 return a._request.transferSize - b._request.transferSize; | 2635 return a._request.transferSize - b._request.transferSize; |
2609 } | 2636 } |
2610 | 2637 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2653 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) | 2680 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) |
2654 { | 2681 { |
2655 var aValue = a._request[propertyName]; | 2682 var aValue = a._request[propertyName]; |
2656 var bValue = b._request[propertyName]; | 2683 var bValue = b._request[propertyName]; |
2657 if (aValue > bValue) | 2684 if (aValue > bValue) |
2658 return revert ? -1 : 1; | 2685 return revert ? -1 : 1; |
2659 if (bValue > aValue) | 2686 if (bValue > aValue) |
2660 return revert ? 1 : -1; | 2687 return revert ? 1 : -1; |
2661 return 0; | 2688 return 0; |
2662 } | 2689 } |
OLD | NEW |