<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:mcatanzaro&#64;igalia.com" title="Michael Catanzaro &lt;mcatanzaro&#64;igalia.com&gt;"> <span class="fn">Michael Catanzaro</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;">Attachment #257641 Flags</td>
           <td>review?
           </td>
           <td>review+
           </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#c13">Comment # 13</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:mcatanzaro&#64;igalia.com" title="Michael Catanzaro &lt;mcatanzaro&#64;igalia.com&gt;"> <span class="fn">Michael Catanzaro</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=257641&amp;action=diff" name="attach_257641" title="Updated patch">attachment 257641</a> <a href="attachment.cgi?id=257641&amp;action=edit" title="Updated patch">[details]</a></span>
Updated patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=257641&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=257641&amp;action=review</a>

You'll need to update all the Since tags, obviously.

And it'd be nice to see implementation in Ephy before landing, since it's not great to add API that no apps are using, but I guess the MB implementation is enough to show the API is sufficient for the task.

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp:46
&gt; +struct _WebKitSecurityOrigin {
&gt; +    _WebKitSecurityOrigin(WebCore::SecurityOrigin* coreSecurityOrigin)
&gt; +        : securityOrigin(coreSecurityOrigin)
&gt; +    {
&gt; +    }</span >

Why is it useful to create WebKitSecurityOrigin objects with a null WebCore::SecurityOrigin? I would have expected the constructor to receive a reference, and to use a Ref rather than RefPtr member variable.

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp:79
&gt; +WebCore::SecurityOrigin&amp; webkitSecurityOriginGetSecurityOrigin(WebKitSecurityOrigin* origin)
&gt; +{
&gt; +    ASSERT(origin);
&gt; +    return *origin-&gt;securityOrigin;
&gt; +}</span >

This ASSERT indicates to me that allowing null WebCore::SecurityOrigins is probably not appropriate.

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:652
&gt; + * Note that this is not supported for #WebKitWebContext&lt;!-- --&gt;s using
&gt; + * %WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS process model; an empty list will
&gt; + * always be returned in such case.</span >

Were we still using the soup cache in shared secondary process mode when you wrote this patch? Hopefully this comment is obsolete and should be removed?

<span class="quote">&gt; Tools/MiniBrowser/gtk/main.c:396
&gt; +    WebKitWebsiteDataManager* manager = webkit_web_context_get_website_data_manager(webkit_web_context_get_default());</span >

WebKitWebsiteDataManager *manager

<span class="quote">&gt; Tools/MiniBrowser/gtk/main.c:424
&gt; +    AboutDataRequest *dataRequest = aboutDataRequestNew(request);
&gt; +    WebKitWebsiteDataManager* manager = webkit_web_context_get_website_data_manager(webkit_web_context_get_default());</span >

WebKitWebsiteDataManager *manager

<span class="quote">&gt; Tools/MiniBrowser/gtk/main.c:493
&gt; +    WebKitUserContentManager *userContentManager = webkit_user_content_manager_new();</span >

Looks like it's leaked?

<span class="quote">&gt; Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:736
&gt; +    // Disk cache delays the storing of initial resources for 1 second to avoid
&gt; +    // affecting early page load. So, wait 1 second here to make sure resources
&gt; +    // have already been stored.
&gt; +    test-&gt;wait(1);</span >

This is unfortunate.

<span class="quote">&gt; Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:42
&gt; +WebViewTest::WebViewTest(WebKitProcessModel processModel)
&gt; +    : Test(processModel)
&gt; +    , m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(webkit_web_view_new_with_context(m_webContext.get()))))
&gt; +    , m_mainLoop(g_main_loop_new(nullptr, TRUE))
&gt;  {
&gt;      assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
&gt;      g_signal_connect(m_webView, &quot;web-process-crashed&quot;, G_CALLBACK(WebViewTest::webProcessCrashed), this);</span >

This is not good. Use delegating constructors to avoid the need to reimplement the constructor body. Make sure there is a constructor that can take both a WebKitUserContentManager and a WebKitProcessModel.</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>