<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:mrobinson&#64;webkit.org" title="Martin Robinson &lt;mrobinson&#64;webkit.org&gt;"> <span class="fn">Martin Robinson</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Add API to WebKitWebsiteDataManager to handle cached data"
   href="https://bugs.webkit.org/show_bug.cgi?id=146589">bug 146589</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>mrobinson&#64;webkit.org
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Add API to WebKitWebsiteDataManager to handle cached data"
   href="https://bugs.webkit.org/show_bug.cgi?id=146589#c10">Comment # 10</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Add API to WebKitWebsiteDataManager to handle cached data"
   href="https://bugs.webkit.org/show_bug.cgi?id=146589">bug 146589</a>
              from <span class="vcard"><a class="email" href="mailto:mrobinson&#64;webkit.org" title="Martin Robinson &lt;mrobinson&#64;webkit.org&gt;"> <span class="fn">Martin Robinson</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=146589#c9">comment #9</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=146589#c7">comment #7</a>)
&gt; &gt; 
&gt; &gt; This is a common thing we do in the API just to make it more convenient to
&gt; &gt; use. The host and protocol are stored in WebCore::SecurityOrigin as String,
&gt; &gt; but all our APIs return always string in utf8 (like all other GNOME platform
&gt; &gt; APIs). If we return the converted string directly, the returned value should
&gt; &gt; be freed by the user. So, we cache the converted strings to be able to
&gt; &gt; return a const char *, and we do that only on demand, so if you never call
&gt; &gt; get_host we don't have a cached value for nothing.
&gt; 
&gt; Surely if we were to take a String s and return s.utf8().data(), that does
&gt; not need to be freed by the caller. It is a pointer to the CString's
&gt; internal CStringBuffer. And the CString has a reference-counted
&gt; CStringBuffer, so the data should be freed automatically when... er, when
&gt; the function returns. Ah, OK, so that would be bad. WebKit's strings are
&gt; confusing; I wish it hadn't taken a year for me to realize this.</span >


Yes, exactly. We have the CString members because the return value of utf8() is a temporary. :)</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>