Title: [256013] trunk
Revision
256013
Author
[email protected]
Date
2020-02-07 01:39:02 -0800 (Fri, 07 Feb 2020)

Log Message

[GTK][WPE] Add same-site cookie support
https://bugs.webkit.org/show_bug.cgi?id=204137

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Implements same-site cookie support in the soup backend.

* platform/network/HTTPParsers.cpp:
(WebCore::isSafeMethod):
* platform/network/HTTPParsers.h:
* platform/network/SameSiteInfo.cpp:
(WebCore::SameSiteInfo::create):
* platform/network/SameSiteInfo.h:
(WebCore::SameSiteInfo::encode const):
(WebCore::SameSiteInfo::decode):
* platform/network/soup/CookieSoup.cpp:
(WebCore::coreSameSitePolicy):
(WebCore::soupSameSitePolicy):
(WebCore::Cookie::Cookie):
(WebCore::Cookie::toSoupCookie const):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::cookiesForSession):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageMembers const):
(WebCore::ResourceRequest::updateFromSoupMessage):

Source/WebKit:

Implements same-site cookie support in the soup backend.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):

Tools:

Update libsoup to 2.69.90 in JHBuild.

* gtk/jhbuild.modules:
* wpe/jhbuild.modules:

LayoutTests:

Updated GTK/WPE test expectations to pass most same-site cookie tests
matching the Apple ports.

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (256012 => 256013)


--- trunk/LayoutTests/ChangeLog	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/LayoutTests/ChangeLog	2020-02-07 09:39:02 UTC (rev 256013)
@@ -1,3 +1,16 @@
+2020-02-07  Patrick Griffis  <[email protected]>
+
+        [GTK][WPE] Add same-site cookie support
+        https://bugs.webkit.org/show_bug.cgi?id=204137
+
+        Reviewed by Carlos Garcia Campos.
+
+        Updated GTK/WPE test expectations to pass most same-site cookie tests
+        matching the Apple ports.
+
+        * platform/gtk/TestExpectations:
+        * platform/wpe/TestExpectations:
+
 2020-02-07  youenn fablet  <[email protected]>
 
         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (256012 => 256013)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2020-02-07 09:39:02 UTC (rev 256013)
@@ -4154,6 +4154,8 @@
 webkit.org/b/207246 imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub.html [ Failure ]
 webkit.org/b/207246 imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-image-source-computed.sub.html [ Failure ]
 
