<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Add API to WebKitWebsiteDataManager to handle website data"
   href="https://bugs.webkit.org/show_bug.cgi?id=146589#c21">Comment # 21</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Add API to WebKitWebsiteDataManager to handle website data"
   href="https://bugs.webkit.org/show_bug.cgi?id=146589">bug 146589</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=146589#c19">comment #19</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=299429&amp;action=diff" name="attach_299429" title="New patch">attachment 299429</a> <a href="attachment.cgi?id=299429&amp;action=edit" title="New patch">[details]</a></span>
&gt; New patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=299429&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=299429&amp;action=review</a>
&gt; 
&gt; I like the API.
&gt; 
&gt; I would slightly prefer slightly longer but more specific function names:
&gt; webkit_website_data_manager_fetch_data, _remove_data, _clear_data. What do
&gt; you think about that?</span >

I thought about that but sounded redundant to me, this is data manager.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:38
&gt; &gt; + * A website is normally a set of URLs grouped by domain name using the public suffix list.
&gt; 
&gt; Why is the public suffix list used? Keeping in mind that libsoup's public
&gt; suffix list is often years out of date and that we should almost never be
&gt; using it. It's my primary concern with this patch.</span >

Because that's how the internal WebKit2 API works. My guess is that you normally want to remove the data for a website, no matter how many url forms that website has. It makes everything easier to handle.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:39
&gt; &gt; + * You can ge the website name, which is usually the domain, with webkit_website_data_get_name().
&gt; 
&gt; ge -&gt; get
&gt; 
&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:42
&gt; &gt; + * A website can store different types of data in the client side. #WebKitWebsiteDataTypes is an enum containing
&gt; 
&gt; Leave a blank line between these paragraphs.</span >

Ok.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:43
&gt; &gt; + * all the possible data types, use webkit_website_data_get_types() to get the bitmask of data types.
&gt; 
&gt; Change the comma to a semicolon</span >

Ok.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:175
&gt; &gt; +        if (websiteData-&gt;record.displayName == &quot;Local documents on your computer&quot;)
&gt; 
&gt; That's way too fragile; it's going to break whenever someone decides to
&gt; change the display name. There has got to be a better way to check if the
&gt; record represents a local file. How about checking if the protocol of the
&gt; security origin is &quot;file&quot;?</span >

Yes, I agree, I did it this way to avoid a GTK ifdef in displayNameForLocalFiles(). Fortunately unit tests will catch it if it's changed.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:176
&gt; &gt; +            websiteData-&gt;displayName = _(&quot;Local files&quot;);
&gt; 
&gt; You forgot to update POTFILES.in.</span >

As always :-P

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp:188
&gt; &gt; + * types actually found, not the types queried with webkit_website_data_manager_fetch().
&gt; 
&gt; &quot;actually present&quot;?</span >

Sure.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:521
&gt; &gt; + * &#64;user_data: (closure): the data to pass to callback function
&gt; 
&gt; to the callback function</span >

Ok.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:579
&gt; &gt; + * Use webkit_website_data_manager_clear() if you want to remove the website data for all sites.
&gt; 
&gt; sites -&gt; websites (this is the only place you wrote &quot;sites&quot; and it's nice to
&gt; use consistent terminology)</span >

Agree.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:639
&gt; &gt; + * Asynchronously clear the website data of the given &#64;types modified since the given &#64;timespan.
&gt; 
&gt; This is a bit confusing. Let's say: &quot;modified in the past &#64;timespam
&gt; microseconds&quot;</span >

I avoided using microseconds detail, it's a GTimeSpan and not a guint64 for that reason.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataPrivate.h:2
&gt; &gt; + * Copyright (C) 2016 Igalia S.L.
&gt; 
&gt; Happy new years!</span >

:-)

<span class="quote">&gt; &gt; Tools/MiniBrowser/gtk/main.c:272
&gt; &gt; +    if (webkit_website_data_manager_remove_finish(manager, result, NULL))
&gt; &gt; +        webkit_web_view_reload(webkit_uri_scheme_request_get_web_view(dataRequest-&gt;request));
&gt; 
&gt; Why reloading?</span >

To update the data and check that whatever you removed is no longer listed.

<span class="quote">&gt; &gt; Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebsiteData.cpp:282
&gt; &gt; +    GList removeList = { itemList-&gt;data, nullptr, nullptr };
&gt; 
&gt; I think GList removeList = g_list_prepend(nullptr, data) would be a much
&gt; clearer way to write this. You might recall teaching me that recently. ;)
&gt; (Note it's duplicated in several places below.)</span >

Then you would be heap allocating just to store a single item list. This is a trick for single item lists.</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>