<!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>[279074] trunk</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/279074">279074</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2021-06-21 11:50:08 -0700 (Mon, 21 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Break ref cycle between API::HTTPCookieStore and WebKit::WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=226992

Reviewed by Chris Dumez.

Source/WebKit:

Covered by an API test.

* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::filterAppBoundCookies):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::cookiesForURL):
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::deleteAllCookies):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
(API::HTTPCookieStore::flushCookies):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::complete):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIHTTPCookieStorecpp">trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIHTTPCookieStoreh">trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaSOAuthorizationSOAuthorizationSessionmm">trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaWKWebsiteDatastoremm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279073 => 279074)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-06-21 18:48:29 UTC (rev 279073)
+++ trunk/Source/WebKit/ChangeLog       2021-06-21 18:50:08 UTC (rev 279074)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2021-06-21  Alex Christensen  <achristensen@webkit.org>
+
+        Break ref cycle between API::HTTPCookieStore and WebKit::WebsiteDataStore
+        https://bugs.webkit.org/show_bug.cgi?id=226992
+
+        Reviewed by Chris Dumez.
+
+        Covered by an API test.
+
+        * UIProcess/API/APIHTTPCookieStore.cpp:
+        (API::HTTPCookieStore::HTTPCookieStore):
+        (API::HTTPCookieStore::filterAppBoundCookies):
+        (API::HTTPCookieStore::cookies):
+        (API::HTTPCookieStore::cookiesForURL):
+        (API::HTTPCookieStore::setCookies):
+        (API::HTTPCookieStore::deleteCookie):
+        (API::HTTPCookieStore::deleteAllCookies):
+        (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
+        (API::HTTPCookieStore::flushCookies):
+        (API::HTTPCookieStore::registerObserver):
+        (API::HTTPCookieStore::unregisterObserver):
+        * UIProcess/API/APIHTTPCookieStore.h:
+        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
+        (WebKit::SOAuthorizationSession::complete):
+
</ins><span class="cx"> 2021-06-21  James Savage  <james.savage@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Upstream async support to Swift overlay.
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIHTTPCookieStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp (279073 => 279074)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp 2021-06-21 18:48:29 UTC (rev 279073)
+++ trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp    2021-06-21 18:50:08 UTC (rev 279074)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> namespace API {
</span><span class="cx"> 
</span><span class="cx"> HTTPCookieStore::HTTPCookieStore(WebKit::WebsiteDataStore& websiteDataStore)
</span><del>-    : m_owningDataStore(websiteDataStore)
</del><ins>+    : m_owningDataStore(makeWeakPtr(websiteDataStore))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -55,45 +55,52 @@
</span><span class="cx">     ASSERT(!m_cookieManagerProxyObserver);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTTPCookieStore::filterAppBoundCookies(const Vector<WebCore::Cookie>& cookies, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&& completionHandler)
</del><ins>+void HTTPCookieStore::filterAppBoundCookies(Vector<WebCore::Cookie>&& cookies, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    Vector<WebCore::Cookie> appBoundCookies;
</del><span class="cx"> #if ENABLE(APP_BOUND_DOMAINS)
</span><del>-    m_owningDataStore->getAppBoundDomains([cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
</del><ins>+    if (!m_owningDataStore)
+        return completionHandler({ });
+    m_owningDataStore->getAppBoundDomains([cookies = WTFMove(cookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
+        Vector<WebCore::Cookie> appBoundCookies;
</ins><span class="cx">         if (!domains.isEmpty() && !isFullWebBrowser()) {
</span><del>-            for (auto& cookie : cookies) {
</del><ins>+            for (auto& cookie : WTFMove(cookies)) {
</ins><span class="cx">                 if (domains.contains(WebCore::RegistrableDomain::uncheckedCreateFromHost(cookie.domain)))
</span><del>-                    appBoundCookies.append(cookie);
</del><ins>+                    appBoundCookies.append(WTFMove(cookie));
</ins><span class="cx">             }
</span><span class="cx">         } else
</span><del>-            appBoundCookies = cookies;
</del><ins>+            appBoundCookies = WTFMove(cookies);
</ins><span class="cx">         completionHandler(WTFMove(appBoundCookies));
</span><span class="cx">     });
</span><span class="cx"> #else
</span><del>-    appBoundCookies = cookies;
-    completionHandler(WTFMove(appBoundCookies));
</del><ins>+    completionHandler(WTFMove(cookies));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTTPCookieStore::cookies(CompletionHandler<void(const Vector<WebCore::Cookie>&)>&& completionHandler)
</span><span class="cx"> {
</span><ins>+    if (!m_owningDataStore)
+        return completionHandler({ });
</ins><span class="cx">     auto& cookieManager = m_owningDataStore->networkProcess().cookieManager();
</span><del>-    cookieManager.getAllCookies(m_owningDataStore->sessionID(), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (const Vector<WebCore::Cookie>& cookies) mutable {
-        filterAppBoundCookies(cookies, WTFMove(completionHandler));
</del><ins>+    cookieManager.getAllCookies(m_owningDataStore->sessionID(), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (Vector<WebCore::Cookie>&& cookies) mutable {
+        filterAppBoundCookies(WTFMove(cookies), WTFMove(completionHandler));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTTPCookieStore::cookiesForURL(WTF::URL&& url, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&& completionHandler)
</span><span class="cx"> {
</span><ins>+    if (!m_owningDataStore)
+        return completionHandler({ });
</ins><span class="cx">     auto& cookieManager = m_owningDataStore->networkProcess().cookieManager();
</span><span class="cx">     cookieManager.getCookies(m_owningDataStore->sessionID(), url, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (Vector<WebCore::Cookie>&& cookies) mutable {
</span><del>-        filterAppBoundCookies(cookies, WTFMove(completionHandler));
</del><ins>+        filterAppBoundCookies(WTFMove(cookies), WTFMove(completionHandler));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTTPCookieStore::setCookies(const Vector<WebCore::Cookie>& cookies, CompletionHandler<void()>&& completionHandler)
</del><ins>+void HTTPCookieStore::setCookies(Vector<WebCore::Cookie>&& cookies, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    filterAppBoundCookies(cookies, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (auto&& appBoundCookies) mutable {
</del><ins>+    filterAppBoundCookies(WTFMove(cookies), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (auto&& appBoundCookies) mutable {
+        if (!m_owningDataStore)
+            return;
</ins><span class="cx">         auto& cookieManager = m_owningDataStore->networkProcess().cookieManager();
</span><span class="cx">         cookieManager.setCookies(m_owningDataStore->sessionID(), appBoundCookies, WTFMove(completionHandler));
</span><span class="cx">     });
</span><span class="lines">@@ -101,6 +108,8 @@
</span><span class="cx"> 
</span><span class="cx"> void HTTPCookieStore::deleteCookie(const WebCore::Cookie& cookie, CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><ins>+    if (!m_owningDataStore)
+        return completionHandler();
</ins><span class="cx">     auto& cookieManager = m_owningDataStore->networkProcess().cookieManager();
</span><span class="cx">     cookieManager.deleteCookie(m_owningDataStore->sessionID(), cookie, WTFMove(completionHandler));
</span><span class="cx"> }
</span><span class="lines">@@ -107,6 +116,8 @@
</span><span class="cx"> 
</span><span class="cx"> void HTTPCookieStore::deleteAllCookies(CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><ins>+    if (!m_owningDataStore)
+        return completionHandler();
</ins><span class="cx">     auto& cookieManager = m_owningDataStore->networkProcess().cookieManager();
</span><span class="cx">     cookieManager.deleteAllCookies(m_owningDataStore->sessionID());
</span><span class="cx">     // FIXME: The CompletionHandler should be passed to WebCookieManagerProxy::deleteAllCookies.
</span><span class="lines">@@ -115,6 +126,8 @@
</span><span class="cx"> 
</span><span class="cx"> void HTTPCookieStore::setHTTPCookieAcceptPolicy(WebCore::HTTPCookieAcceptPolicy policy, CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><ins>+    if (!m_owningDataStore)
+        return completionHandler();
</ins><span class="cx">     auto& cookieManager = m_owningDataStore->networkProcess().cookieManager();
</span><span class="cx">     cookieManager.setHTTPCookieAcceptPolicy(m_owningDataStore->sessionID(), policy, WTFMove(completionHandler));
</span><span class="cx"> }
</span><span class="lines">@@ -121,6 +134,8 @@
</span><span class="cx"> 
</span><span class="cx"> void HTTPCookieStore::flushCookies(CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><ins>+    if (!m_owningDataStore)
+        return completionHandler();
</ins><span class="cx">     m_owningDataStore->flushCookies(WTFMove(completionHandler));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -145,7 +160,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_observers.add(&observer);
</span><span class="cx"> 
</span><del>-    if (m_cookieManagerProxyObserver)
</del><ins>+    if (m_cookieManagerProxyObserver || !m_owningDataStore)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!m_observedCookieManagerProxy);
</span><span class="lines">@@ -163,7 +178,7 @@
</span><span class="cx">     if (!m_observers.computesEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_observedCookieManagerProxy)
</del><ins>+    if (m_observedCookieManagerProxy && m_owningDataStore)
</ins><span class="cx">         m_observedCookieManagerProxy->unregisterObserver(m_owningDataStore->sessionID(), *m_cookieManagerProxyObserver);
</span><span class="cx"> 
</span><span class="cx">     m_observedCookieManagerProxy = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIHTTPCookieStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h (279073 => 279074)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h   2021-06-21 18:48:29 UTC (rev 279073)
+++ trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h      2021-06-21 18:50:08 UTC (rev 279074)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     void cookies(CompletionHandler<void(const Vector<WebCore::Cookie>&)>&&);
</span><span class="cx">     void cookiesForURL(WTF::URL&&, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
</span><del>-    void setCookies(const Vector<WebCore::Cookie>&, CompletionHandler<void()>&&);
</del><ins>+    void setCookies(Vector<WebCore::Cookie>&&, CompletionHandler<void()>&&);
</ins><span class="cx">     void deleteCookie(const WebCore::Cookie&, CompletionHandler<void()>&&);
</span><span class="cx">     
</span><span class="cx">     void deleteAllCookies(CompletionHandler<void()>&&);
</span><span class="lines">@@ -75,14 +75,12 @@
</span><span class="cx"> 
</span><span class="cx">     void cookiesDidChange();
</span><span class="cx"> 
</span><del>-    void filterAppBoundCookies(const Vector<WebCore::Cookie>&, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
</del><ins>+    void filterAppBoundCookies(Vector<WebCore::Cookie>&&, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTTPCookieStore(WebKit::WebsiteDataStore&);
</span><span class="cx">     
</span><del>-    // FIXME: This is a reference cycle.
-    Ref<WebKit::WebsiteDataStore> m_owningDataStore;
-
</del><ins>+    WeakPtr<WebKit::WebsiteDataStore> m_owningDataStore;
</ins><span class="cx">     WeakHashSet<Observer> m_observers;
</span><span class="cx">     WeakPtr<WebKit::WebCookieManagerProxy> m_observedCookieManagerProxy;
</span><span class="cx">     std::unique_ptr<APIWebCookieManagerProxyObserver> m_cookieManagerProxyObserver;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaSOAuthorizationSOAuthorizationSessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm (279073 => 279074)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm    2021-06-21 18:48:29 UTC (rev 279073)
+++ trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm       2021-06-21 18:50:08 UTC (rev 279074)
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_page)
</span><span class="cx">         return;
</span><del>-    m_page->websiteDataStore().cookieStore().setCookies(cookies, [this, weakThis = makeWeakPtr(*this), response = WTFMove(response), data = adoptNS([[NSData alloc] initWithData:data])] () mutable {
</del><ins>+    m_page->websiteDataStore().cookieStore().setCookies(WTFMove(cookies), [this, weakThis = makeWeakPtr(*this), response = WTFMove(response), data = adoptNS([[NSData alloc] initWithData:data])] () mutable {
</ins><span class="cx">         if (!weakThis)
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (279073 => 279074)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-06-21 18:48:29 UTC (rev 279073)
+++ trunk/Tools/ChangeLog       2021-06-21 18:50:08 UTC (rev 279074)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-06-21  Alex Christensen  <achristensen@webkit.org>
+
+        Break ref cycle between API::HTTPCookieStore and WebKit::WebsiteDataStore
+        https://bugs.webkit.org/show_bug.cgi?id=226992
+
+        Reviewed by Chris Dumez.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2021-06-21  Kimmo Kinnunen  <kkinnunen@apple.com>
</span><span class="cx"> 
</span><span class="cx">         makeUnique cannot be used to instantiate function-local classes
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaWKWebsiteDatastoremm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm (279073 => 279074)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm        2021-06-21 18:48:29 UTC (rev 279073)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm   2021-06-21 18:50:08 UTC (rev 279074)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #import <WebKit/WKWebsiteDataStorePrivate.h>
</span><span class="cx"> #import <WebKit/WebKit.h>
</span><span class="cx"> #import <WebKit/_WKWebsiteDataStoreConfiguration.h>
</span><ins>+#import <wtf/WeakObjCPtr.h>
</ins><span class="cx"> #import <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="cx"> static bool readyToContinue;
</span><span class="lines">@@ -343,6 +344,18 @@
</span><span class="cx">     while (countSessionSets()) { }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST(WKWebsiteDataStore, ReferenceCycle)
+{
+    WeakObjCPtr<WKWebsiteDataStore> dataStore;
+    WeakObjCPtr<WKHTTPCookieStore> cookieStore;
+    @autoreleasepool {
+        dataStore = [WKWebsiteDataStore nonPersistentDataStore];
+        cookieStore = [dataStore httpCookieStore];
+    }
+    while (dataStore.get() || cookieStore.get())
+        TestWebKitAPI::Util::spinRunLoop();
+}
+
</ins><span class="cx"> TEST(WebKit, ClearCustomDataStoreNoWebViews)
</span><span class="cx"> {
</span><span class="cx">     HTTPServer server([connectionCount = 0] (Connection connection) mutable {
</span></span></pre>
</div>
</div>

</body>
</html>