Bug 19793 - Web Inspector should show compressed size for network resources
: Web Inspector should show compressed size for network resources
Status: RESOLVED FIXED
: WebKit
Web Inspector (Deprecated)
: 528+ (Nightly build)
: Macintosh All
: P2 Normal
Assigned To:
: http://www.prowolfe.com/
: InRadar, ReviewedForRadar
: 56691
:
  Show dependency treegraph
 
Reported: 2008-06-27 11:29 PST by
Modified: 2012-03-17 09:02 PST (History)


Attachments
Patch enabling inspector support for showing transfer size without Content-Length headers. (28.02 KB, patch)
2011-03-17 07:39 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch follow-up (27.99 KB, patch)
2011-03-17 11:10 PST, Vsevolod Vlasov
pfeldman: review-
Review Patch | Details | Formatted Diff | Diff
Patch with fixes (31.58 KB, patch)
2011-03-17 16:27 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch with fixes2 (31.60 KB, patch)
2011-03-17 16:46 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch + changelogs update forgotten earlier (1.79 KB, patch)
2011-03-18 04:21 PST, Vsevolod Vlasov
pfeldman: review-
Review Patch | Details | Formatted Diff | Diff
Patch with fixes (31.74 KB, patch)
2011-03-18 05:49 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch (33.59 KB, patch)
2011-03-18 08:08 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-06-27 11:29:33 PST
One thing I noticed is that the Web Inspector gives different results for the same page when used on Tiger and Leopard. Specifically, when analyzing resources, Web Inspector indicates the size of Prototype.js as ~31 KB when used on Tiger but ~123 KB when the same page is analyzed on a Leopard machine. The script is served via Google Ajax API. The behavior is persistent across different machines and web sites and servers.

