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

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Haris Pobric 2008-06-27 11:29:33 PDT
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 Mark Rowe (bdash) 2008-06-27 12:35:51 PDT
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 Mark Rowe (bdash) 2008-06-27 21:38:26 PDT
<rdar://problem/6041709>
Comment 3 Alexey Proskuryakov 2008-06-28 01:37:31 PDT
I'm pretty sure we have a duplicate in Bugzilla, but I cannot find it now.
Comment 4 Mark Janssen 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 Robert Blaut 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 Alexey Proskuryakov 2008-12-29 04:21:41 PST
That's probably not what I was thinking of, but it is certainly related.
Comment 7 Alexey Proskuryakov 2009-10-27 20:09:05 PDT
*** Bug 30795 has been marked as a duplicate of this bug. ***
Comment 8 Alexey Proskuryakov 2010-04-27 13:39:18 PDT
*** Bug 38181 has been marked as a duplicate of this bug. ***
Comment 9 Alexey Proskuryakov 2011-03-16 14:27:18 PDT
See also: bug 31019.
Comment 10 Vsevolod Vlasov 2011-03-17 07:39:46 PDT
Created attachment 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 Vsevolod Vlasov 2011-03-17 11:10:35 PDT
Created attachment 86073 [details]
Patch follow-up

Some fixes added
Comment 12 Pavel Feldman 2011-03-17 12:19:11 PDT
Comment on attachment 86073 [details]
Patch follow-up

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 Vsevolod Vlasov 2011-03-17 16:27:32 PDT
Created attachment 86109 [details]
Patch with fixes

All done.

Added fixes for QT, GTK, Win.
Comment 14 Alexey Proskuryakov 2011-03-17 16:35:36 PDT
Could you please write down what is being fixed in this patch? Will it fully work in Safari on Leopard and later?
Comment 15 Vsevolod Vlasov 2011-03-17 16:46:53 PDT
Created attachment 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 Vsevolod Vlasov 2011-03-18 04:21:36 PDT
Created attachment 86155 [details]
Patch + changelogs update forgotten earlier
Comment 17 Pavel Feldman 2011-03-18 04:25:16 PDT
Comment on attachment 86155 [details]
Patch + changelogs update forgotten earlier

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 Vsevolod Vlasov 2011-03-18 05:49:42 PDT
Created attachment 86157 [details]
Patch with fixes
Comment 19 Vsevolod Vlasov 2011-03-18 08:08:42 PDT
Created attachment 86165 [details]
Patch
Comment 20 Build Bot 2011-03-18 08:32:57 PDT
Attachment 86165 [details] did not build on win:
Build output: http://queues.webkit.org/results/8199301
Comment 21 Alexey Proskuryakov 2011-03-18 09:06:08 PDT
> 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 Pavel Feldman 2011-03-18 09:15:36 PDT
Comment on attachment 86165 [details]
Patch

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 Pavel Feldman 2011-03-18 09:23:54 PDT
(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 Ilya Tikhonovsky 2011-06-18 00:21:18 PDT
Comment on attachment 86165 [details]
Patch

was landed as r81580
Comment 25 Alexey Proskuryakov 2011-06-18 09:28:42 PDT
Ilya, why did you close this bug? Are you saying that Web Inspector now displays a correct size in Safari?
Comment 26 Pavel Feldman 2011-06-18 09:47:17 PDT
Comment on attachment 86165 [details]
Patch

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 Pavel Feldman 2011-06-18 09:48:00 PDT
Reopening the original issue.
Comment 28 Timothy Hatcher 2012-03-17 09:02:50 PDT
We show both sizes in the Network panel if you have large rows enabled.