+webkit.org/b/194933 http/tests/cookies/same-site/user-load-cross-site-redirect.php [ Failure ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of non-crashing, non-flaky tests failing
 #////////////////////////////////////////////////////////////////////////////////////////
@@ -4335,6 +4337,8 @@
 webkit.org/b/206885 imported/w3c/web-platform-tests/css/css-fonts/standard-font-family-7.html [ Pass ]
 webkit.org/b/206885 imported/w3c/web-platform-tests/css/css-fonts/standard-font-family.html [ Pass ]
 
+http/tests/cookies/same-site [ Pass ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of PASSING tests. See top of file where to put new expectations.
 #////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (256012 => 256013)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2020-02-07 09:39:02 UTC (rev 256013)
@@ -949,6 +949,8 @@
 fast/gradients/conic-gradient-alpha.html [ Pass ]
 imported/w3c/web-platform-tests/css/css-images/multiple-position-color-stop-conic.html [ Pass ]
 
+http/tests/cookies/same-site [ Pass ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # 5. TESTS CRASHING
 #////////////////////////////////////////////////////////////////////////////////////////
@@ -2203,6 +2205,8 @@
 webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.html [ Failure ]
 webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.worker.html [ Failure ]
 
+webkit.org/b/194933 http/tests/cookies/same-site/user-load-cross-site-redirect.php [ Failure ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 #  >> NOTICE <<
 # Please see guidelines at the top of this file and place new test expectations

Modified: trunk/Source/WebCore/ChangeLog (256012 => 256013)


--- trunk/Source/WebCore/ChangeLog	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/ChangeLog	2020-02-07 09:39:02 UTC (rev 256013)
@@ -1,3 +1,34 @@
+2020-02-07  Patrick Griffis  <[email protected]>
+
+        [GTK][WPE] Add same-site cookie support
+        https://bugs.webkit.org/show_bug.cgi?id=204137
+
+        Reviewed by Carlos Garcia Campos.
+
+        Implements same-site cookie support in the soup backend.
+
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::isSafeMethod):
+        * platform/network/HTTPParsers.h:
+        * platform/network/SameSiteInfo.cpp:
+        (WebCore::SameSiteInfo::create):
+        * platform/network/SameSiteInfo.h:
+        (WebCore::SameSiteInfo::encode const):
+        (WebCore::SameSiteInfo::decode):
+        * platform/network/soup/CookieSoup.cpp:
+        (WebCore::coreSameSitePolicy):
+        (WebCore::soupSameSitePolicy):
+        (WebCore::Cookie::Cookie):
+        (WebCore::Cookie::toSoupCookie const):
+        * platform/network/soup/NetworkStorageSessionSoup.cpp:
+        (WebCore::NetworkStorageSession::getRawCookies const):
+        (WebCore::cookiesForSession):
+        (WebCore::NetworkStorageSession::cookiesForDOM const):
+        (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        (WebCore::ResourceRequest::updateSoupMessageMembers const):
+        (WebCore::ResourceRequest::updateFromSoupMessage):
+
 2020-02-07  Rob Buis  <[email protected]>
 
         Fix fetch/api/policies/referrer-origin-worker.html

Modified: trunk/Source/WebCore/platform/network/HTTPParsers.cpp (256012 => 256013)


--- trunk/Source/WebCore/platform/network/HTTPParsers.cpp	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/HTTPParsers.cpp	2020-02-07 09:39:02 UTC (rev 256013)
@@ -985,6 +985,17 @@
     return method;
 }
 
+// Defined by https://tools.ietf.org/html/rfc7231#section-4.2.1
+bool isSafeMethod(const String& method)
+{
+    const ASCIILiteral safeMethods[] = { "GET"_s, "HEAD"_s, "OPTIONS"_s, "TRACE"_s };
+    for (auto value : safeMethods) {
+        if (equalIgnoringASCIICase(method, value.characters()))
+            return true;
+    }
+    return false;
+}
+
 CrossOriginResourcePolicy parseCrossOriginResourcePolicyHeader(StringView header)
 {
     auto strippedHeader = stripLeadingAndTrailingHTTPSpaces(header);

Modified: trunk/Source/WebCore/platform/network/HTTPParsers.h (256012 => 256013)


--- trunk/Source/WebCore/platform/network/HTTPParsers.h	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/HTTPParsers.h	2020-02-07 09:39:02 UTC (rev 256013)
@@ -108,6 +108,7 @@
 bool isCrossOriginSafeRequestHeader(HTTPHeaderName, const String&);
 
 String normalizeHTTPMethod(const String&);
+bool isSafeMethod(const String&);
 
 WEBCORE_EXPORT CrossOriginResourcePolicy parseCrossOriginResourcePolicyHeader(StringView);
 

Modified: trunk/Source/WebCore/platform/network/SameSiteInfo.cpp (256012 => 256013)


--- trunk/Source/WebCore/platform/network/SameSiteInfo.cpp	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/SameSiteInfo.cpp	2020-02-07 09:39:02 UTC (rev 256013)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "SameSiteInfo.h"
 
+#include "HTTPParsers.h"
 #include "ResourceRequest.h"
 
 namespace WebCore {
@@ -32,7 +33,7 @@
 
 SameSiteInfo SameSiteInfo::create(const ResourceRequest& request)
 {
-    return { request.isSameSite(), request.isTopSite() };
+    return { request.isSameSite(), request.isTopSite(), isSafeMethod(request.httpMethod()) };
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/network/SameSiteInfo.h (256012 => 256013)


--- trunk/Source/WebCore/platform/network/SameSiteInfo.h	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/SameSiteInfo.h	2020-02-07 09:39:02 UTC (rev 256013)
@@ -34,6 +34,7 @@
 
     bool isSameSite { false };
     bool isTopSite { false };
+    bool isSafeHTTPMethod { false };
 
     template <class Encoder> void encode(Encoder&) const;
     template <class Decoder> static bool decode(Decoder&, SameSiteInfo&);
@@ -44,6 +45,7 @@
 {
     encoder << isSameSite;
     encoder << isTopSite;
+    encoder << isSafeHTTPMethod;
 }
 
 template <class Decoder>
@@ -53,6 +55,8 @@
         return false;
     if (!decoder.decode(info.isTopSite))
         return false;
+    if (!decoder.decode(info.isSafeHTTPMethod))
+        return false;
     return true;
 }
 

Modified: trunk/Source/WebCore/platform/network/soup/CookieSoup.cpp (256012 => 256013)


--- trunk/Source/WebCore/platform/network/soup/CookieSoup.cpp	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/soup/CookieSoup.cpp	2020-02-07 09:39:02 UTC (rev 256013)
@@ -32,6 +32,38 @@
 
 namespace WebCore {
 
+#if SOUP_CHECK_VERSION(2, 69, 90)
+static Cookie::SameSitePolicy coreSameSitePolicy(SoupSameSitePolicy policy)
+{
+    switch (policy) {
+    case SOUP_SAME_SITE_POLICY_NONE:
+        return Cookie::SameSitePolicy::None;
+    case SOUP_SAME_SITE_POLICY_LAX:
+        return Cookie::SameSitePolicy::Lax;
+    case SOUP_SAME_SITE_POLICY_STRICT:
+        return Cookie::SameSitePolicy::Strict;
+    }
+
+    ASSERT_NOT_REACHED();
+    return Cookie::SameSitePolicy::None;
+}
+
+static SoupSameSitePolicy soupSameSitePolicy(Cookie::SameSitePolicy policy)
+{
+    switch (policy) {
+    case Cookie::SameSitePolicy::None:
+        return SOUP_SAME_SITE_POLICY_NONE;
+    case Cookie::SameSitePolicy::Lax:
+        return SOUP_SAME_SITE_POLICY_LAX;
+    case Cookie::SameSitePolicy::Strict:
+        return SOUP_SAME_SITE_POLICY_STRICT;
+    }
+
+    ASSERT_NOT_REACHED();
+    return SOUP_SAME_SITE_POLICY_NONE;
+}
+#endif
+
 Cookie::Cookie(SoupCookie* cookie)
     : name(String::fromUTF8(cookie->name))
     , value(String::fromUTF8(cookie->value))
@@ -43,6 +75,9 @@
     , session(!cookie->expires)
 
 {
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    sameSite = coreSameSitePolicy(soup_cookie_get_same_site_policy(cookie));
+#endif
 }
 
 static SoupDate* msToSoupDate(double ms)
@@ -66,6 +101,9 @@
 
     soup_cookie_set_http_only(soupCookie, httpOnly);
     soup_cookie_set_secure(soupCookie, secure);
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    soup_cookie_set_same_site_policy(soupCookie, soupSameSitePolicy(sameSite));
+#endif
 
     if (!session) {
         SoupDate* date = msToSoupDate(expires);

Modified: trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp (256012 => 256013)


--- trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp	2020-02-07 09:39:02 UTC (rev 256013)
@@ -439,33 +439,39 @@
     completionHandler(false);
 }
 
-bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, ShouldAskITP, Vector<Cookie>& rawCookies) const
+bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, ShouldAskITP, Vector<Cookie>& rawCookies) const
 {
-    UNUSED_PARAM(firstParty);
+    rawCookies.clear();
+
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (shouldBlockCookies(firstParty, url, frameID, pageID))
+        return true;
+#else
     UNUSED_PARAM(frameID);
     UNUSED_PARAM(pageID);
-    rawCookies.clear();
+#endif
+
     GUniquePtr<SoupURI> uri = urlToSoupURI(url);
     if (!uri)
         return false;
 
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    GUniquePtr<SoupURI> firstPartyURI = urlToSoupURI(sameSiteInfo.isSameSite ? url : firstParty);
+    if (!firstPartyURI)
+        return false;
+
+    GUniquePtr<SoupURI> cookieURI = sameSiteInfo.isSameSite ? urlToSoupURI(url) : nullptr;
+    GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list_with_same_site_info(cookieStorage(), uri.get(), firstPartyURI.get(), cookieURI.get(), TRUE, sameSiteInfo.isSafeHTTPMethod, sameSiteInfo.isTopSite));
+#else
     GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(cookieStorage(), uri.get(), TRUE));
+    UNUSED_PARAM(sameSiteInfo);
+#endif
     if (!cookies)
         return false;
 
     for (GSList* iter = cookies.get(); iter; iter = g_slist_next(iter)) {
         SoupCookie* soupCookie = static_cast<SoupCookie*>(iter->data);
-        Cookie cookie;
-        cookie.name = String::fromUTF8(soupCookie->name);
-        cookie.value = String::fromUTF8(soupCookie->value);
-        cookie.domain = String::fromUTF8(soupCookie->domain);
-        cookie.path = String::fromUTF8(soupCookie->path);
-        cookie.created = 0;
-        cookie.expires = soupCookie->expires ? static_cast<double>(soup_date_to_time_t(soupCookie->expires)) * 1000 : 0;
-        cookie.httpOnly = soupCookie->http_only;
-        cookie.secure = soupCookie->secure;
-        cookie.session = !soupCookie->expires;
-        rawCookies.append(WTFMove(cookie));
+        rawCookies.append(Cookie(soupCookie));
         soup_cookie_free(soupCookie);
     }
 
@@ -472,13 +478,32 @@
     return true;
 }
 
-static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& session, const URL& url, bool forHTTPHeader, IncludeSecureCookies includeSecureCookies)
+static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const SameSiteInfo& sameSiteInfo, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, bool forHTTPHeader, IncludeSecureCookies includeSecureCookies)
 {
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (session.shouldBlockCookies(firstParty, url, frameID, pageID))
+        return { { }, false };
+#else
+    UNUSED_PARAM(frameID);
+    UNUSED_PARAM(pageID);
+#endif
+
     GUniquePtr<SoupURI> uri = urlToSoupURI(url);
     if (!uri)
         return { { }, false };
 
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    GUniquePtr<SoupURI> firstPartyURI = urlToSoupURI(firstParty);
+    if (!firstPartyURI)
+        return { { }, false };
+
+    GUniquePtr<SoupURI> cookieURI = sameSiteInfo.isSameSite ? urlToSoupURI(url) : nullptr;
+    GSList* cookies = soup_cookie_jar_get_cookie_list_with_same_site_info(session.cookieStorage(), uri.get(), firstPartyURI.get(), cookieURI.get(), forHTTPHeader, sameSiteInfo.isSafeHTTPMethod, sameSiteInfo.isTopSite);
+#else
     GSList* cookies = soup_cookie_jar_get_cookie_list(session.cookieStorage(), uri.get(), forHTTPHeader);
+    UNUSED_PARAM(firstParty);
+    UNUSED_PARAM(sameSiteInfo);
+#endif
     bool didAccessSecureCookies = false;
 
     // libsoup should omit secure cookies itself if the protocol is not https.
@@ -509,21 +534,15 @@
     return { String::fromUTF8(cookieHeader.get()), didAccessSecureCookies };
 }
 
