Bug 74935

Summary: Web Inspector: determine the resource type in InspectorResourceAgent::willSendRequest
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, ddkilzer, graouts, joepeck, rniwa, timothy
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Facebook filtered by Other
none
Facebook filtered by XHR
none
WIP Change
none
Patch
none
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion
none
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2
none
Patch none

Description Timothy Hatcher 2011-12-20 08:29:43 PST
Right now the type is sent in InspectorResourceAgent::didReceiveResponse. But the type is known for most loads in InspectorResourceAgent::willSendRequest because the cached CachedResource was created with the type before loading. Only XHRs, the document and favicons don't know their type, but those are easy to fix.

Passing this type along in requestWillBeSent to the front-end would let the Network panel group long polling XHRs in the XHR category instead of Other. So when you are filtering by XHR they will show up. Facebook is a good example of this. They have a long poll XHR that sits in Other for minutes, then once it loads moves to the XHR category and another one is started in Other. It would be great to see the pend and finished ones all under XHR.
Comment 1 Timothy Hatcher 2011-12-20 08:31:04 PST
Created attachment 120029 [details]
Facebook filtered by Other
Comment 2 Timothy Hatcher 2011-12-20 08:31:19 PST
Created attachment 120030 [details]
Facebook filtered by XHR
Comment 3 Timothy Hatcher 2012-02-14 11:19:53 PST
Created attachment 127002 [details]
WIP Change

Attaching WIP patch. This does not solve the problem on Facebook yet. We need to get told about XHRs sooner so we can set the type before willSendRequest.
Comment 4 Antoine Quint 2013-04-24 07:11:32 PDT
<rdar://problem/13726105>
Comment 5 Timothy Hatcher 2013-05-09 16:59:18 PDT
Created attachment 201303 [details]
Patch
Comment 6 Timothy Hatcher 2013-05-09 17:03:15 PDT
Comment on attachment 201303 [details]
Patch

We still send the type in didReceiveResponse, since it can change from Other to XHR still in some cases.
Comment 7 Build Bot 2013-05-10 00:08:41 PDT
Comment on attachment 201303 [details]
Patch

Attachment 201303 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/322076

New failing tests:
http/tests/inspector/network/network-disable-cache-memory.html
http/tests/inspector/resource-tree/resource-tree-non-unique-url.html
http/tests/inspector/network/network-cachedresources-with-same-urls.html
http/tests/inspector/network/network-disable-cache-xhrs.html
Comment 8 Build Bot 2013-05-10 00:08:42 PDT
Created attachment 201323 [details]
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-04  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
Comment 9 Build Bot 2013-05-10 00:38:21 PDT
Comment on attachment 201303 [details]
Patch

Attachment 201303 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/339314

New failing tests:
http/tests/inspector/network/network-disable-cache-memory.html
http/tests/inspector/resource-tree/resource-tree-non-unique-url.html
http/tests/inspector/network/network-disable-cache-xhrs.html
http/tests/inspector/network/network-cachedresources-with-same-urls.html
http/tests/security/cross-frame-access-put.html
Comment 10 Build Bot 2013-05-10 00:38:23 PDT
Created attachment 201324 [details]
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-12  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.2
Comment 11 Timothy Hatcher 2013-05-10 08:23:03 PDT
Created attachment 201347 [details]
Patch
Comment 12 Joseph Pecoraro 2013-05-10 13:13:07 PDT
Comment on attachment 201347 [details]
Patch

r=me
Comment 13 WebKit Commit Bot 2013-05-10 13:54:12 PDT
Comment on attachment 201347 [details]
Patch

Clearing flags on attachment: 201347

Committed r149905: <http://trac.webkit.org/changeset/149905>
Comment 14 WebKit Commit Bot 2013-05-10 13:54:14 PDT
All reviewed patches have been landed.  Closing bug.