<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212626] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212626">212626</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-20 00:30:50 -0800 (Mon, 20 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/212345">r212345</a>): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
https://bugs.webkit.org/show_bug.cgi?id=168375

Reviewed by Alex Christensen.

Source/WebCore:

Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
set.

* platform/network/NetworkStorageSession.h:
* platform/network/soup/CookieStorageSoup.cpp:
(WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
(WebCore::stopObservingCookieChanges): Ditto.
(WebCore::cookieChangeCallbackMap): Deleted.
(WebCore::soupCookiesChanged): Deleted.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
(WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
(WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
(WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
(WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
(WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.

Source/WebKit2:

Simplify the cookies change notification. The current approach of the UI process telling the network process
when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
Everything would be a lot simpler if the network process always monitored cookies.

* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
(WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
(webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
(webkitCookieManagerCreate): Set the cookies observer callback.
(webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
changes, the network process deals with that now.
(webkitCookieManagerDispose): Deleted.
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
process.
(WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
(WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
nullptr is given.
* UIProcess/WebCookieManagerProxy.h:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
(WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
WebFrameNetworkingContext since it doesn't belong there.
(WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
NetworkStorageSession.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkNetworkStorageSessionh">trunk/Source/WebCore/platform/network/NetworkStorageSession.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupCookieStorageSoupcpp">trunk/Source/WebCore/platform/network/soup/CookieStorageSoup.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupNetworkStorageSessionSoupcpp">trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesssoupNetworkSessionSoupcpp">trunk/Source/WebKit2/NetworkProcess/soup/NetworkSessionSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitCookieManagercpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebCookieManagerProxycpp">trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebCookieManagerProxyh">trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessCookiesWebCookieManagercpp">trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessCookiesWebCookieManagerh">trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessCookiessoupWebCookieManagerSoupcpp">trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportsoupWebFrameNetworkingContextcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportsoupWebFrameNetworkingContexth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebCore/ChangeLog        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2017-02-20  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
+        https://bugs.webkit.org/show_bug.cgi?id=168375
+
+        Reviewed by Alex Christensen.
+
+        Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
+        cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
+        session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
+        set.
+
+        * platform/network/NetworkStorageSession.h:
+        * platform/network/soup/CookieStorageSoup.cpp:
+        (WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
+        (WebCore::stopObservingCookieChanges): Ditto.
+        (WebCore::cookieChangeCallbackMap): Deleted.
+        (WebCore::soupCookiesChanged): Deleted.
+        * platform/network/soup/NetworkStorageSessionSoup.cpp:
+        (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
+        (WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
+        (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
+        (WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
+        (WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
+        (WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
+        needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
+        (WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.
+
</ins><span class="cx"> 2017-02-19  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         onbeforeunload event return value coercion is not per-spec
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkNetworkStorageSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/NetworkStorageSession.h (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/NetworkStorageSession.h        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebCore/platform/network/NetworkStorageSession.h        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -74,6 +74,8 @@
</span><span class="cx">     SoupNetworkSession* soupNetworkSession() const { return m_session.get(); };
</span><span class="cx">     SoupNetworkSession&amp; getOrCreateSoupNetworkSession() const;
</span><span class="cx">     SoupCookieJar* cookieStorage() const;
</span><ins>+    void setCookieStorage(SoupCookieJar*);
+    void setCookieObserverHandler(Function&lt;void ()&gt;&amp;&amp;);
</ins><span class="cx">     void getCredentialFromPersistentStorage(const ProtectionSpace&amp;, Function&lt;void (Credential&amp;&amp;)&gt; completionHandler);
</span><span class="cx">     void saveCredentialToPersistentStorage(const ProtectionSpace&amp;, const Credential&amp;);
</span><span class="cx"> #else
</span><span class="lines">@@ -90,8 +92,11 @@
</span><span class="cx"> #if PLATFORM(COCOA) || USE(CFURLCONNECTION)
</span><span class="cx">     RetainPtr&lt;CFURLStorageSessionRef&gt; m_platformSession;
</span><span class="cx"> #elif USE(SOUP)
</span><ins>+    static void cookiesDidChange(NetworkStorageSession*);
+
</ins><span class="cx">     mutable std::unique_ptr&lt;SoupNetworkSession&gt; m_session;
</span><del>-    mutable GRefPtr&lt;SoupCookieJar&gt; m_cookieStorage;
</del><ins>+    GRefPtr&lt;SoupCookieJar&gt; m_cookieStorage;
+    Function&lt;void ()&gt; m_cookieObserverHandler;
</ins><span class="cx"> #if USE(LIBSECRET)
</span><span class="cx">     Function&lt;void (Credential&amp;&amp;)&gt; m_persisentStorageCompletionHandler;
</span><span class="cx">     GRefPtr&lt;GCancellable&gt; m_persisentStorageCancellable;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupCookieStorageSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/CookieStorageSoup.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/CookieStorageSoup.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebCore/platform/network/soup/CookieStorageSoup.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -21,41 +21,18 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx"> 
</span><del>-#include &quot;NetworkStorageSession.h&quot;
-#include &lt;libsoup/soup.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/NeverDestroyed.h&gt;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static HashMap&lt;SoupCookieJar*, std::function&lt;void ()&gt;&gt;&amp; cookieChangeCallbackMap()
</del><ins>+void startObservingCookieChanges(const NetworkStorageSession&amp;, std::function&lt;void ()&gt;&amp;&amp;)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashMap&lt;SoupCookieJar*, std::function&lt;void ()&gt;&gt;&gt; map;
-    return map;
</del><ins>+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void soupCookiesChanged(SoupCookieJar* jar)
</del><ins>+void stopObservingCookieChanges(const NetworkStorageSession&amp;)
</ins><span class="cx"> {
</span><del>-    if (auto callback = cookieChangeCallbackMap().get(jar))
-        callback();
</del><ins>+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void startObservingCookieChanges(const NetworkStorageSession&amp; storageSession, std::function&lt;void ()&gt;&amp;&amp; callback)
-{
-    auto* jar = storageSession.cookieStorage();
-    ASSERT(!cookieChangeCallbackMap().contains(jar));
-    cookieChangeCallbackMap().add(jar, WTFMove(callback));
-    g_signal_connect(jar, &quot;changed&quot;, G_CALLBACK(soupCookiesChanged), nullptr);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void stopObservingCookieChanges(const NetworkStorageSession&amp; storageSession)
-{
-    auto* jar = storageSession.cookieStorage();
-    ASSERT(cookieChangeCallbackMap().contains(jar));
-    cookieChangeCallbackMap().remove(jar);
-    g_signal_handlers_disconnect_by_func(jar, reinterpret_cast&lt;void*&gt;(soupCookiesChanged), nullptr);
-}
-
-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupNetworkStorageSessionSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -51,10 +51,13 @@
</span><span class="cx">     : m_sessionID(sessionID)
</span><span class="cx">     , m_session(WTFMove(session))
</span><span class="cx"> {
</span><ins>+    setCookieStorage(m_session ? m_session-&gt;cookieJar() : nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkStorageSession::~NetworkStorageSession()
</span><span class="cx"> {
</span><ins>+    g_signal_handlers_disconnect_matched(m_cookieStorage.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+
</ins><span class="cx"> #if USE(LIBSECRET)
</span><span class="cx">     g_cancellable_cancel(m_persisentStorageCancellable.get());
</span><span class="cx"> #endif
</span><span class="lines">@@ -89,25 +92,44 @@
</span><span class="cx"> SoupNetworkSession&amp; NetworkStorageSession::getOrCreateSoupNetworkSession() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_session)
</span><del>-        m_session = std::make_unique&lt;SoupNetworkSession&gt;(cookieStorage());
</del><ins>+        m_session = std::make_unique&lt;SoupNetworkSession&gt;(m_cookieStorage.get());
</ins><span class="cx">     return *m_session;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkStorageSession::cookiesDidChange(NetworkStorageSession* session)
+{
+    if (session-&gt;m_cookieObserverHandler)
+        session-&gt;m_cookieObserverHandler();
+}
+
</ins><span class="cx"> SoupCookieJar* NetworkStorageSession::cookieStorage() const
</span><span class="cx"> {
</span><del>-    if (m_session) {
-        m_cookieStorage = nullptr;
-        ASSERT(m_session-&gt;cookieJar());
-        return m_session-&gt;cookieJar();
-    }
</del><ins>+    RELEASE_ASSERT(!m_session || m_session-&gt;cookieJar() == m_cookieStorage.get());
+    return m_cookieStorage.get();
+}
</ins><span class="cx"> 
</span><del>-    if (!m_cookieStorage) {
</del><ins>+void NetworkStorageSession::setCookieStorage(SoupCookieJar* jar)
+{
+    if (m_cookieStorage)
+        g_signal_handlers_disconnect_matched(m_cookieStorage.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+
+    // We always have a valid cookieStorage.
+    if (jar)
+        m_cookieStorage = jar;
+    else {
</ins><span class="cx">         m_cookieStorage = adoptGRef(soup_cookie_jar_new());
</span><span class="cx">         soup_cookie_jar_set_accept_policy(m_cookieStorage.get(), SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY);
</span><span class="cx">     }
</span><del>-    return m_cookieStorage.get();
</del><ins>+    g_signal_connect_swapped(m_cookieStorage.get(), &quot;changed&quot;, G_CALLBACK(cookiesDidChange), this);
+    if (m_session &amp;&amp; m_session-&gt;cookieJar() != m_cookieStorage.get())
+        m_session-&gt;setCookieJar(m_cookieStorage.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkStorageSession::setCookieObserverHandler(Function&lt;void ()&gt;&amp;&amp; handler)
+{
+    m_cookieObserverHandler = WTFMove(handler);
+}
+
</ins><span class="cx"> #if USE(LIBSECRET)
</span><span class="cx"> static const char* schemeFromProtectionSpaceServerType(ProtectionSpaceServerType serverType)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/ChangeLog        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2017-02-20  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
+        https://bugs.webkit.org/show_bug.cgi?id=168375
+
+        Reviewed by Alex Christensen.
+
+        Simplify the cookies change notification. The current approach of the UI process telling the network process
+        when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
+        observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
+        Everything would be a lot simpler if the network process always monitored cookies.
+
+        * NetworkProcess/soup/NetworkSessionSoup.cpp:
+        (WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
+        (WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
+        * UIProcess/API/gtk/WebKitCookieManager.cpp:
+        (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
+        (webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
+        (webkitCookieManagerCreate): Set the cookies observer callback.
+        (webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
+        changes, the network process deals with that now.
+        (webkitCookieManagerDispose): Deleted.
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
+        explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
+        process.
+        (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
+        (WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
+        nullptr is given.
+        * UIProcess/WebCookieManagerProxy.h:
+        * WebProcess/Cookies/WebCookieManager.cpp:
+        (WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
+        (WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
+        * WebProcess/Cookies/WebCookieManager.h:
+        * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
+        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
+        WebFrameNetworkingContext since it doesn't belong there.
+        (WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
+        NetworkStorageSession.
+        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
+        (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
+        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
+
</ins><span class="cx"> 2017-02-19  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] Support termination of unresponsive WebContent processes that are in the background
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesssoupNetworkSessionSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/soup/NetworkSessionSoup.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/soup/NetworkSessionSoup.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/NetworkProcess/soup/NetworkSessionSoup.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;NetworkSessionSoup.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;NetworkProcess.h&quot;
+#include &quot;WebCookieManager.h&quot;
</ins><span class="cx"> #include &lt;WebCore/NetworkStorageSession.h&gt;
</span><span class="cx"> #include &lt;WebCore/SoupNetworkSession.h&gt;
</span><span class="cx"> #include &lt;libsoup/soup.h&gt;
</span><span class="lines">@@ -37,10 +39,15 @@
</span><span class="cx"> NetworkSessionSoup::NetworkSessionSoup(SessionID sessionID)
</span><span class="cx">     : NetworkSession(sessionID)
</span><span class="cx"> {
</span><ins>+    networkStorageSession().setCookieObserverHandler([this] {
+        NetworkProcess::singleton().supplement&lt;WebCookieManager&gt;()-&gt;notifyCookiesDidChange(m_sessionID);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkSessionSoup::~NetworkSessionSoup()
</span><span class="cx"> {
</span><ins>+    if (auto* storageSession = NetworkStorageSession::storageSession(m_sessionID))
+        storageSession-&gt;setCookieObserverHandler(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SoupSession* NetworkSessionSoup::soupSession() const
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitCookieManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -51,6 +51,13 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct _WebKitCookieManagerPrivate {
</span><ins>+    ~_WebKitCookieManagerPrivate()
+    {
+        auto sessionID = webkitWebsiteDataManagerGetDataStore(dataManager).websiteDataStore().sessionID();
+        for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(dataManager))
+            processPool-&gt;supplement&lt;WebCookieManagerProxy&gt;()-&gt;setCookieObserverCallback(sessionID, nullptr);
+    }
+
</ins><span class="cx">     WebKitWebsiteDataManager* dataManager;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -101,24 +108,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void webkitCookieManagerDispose(GObject* object)
-{
-    WebKitCookieManager* manager = WEBKIT_COOKIE_MANAGER(object);
-    if (manager-&gt;priv-&gt;dataManager) {
-        auto sessionID = webkitWebsiteDataManagerGetDataStore(manager-&gt;priv-&gt;dataManager).websiteDataStore().sessionID();
-        for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager-&gt;priv-&gt;dataManager))
-            processPool-&gt;supplement&lt;WebCookieManagerProxy&gt;()-&gt;stopObservingCookieChanges(sessionID);
-
-        manager-&gt;priv-&gt;dataManager = nullptr;
-    }
-
-    G_OBJECT_CLASS(webkit_cookie_manager_parent_class)-&gt;dispose(object);
-}
-
</del><span class="cx"> static void webkit_cookie_manager_class_init(WebKitCookieManagerClass* findClass)
</span><span class="cx"> {
</span><span class="cx">     GObjectClass* gObjectClass = G_OBJECT_CLASS(findClass);
</span><del>-    gObjectClass-&gt;dispose = webkitCookieManagerDispose;
</del><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * WebKitCookieManager::changed:
</span><span class="lines">@@ -141,7 +133,7 @@
</span><span class="cx">     manager-&gt;priv-&gt;dataManager = dataManager;
</span><span class="cx">     auto sessionID = webkitWebsiteDataManagerGetDataStore(manager-&gt;priv-&gt;dataManager).websiteDataStore().sessionID();
</span><span class="cx">     for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager-&gt;priv-&gt;dataManager)) {
</span><del>-        processPool-&gt;supplement&lt;WebCookieManagerProxy&gt;()-&gt;startObservingCookieChanges(sessionID, [manager] {
</del><ins>+        processPool-&gt;supplement&lt;WebCookieManagerProxy&gt;()-&gt;setCookieObserverCallback(sessionID, [manager] {
</ins><span class="cx">             g_signal_emit(manager, signals[CHANGED], 0);
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="lines">@@ -170,15 +162,8 @@
</span><span class="cx">     g_return_if_fail(filename);
</span><span class="cx">     g_return_if_fail(!webkit_website_data_manager_is_ephemeral(manager-&gt;priv-&gt;dataManager));
</span><span class="cx"> 
</span><del>-    for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager-&gt;priv-&gt;dataManager)) {
-        auto* cookieManager = processPool-&gt;supplement&lt;WebCookieManagerProxy&gt;();
-
-        cookieManager-&gt;stopObservingCookieChanges(WebCore::SessionID::defaultSessionID());
-        cookieManager-&gt;setCookiePersistentStorage(String::fromUTF8(filename), toSoupCookiePersistentStorageType(storage));
-        cookieManager-&gt;startObservingCookieChanges(WebCore::SessionID::defaultSessionID(), [manager] {
-            g_signal_emit(manager, signals[CHANGED], 0);
-        });
-    }
</del><ins>+    for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager-&gt;priv-&gt;dataManager))
+        processPool-&gt;supplement&lt;WebCookieManagerProxy&gt;()-&gt;setCookiePersistentStorage(String::fromUTF8(filename), toSoupCookiePersistentStorageType(storage));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebCookieManagerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -133,19 +133,24 @@
</span><span class="cx">     processPool()-&gt;sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::AddCookie(sessionID, cookie, hostname));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCookieManagerProxy::startObservingCookieChanges(WebCore::SessionID sessionID, std::function&lt;void ()&gt;&amp;&amp; callback)
</del><ins>+void WebCookieManagerProxy::startObservingCookieChanges(WebCore::SessionID sessionID)
</ins><span class="cx"> {
</span><del>-    if (callback)
-        m_cookieObservers.set(sessionID, WTFMove(callback));
</del><span class="cx">     processPool()-&gt;sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StartObservingCookieChanges(sessionID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebCookieManagerProxy::stopObservingCookieChanges(WebCore::SessionID sessionID)
</span><span class="cx"> {
</span><del>-    m_cookieObservers.remove(sessionID);
</del><span class="cx">     processPool()-&gt;sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StopObservingCookieChanges(sessionID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebCookieManagerProxy::setCookieObserverCallback(WebCore::SessionID sessionID, std::function&lt;void ()&gt;&amp;&amp; callback)
+{
+    if (callback)
+        m_cookieObservers.set(sessionID, WTFMove(callback));
+    else
+        m_cookieObservers.remove(sessionID);
+}
+
</ins><span class="cx"> void WebCookieManagerProxy::cookiesDidChange(WebCore::SessionID sessionID)
</span><span class="cx"> {
</span><span class="cx">     m_client.cookiesDidChange(this);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebCookieManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -74,9 +74,11 @@
</span><span class="cx">     void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy);
</span><span class="cx">     void getHTTPCookieAcceptPolicy(std::function&lt;void (HTTPCookieAcceptPolicy, CallbackBase::Error)&gt;);
</span><span class="cx"> 
</span><del>-    void startObservingCookieChanges(WebCore::SessionID, std::function&lt;void ()&gt;&amp;&amp; = nullptr);
</del><ins>+    void startObservingCookieChanges(WebCore::SessionID);
</ins><span class="cx">     void stopObservingCookieChanges(WebCore::SessionID);
</span><span class="cx"> 
</span><ins>+    void setCookieObserverCallback(WebCore::SessionID, std::function&lt;void ()&gt;&amp;&amp;);
+
</ins><span class="cx"> #if USE(SOUP)
</span><span class="cx">     void setCookiePersistentStorage(const String&amp; storagePath, uint32_t storageType);
</span><span class="cx">     void getCookiePersistentStorage(String&amp; storagePath, uint32_t&amp; storageType) const;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessCookiesWebCookieManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -89,12 +89,17 @@
</span><span class="cx">         WebCore::addCookie(*storageSession, URL(URL(), hostname), cookie);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebCookieManager::notifyCookiesDidChange(SessionID sessionID)
+{
+    ASSERT(RunLoop::isMain());
+    m_process-&gt;send(Messages::WebCookieManagerProxy::CookiesDidChange(sessionID), 0);
+}
+
</ins><span class="cx"> void WebCookieManager::startObservingCookieChanges(SessionID sessionID)
</span><span class="cx"> {
</span><span class="cx">     if (auto* storageSession = NetworkStorageSession::storageSession(sessionID)) {
</span><span class="cx">         WebCore::startObservingCookieChanges(*storageSession, [this, sessionID] {
</span><del>-            ASSERT(RunLoop::isMain());
-            m_process-&gt;send(Messages::WebCookieManagerProxy::CookiesDidChange(sessionID), 0);
</del><ins>+            notifyCookiesDidChange(sessionID);
</ins><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessCookiesWebCookieManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx">     void setCookiePersistentStorage(const String&amp; storagePath, uint32_t storageType);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void notifyCookiesDidChange(WebCore::SessionID);
+
</ins><span class="cx"> private:
</span><span class="cx">     // IPC::MessageReceiver
</span><span class="cx">     void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessCookiessoupWebCookieManagerSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include &quot;WebCookieManager.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ChildProcess.h&quot;
</span><del>-#include &quot;WebFrameNetworkingContext.h&quot;
</del><span class="cx"> #include &quot;WebKitSoupCookieJarSqlite.h&quot;
</span><span class="cx"> #include &lt;WebCore/NetworkStorageSession.h&gt;
</span><span class="cx"> #include &lt;WebCore/SoupNetworkSession.h&gt;
</span><span class="lines">@@ -41,7 +40,22 @@
</span><span class="cx"> 
</span><span class="cx"> void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy)
</span><span class="cx"> {
</span><del>-    WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts(policy);
</del><ins>+    SoupCookieJarAcceptPolicy soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
+    switch (policy) {
+    case HTTPCookieAcceptPolicyAlways:
+        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+        break;
+    case HTTPCookieAcceptPolicyNever:
+        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NEVER;
+        break;
+    case HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
+        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
+        break;
+    }
+
+    NetworkStorageSession::forEach([soupPolicy] (const NetworkStorageSession&amp; session) {
+        soup_cookie_jar_set_accept_policy(session.cookieStorage(), soupPolicy);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
</span><span class="lines">@@ -75,7 +89,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto&amp; storageSession = NetworkStorageSession::defaultStorageSession();
</span><span class="cx">     soup_cookie_jar_set_accept_policy(jar.get(), soup_cookie_jar_get_accept_policy(storageSession.cookieStorage()));
</span><del>-    storageSession.getOrCreateSoupNetworkSession().setCookieJar(jar.get());
</del><ins>+    storageSession.setCookieStorage(jar.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportsoupWebFrameNetworkingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -52,28 +52,6 @@
</span><span class="cx">     SessionTracker::setSession(sessionID, NetworkSession::create(sessionID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts(HTTPCookieAcceptPolicy policy)
-{
-    SoupCookieJarAcceptPolicy soupPolicy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
-    switch (policy) {
-    case HTTPCookieAcceptPolicyAlways:
-        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
-        break;
-    case HTTPCookieAcceptPolicyNever:
-        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NEVER;
-        break;
-    case HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
-        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
-        break;
-    }
-
-    soup_cookie_jar_set_accept_policy(NetworkStorageSession::defaultStorageSession().cookieStorage(), soupPolicy);
-
-    NetworkStorageSession::forEach([&amp;] (const NetworkStorageSession&amp; session) {
-        soup_cookie_jar_set_accept_policy(session.cookieStorage(), soupPolicy);
-    });
-}
-
</del><span class="cx"> WebFrameNetworkingContext::WebFrameNetworkingContext(WebFrame* frame)
</span><span class="cx">     : FrameNetworkingContext(frame-&gt;coreFrame())
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportsoupWebFrameNetworkingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h (212625 => 212626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h        2017-02-20 06:36:04 UTC (rev 212625)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h        2017-02-20 08:30:50 UTC (rev 212626)
</span><span class="lines">@@ -25,10 +25,8 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef WebFrameNetworkingContext_h
-#define WebFrameNetworkingContext_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#include &quot;HTTPCookieAcceptPolicy.h&quot;
</del><span class="cx"> #include &lt;WebCore/FrameNetworkingContext.h&gt;
</span><span class="cx"> #include &lt;WebCore/SessionID.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -45,7 +43,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static void ensurePrivateBrowsingSession(WebCore::SessionID);
</span><del>-    static void setCookieAcceptPolicyForAllContexts(HTTPCookieAcceptPolicy);
</del><span class="cx"> 
</span><span class="cx">     WebFrameLoaderClient* webFrameLoaderClient() const;
</span><span class="cx"> 
</span><span class="lines">@@ -56,5 +53,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif // WebFrameNetworkingContext_h
</del></span></pre>
</div>
</div>

</body>
</html>