<?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>29068</bug_id>
          
          <creation_ts>2009-09-08 23:01:48 -0700</creation_ts>
          <short_desc>NPAPI Plugin NPP_AsFile not working on Qt Webkit</short_desc>
          <delta_ts>2009-09-09 02:53:30 -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>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>S60 3rd edition</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>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Rohini Ananth">rohini.ananth</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hausmann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>145653</commentid>
    <comment_count>0</comment_count>
    <who name="Rohini Ananth">rohini.ananth</who>
    <bug_when>2009-09-08 23:01:48 -0700</bug_when>
    <thetext>For NPAPI Plugins having stream transfer mode other than NP_NORMAL, a QTemporaryFile through openTemporaryFile() call in PluginStream::startstream gets created and in PluginStream::destroystream the file handle is closed before passing the file path in NPP_AsFile to plugin. By default, the property ‘autoremove’ of QTemporaryFile is true and such a setting deletes the file for closeFileHandle() itself, hence plugin does not see any created temp file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145658</commentid>
    <comment_count>1</comment_count>
      <attachid>39247</attachid>
    <who name="Rohini Ananth">rohini.ananth</who>
    <bug_when>2009-09-08 23:09:41 -0700</bug_when>
    <thetext>Created attachment 39247
Patch which solves the deletion of created temp file before passing to plugin in NPP_AsFile 

In the patch, in openTemporaryFile() method implemented for platform Qt in FileSystemQt.cpp, the autoremove property has been set to false.Hence closeFileHandle() just closes and does not delete the file before passing it to plugin. As last step of PluginStream::destroystream, anyways the deletion of this temp file has been taken care.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145687</commentid>
    <comment_count>2</comment_count>
      <attachid>39247</attachid>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-09-09 01:40:19 -0700</bug_when>
    <thetext>Comment on attachment 39247
Patch which solves the deletion of created temp file before passing to plugin in NPP_AsFile 

Your patch looks good in principle, thanks for tracking down this bug!

&gt; +     QTemporaryFile *tempFile = new QTemporaryFile(QLatin1String(prefix));
&gt; +     tempFile-&gt;setAutoRemove(false);
&gt; +     QFile *temp = tempFile;

Please fix the coding style for the newly added lines, the position of the * should be next to the type, not the variable.

Also please include a ChangeLog entry explaining your fix, using the same (very good btw) explanation you
mentioned in this bugzilla entry.

r- because of that, but otherwise ok :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145689</commentid>
    <comment_count>3</comment_count>
      <attachid>39255</attachid>
    <who name="Rohini Ananth">rohini.ananth</who>
    <bug_when>2009-09-09 02:24:14 -0700</bug_when>
    <thetext>Created attachment 39255
Final Patch with review comments incorporated

Thanks for the review Simon !</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145691</commentid>
    <comment_count>4</comment_count>
      <attachid>39255</attachid>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-09-09 02:53:02 -0700</bug_when>
    <thetext>Comment on attachment 39255
Final Patch with review comments incorporated

r=me.

You don&apos;t have to fill out the &quot;Reviewed by&quot; in the ChangeLog, it&apos;s okay to leave it with the &quot;NOBODY (OOPS)&quot; field. It will be filled out when landing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145692</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-09-09 02:53:30 -0700</bug_when>
    <thetext>Landed in r48204</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>39247</attachid>
            <date>2009-09-08 23:09:41 -0700</date>
            <delta_ts>2009-09-09 01:40:18 -0700</delta_ts>
            <desc>Patch which solves the deletion of created temp file before passing to plugin in NPP_AsFile </desc>
            <filename>NPPAsFile_FileSystemQt.patch</filename>
            <type>text/plain</type>
            <size>730</size>
            <attacher name="Rohini Ananth">rohini.ananth</attacher>
            
              <data encoding="base64">SW5kZXg6IHdlYmtpdC9XZWJDb3JlL3BsYXRmb3JtL3F0L0ZpbGVTeXN0ZW1RdC5jcHANCj09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0NCi0tLSB3ZWJraXQvV2ViQ29yZS9wbGF0Zm9ybS9xdC9GaWxlU3lzdGVtUXQuY3BwCShy
