<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>31019</bug_id>
          
          <creation_ts>2009-11-02 10:35:58 -0800</creation_ts>
          <short_desc>Get rid of lengthReceived parameter in ResourceHandleClient::didReceiveData</short_desc>
          <delta_ts>2012-10-11 16:36:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yury Semikhatsky">yurys</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>psolanki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>159843</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-11-02 10:35:58 -0800</bug_when>
    <thetext>As fat as I can see this parameter has always the same value as dataLength. Moreover, at some point it gets passed to InspectorController::didReceiveContentLength where it is treated as dataLength(i.e. length of the just received chunk of data).

Here is the example call stack where InspectorController::didReceiveContentLength is called with. Probably InspectorController::didReceiveContentLength should be renamed?

&gt;	chrome.dll!WebCore::InspectorController::didReceiveContentLength(WebCore::DocumentLoader * __formal=0x01412200, unsigned long identifier=48, int lengthReceived=5191)  Line 978	C++
 	chrome.dll!WebCore::ResourceLoadNotifier::dispatchDidReceiveContentLength(WebCore::DocumentLoader * loader=0x01412200, unsigned long identifier=48, int length=5191)  Line 151	C++
 	chrome.dll!WebCore::ResourceLoadNotifier::didReceiveData(WebCore::ResourceLoader * loader=0x0433b200, const char * data=0x00e70000, int length=5191, int lengthReceived=5191)  Line 83	C++
 	chrome.dll!WebCore::ResourceLoader::didReceiveData(const char * data=0x00e70000, int length=5191, __int64 lengthReceived=5191, bool allAtOnce=false)  Line 254	C++
 	chrome.dll!WebCore::MainResourceLoader::didReceiveData(const char * data=0x00e70000, int length=5191, __int64 lengthReceived=5191, bool allAtOnce=false)  Line 375	C++
 	chrome.dll!WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle * __formal=0x0145b560, const char * data=0x00e70000, int length=5191, int lengthReceived=5191)  Line 398 + 0x1f bytes	C++
...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159849</commentid>
    <comment_count>1</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-11-02 10:51:54 -0800</bug_when>
    <thetext>Maybe this is why we show uncompressed size instead of compressed (bug 19793). Do the numbers differ if gzip server compression is used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159863</commentid>
    <comment_count>2</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-11-02 11:39:25 -0800</bug_when>
    <thetext>I tried setting a breakpoint in  ResourceLoader::didReceiveData with condition length!=lengthReceived. It&apos;s never hit when loading apache.org 

(In reply to comment #1)
&gt; Maybe this is why we show uncompressed size instead of compressed (bug 19793).
&gt; Do the numbers differ if gzip server compression is used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159866</commentid>
    <comment_count>3</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-11-02 11:41:20 -0800</bug_when>
    <thetext>I tried this in Safari on Mac OS X 10.5.8 (9L31a) and ToT WebKit built.

(In reply to comment #2)
&gt; I tried setting a breakpoint in  ResourceLoader::didReceiveData with condition
&gt; length!=lengthReceived. It&apos;s never hit when loading apache.org 
&gt; 
&gt; (In reply to comment #1)
&gt; &gt; Maybe this is why we show uncompressed size instead of compressed (bug 19793).
&gt; &gt; Do the numbers differ if gzip server compression is used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159889</commentid>
    <comment_count>4</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-11-02 12:23:14 -0800</bug_when>
    <thetext>OK, I guess it is fine to remove.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159968</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-11-02 19:19:38 -0800</bug_when>
    <thetext>Yes, this parameter is supposed to carry original encoded length of the chunk. If it doesn&apos;t, that&apos;s probably an NSURLConnection bug.

Your stack trace is from Chrome, and you also said that this fails on Mac. We should file a bug against NSURLConnection then. Does ResourceHandleCFNet work?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>