<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Improve binding of JSBuiltinConstructor classes"
   href="https://bugs.webkit.org/show_bug.cgi?id=149556">149556</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Improve binding of JSBuiltinConstructor classes
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebCore Misc.
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>youennf&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Following on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Remove the need for DOMClass in case of JSBuiltinConstructor WebIDL"
   href="show_bug.cgi?id=149522">bug 149522</a> discussion, we might want to improve the binding generator.

(In reply to <a href="show_bug.cgi?id=149556#c12">comment #12</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=149556#c11">comment #11</a>)
&gt; &gt; (In reply to <a href="show_bug.cgi?id=149556#c4">comment #4</a>)
&gt; &gt; &gt; (In reply to <a href="show_bug.cgi?id=149556#c3">comment #3</a>)
&gt; &gt; &gt; &gt; &gt; Source/WebCore/bindings/js/JSDOMWrapper.h:54
&gt; &gt; &gt; &gt; &gt; +    virtual ~DummyDOMClass() { }
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Not sure why this is needed. Do we need the class to seem polymorphic for
&gt; &gt; &gt; &gt; some reason?
&gt; &gt; &gt; 
&gt; &gt; &gt; This is required by RefCounted IIRC.
&gt; &gt; 
&gt; &gt; RefCounted itself definitely does *not* require that the class be
&gt; &gt; polymorphic so it doesn’t require a virtual destructor.
&gt; &gt; 
&gt; &gt; We need to make the destructor virtual if we are going to deref or delete
&gt; &gt; these objects in a polymorphic way, using a pointer to a base class. I think
&gt; &gt; you could revisit this and make the class both &quot;final&quot; and not define a
&gt; &gt; virtual destructor.
&gt; 
&gt; Thanks for the information.
&gt; 
&gt; &gt; 
&gt; &gt; You also talked about cleaning things up further so the class isn’t needed
&gt; &gt; at all; if you do that this won’t matter at all.
&gt; &gt; 
&gt; &gt; If we do need to keep this class, then we can do another trick for better
&gt; &gt; efficiency:
&gt; &gt; 
&gt; &gt;     class $className {
&gt; &gt;     public:
&gt; &gt;         static Ref&lt;$className&gt; create() { return adoptRef(singleton());
&gt; &gt; }\n&quot;); 
&gt; &gt;         static void ref() { }
&gt; &gt;         static void deref() { }
&gt; &gt;     private:
&gt; &gt;         static $className&amp; singleton() { static NeverDestroyed&lt;$className&gt;
&gt; &gt; singleton; return singleton; }
&gt; &gt;     };
&gt; &gt; 
&gt; &gt; No memory allocation, no incrementing and decrementing reference counts.
&gt; 
&gt; Yes, that is one approach I thought of.
&gt; It requires bypassing JSDOMGlobalObject wrapper cache, which is another
&gt; efficiency bonus.
&gt; 
&gt; We may also want to use a single singleton for all builtin classes.
&gt; 
&gt; To go further, we may want to skip generation of some needless code (toJS,
&gt; releaseImpl...).
&gt; 
&gt; Choice may be guided by the added complexity to the binding generator.
&gt; I plan to take some time on this once the JS builtin architecture is ready
&gt; to implement ReadableStream and WritableStream.</span ></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>