Bug 76823

Summary: Web Inspector: response.bodySize in HAR is invalid (negative) for cached resources
Product: WebKit Reporter: Andrey Kosyakov <caseq>
Component: Web Inspector (Deprecated)Assignee: Andrey Kosyakov <caseq>
Status: RESOLVED INVALID    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Andrey Kosyakov 2012-01-23 05:33:56 PST
We used to compute response body size as resource.transferSize - resource.responseHeadersSize. Resource.transefrSize returns 0 for cached resources, so we were getting negative values in this case. The correct value to return is 0 as per HAR spec v1.2:

bodySize [number] - Size of the received response body in bytes. Set to zero in case of responses coming from the cache (304).
Comment 1 Andrey Kosyakov 2012-01-23 06:31:39 PST
Created attachment 123549 [details]
Patch
Comment 2 Andrey Kosyakov 2012-01-23 06:53:17 PST
Committed r105619: <http://trac.webkit.org/changeset/105619>
Comment 3 Andrey Kosyakov 2012-02-14 05:24:27 PST
Reopening to attach new patch.
Comment 4 Andrey Kosyakov 2012-02-14 05:24:32 PST
Created attachment 126963 [details]
Patch
Comment 5 WebKit Review Bot 2012-02-14 05:26:49 PST
Attachment 126963 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9

Updating OpenSource
First, rewinding head to replay your work on top of it...
Applying: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets
Using index info to reconstruct a base tree...
<stdin>:1578: trailing whitespace.
        
<stdin>:1647: trailing whitespace.
    
<stdin>:1657: trailing whitespace.
    
<stdin>:1672: trailing whitespace.
        return 0;        
<stdin>:1674: trailing whitespace.
    
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.
Falling back to patching base and 3-way merge...
warning: too many files (created: 168776 deleted: 3), skipping inexact rename detection
Auto-merging LayoutTests/ChangeLog
CONFLICT (content): Merge conflict in LayoutTests/ChangeLog
Auto-merging Source/WebCore/ChangeLog
CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog
Auto-merging Source/WebKit2/ChangeLog
CONFLICT (content): Merge conflict in Source/WebKit2/ChangeLog
Auto-merging Tools/ChangeLog
CONFLICT (content): Merge conflict in Tools/ChangeLog
Failed to merge in the changes.
Patch failed at 0001 [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 164.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Andrey Kosyakov 2012-02-14 05:28:34 PST
Comment on attachment 126963 [details]
Patch

Please disregard this, accidently uploaded a patch to the wrong bug.
Comment 7 Brian Burg 2014-12-12 14:35:45 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests.
Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.