-std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, IncludeSecureCookies includeSecureCookies, ShouldAskITP) const
+std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, IncludeSecureCookies includeSecureCookies, ShouldAskITP) const
 {
-    UNUSED_PARAM(firstParty);
-    UNUSED_PARAM(frameID);
-    UNUSED_PARAM(pageID);
-    return cookiesForSession(*this, url, false, includeSecureCookies);
+    return cookiesForSession(*this, firstParty, url, sameSiteInfo, frameID, pageID, false, includeSecureCookies);
 }
 
-std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, IncludeSecureCookies includeSecureCookies, ShouldAskITP) const
+std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, IncludeSecureCookies includeSecureCookies, ShouldAskITP) const
 {
-    UNUSED_PARAM(firstParty);
-    UNUSED_PARAM(frameID);
-    UNUSED_PARAM(pageID);
     // Secure cookies will still only be included if url's protocol is https.
-    return cookiesForSession(*this, url, true, includeSecureCookies);
+    return cookiesForSession(*this, firstParty, url, sameSiteInfo, frameID, pageID, true, includeSecureCookies);
 }
 
 std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const CookieRequestHeaderFieldProxy& headerFieldProxy) const

Modified: trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp (256012 => 256013)


--- trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp	2020-02-07 09:39:02 UTC (rev 256013)
@@ -110,6 +110,15 @@
     if (firstParty)
         soup_message_set_first_party(soupMessage, firstParty.get());
 
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    if (m_sameSiteDisposition == ResourceRequest::SameSiteDisposition::SameSite) {
+        GUniquePtr<SoupURI> siteForCookies = urlToSoupURI(m_url);
+        soup_message_set_site_for_cookies(soupMessage, siteForCookies.get());
+    }
+
+    soup_message_set_is_top_level_navigation(soupMessage, isTopSite());
+#endif
+
     soup_message_set_flags(soupMessage, m_soupFlags);
 
     if (!acceptEncoding())