ZXZpc2lvbiAxNzc1MykNCisrKyB3ZWJraXQvV2ViQ29yZS9wbGF0Zm9ybS9xdC9GaWxlU3lzdGVt
UXQuY3BwCSh3b3JraW5nIGNvcHkpDQpAQCAtMTE3LDggKzExNywxMCBAQA0KIAogQ1N0cmluZyBv
cGVuVGVtcG9yYXJ5RmlsZShjb25zdCBjaGFyKiBwcmVmaXgsIFBsYXRmb3JtRmlsZUhhbmRsZSYg
aGFuZGxlKQogewotICAgIFFGaWxlICp0ZW1wID0gbmV3IFFUZW1wb3JhcnlGaWxlKFFMYXRpbjFT
dHJpbmcocHJlZml4KSk7Ci0gICAgaWYgKHRlbXAtPm9wZW4oUUlPRGV2aWNlOjpSZWFkV3JpdGUp
KSB7CisgICAgIFFUZW1wb3JhcnlGaWxlICp0ZW1wRmlsZSA9IG5ldyBRVGVtcG9yYXJ5RmlsZShR
TGF0aW4xU3RyaW5nKHByZWZpeCkpOworICAgICB0ZW1wRmlsZS0+c2V0QXV0b1JlbW92ZShmYWxz
ZSk7CisgICAgIFFGaWxlICp0ZW1wID0gdGVtcEZpbGU7CisgICAgIGlmICh0ZW1wLT5vcGVuKFFJ
T0RldmljZTo6UmVhZFdyaXRlKSkgewogICAgICAgICBoYW5kbGUgPSB0ZW1wOwogICAgICAgICBy
ZXR1cm4gU3RyaW5nKHRlbXAtPmZpbGVOYW1lKCkpLnV0ZjgoKTsKICAgICB9Cg==
</data>
<flag name="review"
          id="20311"
          type_id="1"
          status="-"
          setter="hausmann"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>39255</attachid>
            <date>2009-09-09 02:24:14 -0700</date>
            <delta_ts>2009-09-09 02:53:02 -0700</delta_ts>
            <desc>Final Patch with review comments incorporated</desc>
            <filename>NPP_AsFile_29068.patch</filename>
            <type>text/plain</type>
            <size>1468</size>
            <attacher name="Rohini Ananth">rohini.ananth</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0ODIwMykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTUgQEAKKzIwMDktMDktMDkgIFJvaGluaSBBbmFudGggPHJvaGluaS5hbmFudGhA
bm9raWEuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IFNpbW9uIEhhdXNtYW5uCisKKyAgICAg
ICAgTlBBUEkgUGx1Z2luIE5QUF9Bc0ZpbGUgbm90IHdvcmtpbmcgb24gUXQgV2Via2l0CisgICAg
ICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yOTA2OAorCis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dGluMVN0cmlu
ZyhwcmVmaXgpKTsKKyAgICBRVGVtcG9yYXJ5RmlsZSogdGVtcEZpbGUgPSBuZXcgUVRlbXBvcmFy
eUZpbGUoUUxhdGluMVN0cmluZyhwcmVmaXgpKTsKKyAgICB0ZW1wRmlsZS0+c2V0QXV0b1JlbW92
ZShmYWxzZSk7CisgICAgUUZpbGUqIHRlbXAgPSB0ZW1wRmlsZTsKICAgICBpZiAodGVtcC0+b3Bl
bihRSU9EZXZpY2U6OlJlYWRXcml0ZSkpIHsKICAgICAgICAgaGFuZGxlID0gdGVtcDsKICAgICAg
ICAgcmV0dXJuIFN0cmluZyh0ZW1wLT5maWxlTmFtZSgpKS51dGY4KCk7Cg==
</data>
<flag name="review"
          id="20319"
          type_id="1"
          status="+"
          setter="hausmann"
    />
          </attachment>
      

    </bug>

</bugzilla>