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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23416</bug_id>
          
          <creation_ts>2013-10-02 01:19:54 +0000</creation_ts>
          <short_desc>Introduce new concept of neutered</short_desc>
          <delta_ts>2013-11-13 22:09:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>File API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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>
          
          <blocked>23417</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Arun">arun</assigned_to>
          <cc>arun</cc>
    
    <cc>bugs</cc>
    
    <cc>glenn</cc>
    
    <cc>ian</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94136</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-02 01:19:54 +0000</bug_when>
    <thetext>The concept of neutered you import from HTML is used for structured clones. You should introduce your own concept here as neutering a Blob is unrelated to structured clones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94138</commentid>
    <comment_count>1</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2013-10-02 01:35:50 +0000</bug_when>
    <thetext>No, they&apos;re the same thing: a structured clone of a neutered Blob should throw DataCloneError, and the overall effect should be the same (making the object permanently inaccessible).

(It looks like actually making neutered Blobs throw during structured clone was forgotton, though.  I think I assumed this was done for all objects and didn&apos;t need special handling.  I&apos;ll file a separate bug.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94141</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-02 02:59:50 +0000</bug_when>
    <thetext>Hixie disagreed. That was bug 23385.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94142</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-02 03:05:25 +0000</bug_when>
    <thetext>And I think I agree with Ian. Transfering and neutering are tied.

This matters even more once https://github.com/dslomov-chromium/ecmascript-structured-clone makes its way into JavaScript as you wouldn&apos;t want to annotate a non-transferable with [[Transfer]].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94143</commentid>
    <comment_count>4</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-10-02 03:08:34 +0000</bug_when>
    <thetext>Why exactly?

Do you mean:

1. Coin a new method that is the equivalent of Blob.close() (say, hypothetically, Blob.shut())?

Or

2. Do you mean conceptually separate Blob.close() from structured clones in the prose?

The method name is intuitive, and the behavior is *almost* identical; the concept in HTML is analogous enough to borrow directly from.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94144</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-02 03:09:56 +0000</bug_when>
    <thetext>2 and as I outlined in comment 2 it is not. Ask Hixie if you need more background.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94145</commentid>
    <comment_count>6</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2013-10-02 03:27:03 +0000</bug_when>
    <thetext>&quot;Ask someone else for more info&quot; isn&apos;t really a reasonable response, when you&apos;re the one that opened the bug.

FYI, I already filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=23417.  Otherwise, I&apos;d reopen 23385, which was closed without explanation to people reading the bug.

If transferring a neutered Blob doesn&apos;t throw an exception, and results in a neutered Blob on the other side, then transferring a neutered ArrayBuffer needs to also not throw an exception and result in a neutered ArrayBuffer on the other side.  The effect of Blob.close() making the Blob inaccessible is logically equivalent to transfer making objects inaccessible.  It&apos;s strange and inconsistent for them to have different sets of side-effects.  Dead objects should either be clonable or not, whether they&apos;re an ArrayBuffer or a Blob.

Pulling out Blob.close() into a separate thing that&apos;s just like neutered but separate is the worst solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94338</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-04 21:47:39 +0000</bug_when>
    <thetext>You can&apos;t transfer a Blob. It&apos;s not Transferable. It doesn&apos;t need to be (it has no mutable state that can&apos;t be shared). The concept of &quot;neutering&quot; for the purposes of Tranferable objects doesn&apos;t apply to things that aren&apos;t Transferable.

There&apos;s no difficulty here. You just define your own prose term like &quot;neutered blob&quot; and use that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94342</commentid>
    <comment_count>8</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2013-10-04 21:56:07 +0000</bug_when>
    <thetext>There&apos;s nothing specific to Transferable about the effects of neutering.  Closed blobs want the exact same behavior--throwing an exception when the object is accessed or structured cloned--so it should use the same concept, not introduce a new concept that does the same thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94353</commentid>
    <comment_count>9</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-10-04 23:23:20 +0000</bug_when>
    <thetext>I agree with Glenn. No inconsistencies in the APIs, please.
Either you can transfer an object (and neuter it on the original side) or you cannot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94360</commentid>
    <comment_count>10</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2013-10-05 00:59:15 +0000</bug_when>
    <thetext>I do think that Blob should be a Transferable, and close() should be a Transferable method, since the user-visible behavior of transfer and the immediate-release of .close() are the same: the object is no longer accessible.  However, that&apos;s a separate issue, and my argument here is narrower: the concept of &quot;this object is dead and inaccessible&quot;, aka neutering, should be the same for both transfer and Blob.close() with identical effects (eg. throwing exceptions on access and structured clone), and transfer is simply one user of the neutering concept.

(Just clarifying a bit, so we don&apos;t tangent into the &quot;should Blobs be Transferable&quot; discussion, which is related but orthogonal to this.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94429</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-07 22:33:28 +0000</bug_when>
    <thetext>The concept of &quot;neutered&quot; in the Transferable sense is &quot;this can&apos;t be transferred any more&quot;. Anything that isn&apos;t Transferable is always in that state, so it doesn&apos;t make sense to talk about other things being neutered in the Transferable sense.

If File and Blob should be Transferable (meaning they can&apos;t be cloned, or that cloning them is an expensive operation), then that&apos;s a different matter. My understanding is that that is not the case currently.


I really don&apos;t understand the problem here. It&apos;s fine to be able to send the object into a different state. Lots of objects do this. WebSocket objects can get closed. Windows can get closed. XMLHttpRequest objects can go into several states. And so on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95645</commentid>
    <comment_count>12</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-10-31 22:59:07 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #11)
&gt; The concept of &quot;neutered&quot; in the Transferable sense is &quot;this can&apos;t be
&gt; transferred any more&quot;. Anything that isn&apos;t Transferable is always in that
&gt; state, so it doesn&apos;t make sense to talk about other things being neutered in
&gt; the Transferable sense.
&gt; 
&gt; If File and Blob should be Transferable (meaning they can&apos;t be cloned, or
&gt; that cloning them is an expensive operation), then that&apos;s a different
&gt; matter. My understanding is that that is not the case currently.
&gt; 
&gt; 
&gt; I really don&apos;t understand the problem here. It&apos;s fine to be able to send the
&gt; object into a different state. Lots of objects do this. WebSocket objects
&gt; can get closed. Windows can get closed. XMLHttpRequest objects can go into
&gt; several states. And so on.

Blobs aren&apos;t going to be Transferable -- they don&apos;t need to be.

You&apos;re right: it isn&apos;t a big deal to roll a new one. 
http://dev.w3.org/2006/webapi/FileAPI/#dfn-close

Marking this fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96259</commentid>
    <comment_count>13</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-13 22:09:05 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8279.
Check-in comment: Update terminology to match File API spec
http://html5.org/tools/web-apps-tracker?from=8278&amp;to=8279</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>