<?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>230384</bug_id>
          
          <creation_ts>2021-09-16 20:24:06 -0700</creation_ts>
          <short_desc>Add MIME type and URL to WebCore::Model to allow processing different model types</short_desc>
          <delta_ts>2021-09-19 20:28:44 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Weinig">sam</reporter>
          <assigned_to name="Sam Weinig">sam</assigned_to>
          <cc>darin</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1794320</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-16 20:24:06 -0700</bug_when>
    <thetext>Add MIME type and URL to WebCore::Model to allow processing different model types</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794321</commentid>
    <comment_count>1</comment_count>
      <attachid>438435</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-16 20:25:55 -0700</bug_when>
    <thetext>Created attachment 438435
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794322</commentid>
    <comment_count>2</comment_count>
      <attachid>438435</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2021-09-16 20:27:08 -0700</bug_when>
    <thetext>Comment on attachment 438435
Patch

Don&apos;t know why it&apos;s not r?, but r+ because I have written exactly the same patch :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794323</commentid>
    <comment_count>3</comment_count>
      <attachid>438436</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-16 20:27:34 -0700</bug_when>
    <thetext>Created attachment 438436
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794455</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-17 08:56:41 -0700</bug_when>
    <thetext>(In reply to Tim Horton from comment #2)
&gt; Comment on attachment 438435 [details]
&gt; Patch
&gt; 
&gt; Don&apos;t know why it&apos;s not r?, but r+ because I have written exactly the same
&gt; patch :)

Was just waiting for the bots to run before marking r?. Marked now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794483</commentid>
    <comment_count>5</comment_count>
      <attachid>438436</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-09-17 10:10:24 -0700</bug_when>
    <thetext>Comment on attachment 438436
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438436&amp;action=review

&gt; Source/WebCore/platform/graphics/Model.h:33
&gt;  #include &lt;wtf/RefCounted.h&gt;
&gt; +#include &lt;wtf/URL.h&gt;
&gt; +#include &lt;wtf/text/WTFString.h&gt;

You can just include URL.h, don’t need the other two.

&gt; Source/WebCore/platform/graphics/Model.h:43
&gt; +    WEBCORE_EXPORT static Ref&lt;Model&gt; create(Ref&lt;SharedBuffer&gt;, String, URL);

Bold trailblazing to use String for a string that we are adopting, as opposed to the more obvious String&amp;&amp; and old school const String&amp;. Does seem simpler than String&amp;&amp; with no obvious disadvantage except for being less explicit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794488</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-09-17 10:18:15 -0700</bug_when>
    <thetext>Committed r282667 (241808@main): &lt;https://commits.webkit.org/241808@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438436.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794489</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-17 10:19:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/83246034&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794502</commentid>
    <comment_count>8</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-17 10:51:47 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #5)
&gt; Comment on attachment 438436 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=438436&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/platform/graphics/Model.h:33
&gt; &gt;  #include &lt;wtf/RefCounted.h&gt;
&gt; &gt; +#include &lt;wtf/URL.h&gt;
&gt; &gt; +#include &lt;wtf/text/WTFString.h&gt;
&gt; 
&gt; You can just include URL.h, don’t need the other two.

Will fix.

&gt; 
&gt; &gt; Source/WebCore/platform/graphics/Model.h:43
&gt; &gt; +    WEBCORE_EXPORT static Ref&lt;Model&gt; create(Ref&lt;SharedBuffer&gt;, String, URL);
&gt; 
&gt; Bold trailblazing to use String for a string that we are adopting, as
&gt; opposed to the more obvious String&amp;&amp; and old school const String&amp;. Does seem
&gt; simpler than String&amp;&amp; with no obvious disadvantage except for being less
&gt; explicit.

:). This is something I want to explore more deeply. I have a feeling we have a ton of unnecessary ref count churn, especially at the bindings layer, where using &quot;const String&amp;&quot; is the cause.

I think there are three cases to consider for String parameters:

1. The function always takes ownership of the string.
2. The function may or may not take ownership of the string.
3. The function never takes ownership of the string.

