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