I have noticed this behavior with the nightly builds for the past couple of weeks.
------- Comment #1 From 2008-06-27 12:35:51 PST -------
I suspect that CFNetwork on Tiger is giving us the compressed size (eg, size over the wire) while Leopard is giving us the uncompressed size (after any gzip compression has been reversed).
------- Comment #2 From 2008-06-27 21:38:26 PST -------
<rdar://problem/6041709>
------- Comment #3 From 2008-06-28 01:37:31 PST -------
I'm pretty sure we have a duplicate in Bugzilla, but I cannot find it now.
------- Comment #4 From 2008-12-24 06:46:58 PST -------
(In reply to comment #1)
> I suspect that CFNetwork on Tiger is giving us the compressed size (eg, size
> over the wire) while Leopard is giving us the uncompressed size (after any gzip
> compression has been reversed).

I came across this bug when enabling gzip on a web server didn't make any difference to the size shown in the Web Inspector on the latest Nightly on Leopard. I haven't got a copy of Tiger so I can't confirm the original bug report.

Maybe the best thing to do is to take the 'Content-Length' header and base reports on that.
------- Comment #5 From 2008-12-29 04:01:08 PST -------
(In reply to comment #3)
> I'm pretty sure we have a duplicate in Bugzilla, but I cannot find it now.
> 

Is it a bug 14279?
------- Comment #6 From 2008-12-29 04:21:41 PST -------
That's probably not what I was thinking of, but it is certainly related.
------- Comment #7 From 2009-10-27 20:09:05 PST -------
*** Bug 30795 has been marked as a duplicate of this bug. ***
------- Comment #8 From 2010-04-27 13:39:18 PST -------
*** Bug 38181 has been marked as a duplicate of this bug. ***
------- Comment #9 From 2011-03-16 14:27:18 PST -------
See also: bug 31019.
------- Comment #10 From 2011-03-17 07:39:46 PST -------
Created an attachment (id=86054) [details]
Patch enabling inspector support for showing transfer size without Content-Length headers.

This patch enables inspector support for showing transfer size without Content-Length headers.
It is still responsibility of each port to provide valid transfer size data to ResourceLoader/ResourceHandleClient.

This bug should probably be renamed (if possible) to something more general, like "Web Inspector does not always show correct transfer size (for compressed/chunked data)", and then separate bugs could be created for each port.
------- Comment #11 From 2011-03-17 11:10:35 PST -------
Created an attachment (id=86073) [details]
Patch follow-up

Some fixes added
------- Comment #12 From 2011-03-17 12:19:11 PST -------
(From update of attachment 86073 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=86073&action=review

> LayoutTests/http/tests/inspector/network/network-size-chunked.html:16
> +    if (++loadedResourceCount === 1) {

I don't think you need a counter here.

> LayoutTests/http/tests/inspector/network/network-size-chunked.html:25
> +    InspectorTest.evaluateInPage("loadPages()");

Where is loadPages?

> LayoutTests/platform/chromium/test_expectations.txt:3190
> +BUG_VSEVIK SKIP : http/tests/inspector/network/network-size-chunked.html = FAIL

Could you please file a bug for all of these?

> Source/WebCore/inspector/front-end/Resource.js:244
> +        if (this._transferSize)

What about 0?

> Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp:561
> +    InspectorInstrumentation::didReceiveContentLength(m_frame, m_currentResourceIdentifier, length, -1);

No traffic here.

> Source/WebCore/platform/network/mac/ResourceHandleMac.mm:926
> +    m_handle->client()->didReceiveData(m_handle, (const char*)[data bytes], [data length], -1);

Put a FIXME and a bug reference here.
------- Comment #13 From 2011-03-17 16:27:32 PST -------
Created an attachment (id=86109) [details]
Patch with fixes

All done.

Added fixes for QT, GTK, Win.
------- Comment #14 From 2011-03-17 16:35:36 PST -------
Could you please write down what is being fixed in this patch? Will it fully work in Safari on Leopard and later?
------- Comment #15 From 2011-03-17 16:46:53 PST -------
Created an attachment (id=86113) [details]
Patch with fixes2

I have uploaded my path again to resolve merge conflicts.

No, it will not make it fully work in any port.

This particular patch just makes it possible to pass actual transfer size to inspector.
Each port should be changed accordingly to pass this value in ResourceHandleClient. 
I am not sure but it could probably require some changes outside of WebKit.

I created separate bug for chromium port which I am currently working on: https://bugs.webkit.org/show_bug.cgi?id=56602
I suggest we create separate bugs for other ports.
------- Comment #16 From 2011-03-18 04:21:36 PST -------
Created an attachment (id=86155) [details]
Patch + changelogs update forgotten earlier
------- Comment #17 From 2011-03-18 04:25:16 PST -------
(From update of attachment 86155 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=86155&action=review

Please send complete patch.

> LayoutTests/ChangeLog:5
> +        Added transfer size support in inspector for compressed data

Needs "Web Inspector:" prefix and the bug href.

> LayoutTests/ChangeLog:7
> +        Need a short description and bug URL (OOPS!)

OOPS breaks presubmit checks.
------- Comment #18 From 2011-03-18 05:49:42 PST -------
Created an attachment (id=86157) [details]
Patch with fixes
------- Comment #19 From 2011-03-18 08:08:42 PST -------
Created an attachment (id=86165) [details]
Patch
------- Comment #20 From 2011-03-18 08:32:57 PST -------
Attachment 86165 [details] did not build on win:
Build output: http://queues.webkit.org/results/8199301
------- Comment #21 From 2011-03-18 09:06:08 PST -------
> No, it will not make it fully work in any port.

Note that this bug is asking to make it work in Safari.
------- Comment #22 From 2011-03-18 09:15:36 PST -------
(From update of attachment 86165 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=86165&action=review

> LayoutTests/ChangeLog:7
> +        Web Inspector: Web Inspector Gives Different Results on Tiger and Leopard (should show compressed size)

ChangeLog structure:

Reviewed By

Title
href

Description

* files
------- Comment #23 From 2011-03-18 09:23:54 PST -------
(In reply to comment #21)
> > No, it will not make it fully work in any port.
> 
> Note that this bug is asking to make it work in Safari.

Yeah, we should move this patch to a different bug and make this one depend on it.
------- Comment #24 From 2011-06-18 00:21:18 PST -------
(From update of attachment 86165 [details])
was landed as r81580
------- Comment #25 From 2011-06-18 09:28:42 PST -------
Ilya, why did you close this bug? Are you saying that Web Inspector now displays a correct size in Safari?
------- Comment #26 From 2011-06-18 09:47:17 PST -------
(From update of attachment 86165 [details])
I think this is an oversight. As I mentioned in the comment #23, we should have moved the last patch to a new bug and fixed it there. In fact, I think that is what has happened. It is just that the reviewed patch here added confusion. Let me obsolete it and reopen the bug.
------- Comment #27 From 2011-06-18 09:48:00 PST -------
Reopening the original issue.
------- Comment #28 From 2012-03-17 09:02:50 PST -------
We show both sizes in the Network panel if you have large rows enabled.