<?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>26521</bug_id>
          
          <creation_ts>2009-06-18 15:35:47 -0700</creation_ts>
          <short_desc>Expose file size to chromium</short_desc>
          <delta_ts>2009-07-02 15:23:25 -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>PC</rep_platform>
          <op_sys>Windows Vista</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Victor Wang">victorw</reporter>
          <assigned_to name="Victor Wang">victorw</assigned_to>
          <cc>abarth</cc>
    
    <cc>darin</cc>
    
    <cc>dglazkov</cc>
    
    <cc>fishd</cc>
    
    <cc>playmobil</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>126790</commentid>
    <comment_count>0</comment_count>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-18 15:35:47 -0700</bug_when>
    <thetext>Need to implement getFileSize in WebCore/platform/chromium/FileSystemChromium.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126804</commentid>
    <comment_count>1</comment_count>
      <attachid>31515</attachid>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-18 16:04:50 -0700</bug_when>
    <thetext>Created attachment 31515
Expose file size to chromium</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126806</commentid>
    <comment_count>2</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2009-06-18 16:07:03 -0700</bug_when>
    <thetext>What is this method used for?  I&apos;m worried that an 0wned renderer can start reading to see if certain files exist or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126820</commentid>
    <comment_count>3</comment_count>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-18 17:14:50 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; What is this method used for?  I&apos;m worried that an 0wned renderer can start
&gt; reading to see if certain files exist or not.
&gt; 

This is only allowed in uploading file. see bug: http://code.google.com/p/chromium/issues/detail?id=9102

Here is the Chromium patch that supports this:
http://codereview.chromium.org/131082
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126829</commentid>
    <comment_count>4</comment_count>
      <attachid>31515</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2009-06-18 17:34:50 -0700</bug_when>
    <thetext>Comment on attachment 31515
Expose file size to chromium

I see, we validate the filename on the browser side.

Seems like it would be nice if we could get the filesize information when the user picks a file and pass it through the IPC then (the FileChooser in the RenderFileUploadControl would get filename, size pairs).  It would avoid the extra calls IPC calls back to the browser, but this seems like the easier change to make.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126836</commentid>
    <comment_count>5</comment_count>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-18 17:44:33 -0700</bug_when>
    <thetext>I was thinking about getting the filesize info and passing it through IPC with file name user selected, but the FileChooser allows selecting multiple files and more changes on the existing IPC. Discussed with Darin and think having a separate IPC to browser seems easier.

(In reply to comment #4)
&gt; (From update of attachment 31515 [review])
&gt; I see, we validate the filename on the browser side.
&gt; 
&gt; Seems like it would be nice if we could get the filesize information when the
&gt; user picks a file and pass it through the IPC then (the FileChooser in the
&gt; RenderFileUploadControl would get filename, size pairs).  It would avoid the
&gt; extra calls IPC calls back to the browser, but this seems like the easier
&gt; change to make.
&gt; 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126860</commentid>
    <comment_count>6</comment_count>
      <attachid>31515</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-06-18 18:51:41 -0700</bug_when>
    <thetext>Comment on attachment 31515
Expose file size to chromium

Looks fine to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126863</commentid>
    <comment_count>7</comment_count>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-18 19:22:23 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 31515 [review])
&gt; Looks fine to me.
&gt; 