@@ -170,6 +179,17 @@
     if (SoupURI* firstParty = soup_message_get_first_party(soupMessage))
         m_firstPartyForCookies = soupURIToURL(firstParty);
 
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    setIsTopSite(soup_message_get_is_top_level_navigation(soupMessage));
+
+    if (SoupURI* siteForCookies = soup_message_get_site_for_cookies(soupMessage))
+        setIsSameSite(areRegistrableDomainsEqual(soupURIToURL(siteForCookies), m_url));
+    else
+        m_sameSiteDisposition = SameSiteDisposition::Unspecified;
+#else
+    m_sameSiteDisposition = SameSiteDisposition::Unspecified;
+#endif
+
     m_soupFlags = soup_message_get_flags(soupMessage);
 
     // FIXME: m_allowCookies should probably be handled here and on

Modified: trunk/Source/WebKit/ChangeLog (256012 => 256013)


--- trunk/Source/WebKit/ChangeLog	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebKit/ChangeLog	2020-02-07 09:39:02 UTC (rev 256013)
@@ -1,3 +1,15 @@
+2020-02-07  Patrick Griffis  <[email protected]>
+
+        [GTK][WPE] Add same-site cookie support
+        https://bugs.webkit.org/show_bug.cgi?id=204137
+
+        Reviewed by Carlos Garcia Campos.
+
+        Implements same-site cookie support in the soup backend.
+
+        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+        (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
+
 2020-02-07  youenn fablet  <[email protected]>
 
         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder

Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp (256012 => 256013)


--- trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp	2020-02-07 09:39:02 UTC (rev 256013)
@@ -675,6 +675,20 @@
     m_lastHTTPMethod = request.httpMethod();
     request.removeCredentials();
 
+    if (isTopLevelNavigation()) {
+        request.setFirstPartyForCookies(request.url());
+#if SOUP_CHECK_VERSION(2, 69, 90)
+        soup_message_set_is_top_level_navigation(m_soupMessage.get(), true);
+#endif
+    }
+
+#if SOUP_CHECK_VERSION(2, 69, 90)
+    if (request.isSameSite()) {
+        GUniquePtr<SoupURI> requestURI = urlToSoupURI(request.url());
+        soup_message_set_site_for_cookies(m_soupMessage.get(), requestURI.get());
+    }
+#endif
+
     if (isCrossOrigin) {
         // The network layer might carry over some headers from the original request that
         // we want to strip here because the redirect is cross-origin.

Modified: trunk/Tools/ChangeLog (256012 => 256013)


--- trunk/Tools/ChangeLog	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Tools/ChangeLog	2020-02-07 09:39:02 UTC (rev 256013)
@@ -1,3 +1,15 @@
+2020-02-07  Patrick Griffis  <[email protected]>
+
+        [GTK][WPE] Add same-site cookie support
+        https://bugs.webkit.org/show_bug.cgi?id=204137
+
+        Reviewed by Carlos Garcia Campos.
+
+        Update libsoup to 2.69.90 in JHBuild.
+
+        * gtk/jhbuild.modules:
+        * wpe/jhbuild.modules:
+
 2020-02-07  Yusuke Suzuki  <[email protected]>
 
         Unreviewed, revert 75% load-factor because of JetStream2/string-unpack-code-SP regression

Modified: trunk/Tools/gtk/jhbuild.modules (256012 => 256013)


--- trunk/Tools/gtk/jhbuild.modules	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Tools/gtk/jhbuild.modules	2020-02-07 09:39:02 UTC (rev 256013)
@@ -54,6 +54,8 @@
       href=""
   <repository type="tarball" name="ftp.gnome.org"
       href=""
+  <repository type="tarball" name="download.gnome.org"
+      href=""
   <repository type="git" name="git.gnome.org"
       href=""
   <repository type="tarball" name="cairographics.org"
@@ -238,9 +240,9 @@
       <dep package="glib-networking"/>
       <dep package="libpsl"/>
     </dependencies>
-    <branch module="/pub/GNOME/sources/libsoup/2.68/libsoup-${version}.tar.xz" version="2.68.3"
-            repo="ftp.gnome.org"
-            hash="sha256:534bb08e35b0ff3702f3adfde87d3441e27c12f9f5ec351f056fe04cba02bafb">
+    <branch module="/sources/libsoup/2.69/libsoup-${version}.tar.xz" version="2.69.90"
+            repo="download.gnome.org"
+            hash="sha256:8ed18092cfb27d870a7c7c45992f3a216bd22dd6fd6d2c9fbf1adc2d6957cab8">
     </branch>
   </meson>
 

Modified: trunk/Tools/wpe/jhbuild.modules (256012 => 256013)


--- trunk/Tools/wpe/jhbuild.modules	2020-02-07 09:11:09 UTC (rev 256012)
+++ trunk/Tools/wpe/jhbuild.modules	2020-02-07 09:39:02 UTC (rev 256013)
@@ -37,6 +37,8 @@
       href=""
   <repository type="tarball" name="ftp.gnome.org"
       href=""
+  <repository type="tarball" name="download.gnome.org"
+      href=""
   <repository type="tarball" name="cairographics.org"
       href=""
   <repository type="tarball" name="freedesktop.org"
@@ -100,9 +102,9 @@
       <dep package="glib-networking"/>
       <dep package="libpsl"/>
     </dependencies>
-    <branch module="/pub/GNOME/sources/libsoup/2.68/libsoup-${version}.tar.xz" version="2.68.3"
-            repo="ftp.gnome.org"
-            hash="sha256:534bb08e35b0ff3702f3adfde87d3441e27c12f9f5ec351f056fe04cba02bafb">
+    <branch module="/sources/libsoup/2.69/libsoup-${version}.tar.xz" version="2.69.90"
+            repo="download.gnome.org"
+            hash="sha256:8ed18092cfb27d870a7c7c45992f3a216bd22dd6fd6d2c9fbf1adc2d6957cab8">
     </branch>
   </meson>
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to