I believe (though I would have to re-convince myself to be sure) &quot;const String&amp;&quot; as a parameter should be reserved for case #2 (though in those cases, I would usually suggest overloading with one taking a &quot;const String&amp;&quot; and one taking a &quot;String&quot;, so the move case is still optimal). 

For #1, &quot;String&quot; should be used.
For #3, &quot;const String&amp;&quot; is fine, but we should probably be using StringView in most cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794572</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-09-17 13:11:16 -0700</bug_when>
    <thetext>(In reply to Sam Weinig from comment #8)
&gt; I think there are three cases to consider for String parameters:
&gt; 
&gt; 1. The function always takes ownership of the string.
&gt; 2. The function may or may not take ownership of the string.
&gt; 3. The function never takes ownership of the string.
&gt; 
&gt; I believe (though I would have to re-convince myself to be sure) &quot;const
&gt; String&amp;&quot; as a parameter should be reserved for case #2 (though in those
&gt; cases, I would usually suggest overloading with one taking a &quot;const String&amp;&quot;
&gt; and one taking a &quot;String&quot;, so the move case is still optimal). 
&gt; 
&gt; For #1, &quot;String&quot; should be used.
&gt; For #3, &quot;const String&amp;&quot; is fine, but we should probably be using StringView
&gt; in most cases.

Three things I can think of:

- Why is String better than String&amp;&amp;? We haven’t been consistent about this in WebKit before now and with other objects. I prefer the aesthetics of String. Are there benefits to writing String&amp;&amp; instead?

- There’s a variation on #3 worth considering. The function never takes ownership of the string, but does some operation that in turn requires a String, and so if passed a StringView that comes from a String will be less efficient than if it took a String.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794631</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-09-17 14:52:18 -0700</bug_when>
    <thetext>(sorry forgot the third thing)

- The function&apos;s interface should not say whether it takes ownership of the string or not, because it&apos;s an abstraction and should not expose implementation details. Unclear what is the best thing to do in that case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794679</commentid>
    <comment_count>11</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-17 16:26:04 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #9)
&gt; (In reply to Sam Weinig from comment #8)
&gt; &gt; I think there are three cases to consider for String parameters:
&gt; &gt; 
&gt; &gt; 1. The function always takes ownership of the string.
&gt; &gt; 2. The function may or may not take ownership of the string.
&gt; &gt; 3. The function never takes ownership of the string.
&gt; &gt; 
&gt; &gt; I believe (though I would have to re-convince myself to be sure) &quot;const
&gt; &gt; String&amp;&quot; as a parameter should be reserved for case #2 (though in those
&gt; &gt; cases, I would usually suggest overloading with one taking a &quot;const String&amp;&quot;
&gt; &gt; and one taking a &quot;String&quot;, so the move case is still optimal). 
&gt; &gt; 
&gt; &gt; For #1, &quot;String&quot; should be used.
&gt; &gt; For #3, &quot;const String&amp;&quot; is fine, but we should probably be using StringView
&gt; &gt; in most cases.
&gt; 
&gt; Three things I can think of:
&gt; 
&gt; - Why is String better than String&amp;&amp;? We haven’t been consistent about this
&gt; in WebKit before now and with other objects. I prefer the aesthetics of
&gt; String. Are there benefits to writing String&amp;&amp; instead?

String is better than String&amp;&amp; because it will work for both lvalues and rvalues, where as the latter will only worth with rvalues.

As a concrete example. The function

    static void foo(String&amp;&amp; bar)
    {
        (void)bar;
    }


with a caller:

    String string = &quot;hello&quot;;
    foo(string);

will fail to compile with the following error:

... note: candidate function not viable: expects an rvalue for 1st argument
static void foo(String&amp;&amp; bar)

You would have to call it like:

    String string = &quot;hello&quot;;
    foo(WTFMove(string));

which might not be what you want to do.

&gt; - There’s a variation on #3 worth considering. The function never takes
&gt; ownership of the string, but does some operation that in turn requires a
&gt; String, and so if passed a StringView that comes from a String will be less
&gt; efficient than if it took a String.