could you hold landing this patch? would like to wait for the change in Chromium codebase to be reviewed. Will update this bug once the Chromium one is ready.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127397</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-06-22 11:25:24 -0700</bug_when>
    <thetext>(In reply to comment #4)
...
&gt; Seems like it would be nice if we could get the filesize information when the
&gt; user picks a file and pass it through the IPC then (the FileChooser in the
&gt; RenderFileUploadControl would get filename, size pairs).  It would avoid the
&gt; extra calls IPC calls back to the browser, but this seems like the easier
&gt; change to make.

This seems like an interesting idea to me.  It would mean changing FileChooser
to hand back not just a list of file names but also the sizes of those files.

One downside is that the file size returned to script would not be dynamic.  That
may actually be a deal breaker since I think it is normally valid for users to
change the file to be uploaded before actually submitting the form.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127404</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-06-22 11:32:04 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; I think it is normally valid for users to
&gt; change the file to be uploaded before actually submitting the form.

Yes, it normally is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128058</commentid>
    <comment_count>10</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-06-24 18:30:29 -0700</bug_when>
    <thetext>Can this be landed now?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128091</commentid>
    <comment_count>11</comment_count>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-24 21:03:42 -0700</bug_when>
    <thetext>Not yet. Still waiting for the patch in chromium.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128871</commentid>
    <comment_count>12</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-06-29 13:26:02 -0700</bug_when>
    <thetext>Looks like http://codereview.chromium.org/131082 was just approved by fishd.  Let me know when this should go in.

Any commiter can easily land this with:

bugzilla-tool land-patches 26521 --no-build

(--no-build because there is no way to build these chromium-only changes in WebKit).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128874</commentid>
    <comment_count>13</comment_count>
    <who name="Victor Wang">victorw</who>
    <bug_when>2009-06-29 13:37:56 -0700</bug_when>
    <thetext>Thanks Eric!

Both patches are ready, but we need to sync the webkit patch with the Chromium change. Dimitri is the sheriff for Chromium webkit integration and he is going to land this one while he is doing the merging.

(In reply to comment #12)
&gt; Looks like http://codereview.chromium.org/131082 was just approved by fishd. 
&gt; Let me know when this should go in.
&gt; 
&gt; Any commiter can easily land this with:
&gt; 
&gt; bugzilla-tool land-patches 26521 --no-build
&gt; 
&gt; (--no-build because there is no way to build these chromium-only changes in
&gt; WebKit).
&gt; </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129596</commentid>
    <comment_count>14</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2009-07-02 15:23:25 -0700</bug_when>
    <thetext>Landed as http://trac.webkit.org/changeset/45494.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>31515</attachid>
            <date>2009-06-18 16:04:50 -0700</date>
            <delta_ts>2009-06-18 18:51:41 -0700</delta_ts>
            <desc>Expose file size to chromium</desc>
            <filename>webkit_getfilesize.patch</filename>
            <type>text/plain</type>
            <size>2144</size>
            <attacher name="Victor Wang">victorw</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0NDgzMikKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMDktMDYtMTggIFZpY3RvciBXYW5nICA8dmljdG9yd0BjaHJvbWl1
bS5vcmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAg
aHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTI2NTIxCisgICAgICAgIEV4
cG9zZSBmaWxlIHNpemUgdG8gY2hyb21pdW0KKworICAgICAgICBJbXBsZW1lbnQgZ2V0RmlsZVNp
emUoKSBmb3IgQ2hyb21pdW0uCisKKyAgICAgICAgKiBwbGF0Zm9ybS9jaHJvbWl1bS9DaHJvbWl1
bUJyaWRnZS5oOgorICAgICAgICAqIHBsYXRmb3JtL2Nocm9taXVtL0ZpbGVTeXN0ZW1DaHJvbWl1
bS5jcHA6CisgICAgICAgIChXZWJDb3JlOjpnZXRGaWxlU2l6ZSk6CisKIDIwMDktMDYtMTggIFBl
dGVyIEthc3RpbmcgIDxwa2FzdGluZ0Bnb29nbGUuY29tPgogCiAgICAgICAgIEZpeCBidWlsZCBi
dXN0YWdlLgpJbmRleDogV2ViQ29yZS9wbGF0Zm9ybS9jaHJvbWl1bS9DaHJvbWl1bUJyaWRnZS5o
Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT0KLS0tIFdlYkNvcmUvcGxhdGZvcm0vY2hyb21pdW0vQ2hyb21pdW1CcmlkZ2Uu
aAkoc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pdW0uY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0zMSw2ICszMSw3IEBACiAjaW5j
bHVkZSAiY29uZmlnLmgiCiAjaW5jbHVkZSAiRmlsZVN5c3RlbS5oIgogCisjaW5jbHVkZSAiQ2hy
b21pdW1CcmlkZ2UuaCIKICNpbmNsdWRlICJOb3RJbXBsZW1lbnRlZC5oIgogI2luY2x1ZGUgIlBs
YXRmb3JtU3RyaW5nLmgiCiAKQEAgLTQ4LDEwICs0OSw5IEBAIGJvb2wgZGVsZXRlRW1wdHlEaXJl
Y3RvcnkoY29uc3QgU3RyaW5nJikKICAgICByZXR1cm4gZmFsc2U7CiB9CiAKLWJvb2wgZ2V0Rmls
ZVNpemUoY29uc3QgU3RyaW5nJiwgbG9uZyBsb25nJiByZXN1bHQpCitib29sIGdldEZpbGVTaXpl
KGNvbnN0IFN0cmluZyYgcGF0aCwgbG9uZyBsb25nJiByZXN1bHQpCiB7Ci0gICAgbm90SW1wbGVt
ZW50ZWQoKTsKLSAgICByZXR1cm4gZmFsc2U7CisgICAgcmV0dXJuIENocm9taXVtQnJpZGdlOjpn
ZXRGaWxlU2l6ZShwYXRoLCByZXN1bHQpOwogfQogCiBib29sIGdldEZpbGVNb2RpZmljYXRpb25U
aW1lKGNvbnN0IFN0cmluZyYsIHRpbWVfdCYgcmVzdWx0KQo=
</data>
<flag name="review"
          id="16159"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>