Hm, I can&apos;t think of a case when this would happen and it wasn&apos;t because ownership of a String was needed in some form, but I could totally be wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794688</commentid>
    <comment_count>12</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-17 16:35:58 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #10)
&gt; (sorry forgot the third thing)
&gt; 
&gt; - The function&apos;s interface should not say whether it takes ownership of the
&gt; string or not, because it&apos;s an abstraction and should not expose
&gt; implementation details. Unclear what is the best thing to do in that case.

I mean, I agree, but if we take that to the extreme, we would want to use either &quot;foo(String)&quot; or foo(const String&amp;)&quot; everywhere. However, each has its downsides.

&quot;foo(String)&quot; will always cause a ref, unless you explicitly WTFMove() (or otherwise rvalue your way), in which case, you can avoid a ref.

&quot;foo(const String&amp;)&quot; allows the implementation decide if it needs to ref, but doesn&apos;t allow the caller to &quot;move&quot; the object into it.

While sticking to a principle would be nice, I think the efficiency gained by being cognizant of lifetime when choosing parameter types is worth it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794696</commentid>
    <comment_count>13</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-09-17 16:50:26 -0700</bug_when>
    <thetext>(In reply to Sam Weinig from comment #11)
&gt; You would have to call it like:
&gt; 
&gt;     String string = &quot;hello&quot;;
&gt;     foo(WTFMove(string));
&gt; 
&gt; which might not be what you want to do.

Or like this:

    String string = &quot;hello&quot;;
    foo(String { string });

I’m not saying it’s elegant, but you don’t *have* to move the value in.

&gt; &gt; - There’s a variation on #3 worth considering. The function never takes
&gt; &gt; ownership of the string, but does some operation that in turn requires a
&gt; &gt; String, and so if passed a StringView that comes from a String will be less
&gt; &gt; efficient than if it took a String.
&gt; 
&gt; Hm, I can&apos;t think of a case when this would happen and it wasn&apos;t because
&gt; ownership of a String was needed in some form, but I could totally be wrong.

The case where this happens without ownership is for a function that looks something up in a hash table that uses a String for entire key or part of the key. We don’t currently support using a StringView for such hash table lookups. String caches the hash across any number of multiple calls to compute it, which StringView will not do. We could add convenient key translation and would lose that optimization.

Also worth noting that if the function wants to call any function that currently takes a const String&amp; or String, but should take a StringView, we end up being kind of slow. We won&apos;t be converting the entire code base all at once. This means we&apos;d have to do things bottom-up?

Any function that makes an AtomString or Identifier, I suppose means it &quot;may or may not take ownership&quot;, which is a sort of irritating subtlety.

(In reply to Sam Weinig from comment #12)
&gt; (In reply to Darin Adler from comment #10)
&gt; &gt; - The function&apos;s interface should not say whether it takes ownership of the
&gt; &gt; string or not, because it&apos;s an abstraction and should not expose
&gt; &gt; implementation details. Unclear what is the best thing to do in that case.
&gt; 
&gt; I mean, I agree, but if we take that to the extreme, we would want to use
&gt; either &quot;foo(String)&quot; or foo(const String&amp;)&quot; everywhere. However, each has
&gt; its downsides.

I just meant that we should consider when this is the primary concern, not that every function needs to be abstract.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794964</commentid>
    <comment_count>14</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-09-19 20:28:44 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #13)
&gt; (In reply to Sam Weinig from comment #11)
&gt; &gt; You would have to call it like:
&gt; &gt; 
&gt; &gt;     String string = &quot;hello&quot;;
&gt; &gt;     foo(WTFMove(string));
&gt; &gt; 
&gt; &gt; which might not be what you want to do.
&gt; 
&gt; Or like this:
&gt; 
&gt;     String string = &quot;hello&quot;;
&gt;     foo(String { string });
&gt; 
&gt; I’m not saying it’s elegant, but you don’t *have* to move the value in.
&gt; 
&gt; &gt; &gt; - There’s a variation on #3 worth considering. The function never takes
&gt; &gt; &gt; ownership of the string, but does some operation that in turn requires a
&gt; &gt; &gt; String, and so if passed a StringView that comes from a String will be less
&gt; &gt; &gt; efficient than if it took a String.
&gt; &gt; 
&gt; &gt; Hm, I can&apos;t think of a case when this would happen and it wasn&apos;t because
&gt; &gt; ownership of a String was needed in some form, but I could totally be wrong.
&gt; 
&gt; The case where this happens without ownership is for a function that looks
&gt; something up in a hash table that uses a String for entire key or part of
&gt; the key. We don’t currently support using a StringView for such hash table
&gt; lookups. String caches the hash across any number of multiple calls to
&gt; compute it, which StringView will not do. We could add convenient key
&gt; translation and would lose that optimization.
&gt; 

I don&apos;t feel strongly about the StringView thing, but this makes me think we should consider adding a cache of the string hash to the StringView, and populate it when creating a StringView from a String (and lazily populate it when creating a StringView in another way.)

There may be a good reason we haven&apos;t done that.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>438435</attachid>
            <date>2021-09-16 20:25:55 -0700</date>
            <delta_ts>2021-09-16 20:27:32 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-230384-20210916202554.patch</filename>
            <type>text/plain</type>
            <size>4882</size>
            <attacher name="Sam Weinig">sam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI4MjYzMSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDI0IEBACisyMDIxLTA5LTE2ICBTYW0gV2Vp
bmlnICA8d2VpbmlnQGFwcGxlLmNvbT4KKworICAgICAgICBBZGQgTUlNRSB0eXBlIGFuZCBVUkwg
dG8gV2ViQ29yZTo6TW9kZWwgdG8gYWxsb3cgcHJvY2Vzc2luZyBkaWZmZXJlbnQgbW9kZWwgdHlw
ZXMKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIzMDM4
NAorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEFkZHMg
TUlNRSB0eXBlIGFuZCBVUkwgdG8gV2ViQ29yZTo6TW9kZWwgdG8gYWxsb3cgcHJvY2Vzc2luZyBk
aWZmZXJlbnQgbW9kZWwgdHlwZXMuCisgICAgICAgIFRoaXMgY2hhbmdlIGRvZXMgbm90IHRha2Ug
YWR2YW50YXZlIG9mIHRoZW0gKGFuZCB3ZSBzdGlsbCBvbmx5IHN1cHBvcnQgb25lIHR5cGUpCisg
ICAgICA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DsKKyAgICBkZWNvZGVyID4+IHVybDsKKyAgICBpZiAoIXVybCkK
KyAgICAgICAgcmV0dXJuIG51bGxwdHI7CisKKyAgICByZXR1cm4gTW9kZWw6OmNyZWF0ZShTaGFy
ZWRCdWZmZXI6OmNyZWF0ZShXVEZNb3ZlKGRhdGEpKSwgV1RGTW92ZSgqbWltZVR5cGUpLCBXVEZN
b3ZlKCp1cmwpKTsKIH0KIAogV0VCQ09SRV9FWFBPUlQgV1RGOjpUZXh0U3RyZWFtJiBvcGVyYXRv
cjw8KFdURjo6VGV4dFN0cmVhbSYsIGNvbnN0IE1vZGVsJik7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>438436</attachid>
            <date>2021-09-16 20:27:34 -0700</date>
            <delta_ts>2021-09-17 10:18:16 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-230384-20210916202733.patch</filename>
            <type>text/plain</type>
            <size>4939</size>
            <attacher name="Sam Weinig">sam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI4MjYzMSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDI0IEBACisyMDIxLTA5LTE2ICBTYW0gV2Vp
bmlnICA8d2VpbmlnQGFwcGxlLmNvbT4KKworICAgICAgICBBZGQgTUlNRSB0eXBlIGFuZCBVUkwg
dG8gV2ViQ29yZTo6TW9kZWwgdG8gYWxsb3cgcHJvY2Vzc2luZyBkaWZmZXJlbnQgbW9kZWwgdHlw
ZXMKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY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