WebKit Bugzilla
Attachment 356372 Details for
Bug 192306
: [SOUP] Move URLSoup back to WebCore after r238771
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wk-url-soup.diff (text/plain), 33.63 KB, created by
Carlos Garcia Campos
on 2018-12-03 03:19:47 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2018-12-03 03:19:47 PST
Size:
33.63 KB
patch
obsolete
>diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 878d824bcd6..7e1b6d0bc45 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,18 @@ >+2018-12-03 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [SOUP] Move URLSoup back to WebCore after r238771 >+ https://bugs.webkit.org/show_bug.cgi?id=192306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In r238771 URL was moved from WebCore to WTF, including the soup implementation. Unfortunately that added >+ libsoup as a new dependency of libjavascriptcoregtk. >+ >+ * wtf/PlatformGTK.cmake: >+ * wtf/PlatformWPE.cmake: >+ * wtf/URL.h: >+ * wtf/glib/URLGLib.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp. >+ > 2018-12-01 Alexey Proskuryakov <ap@apple.com> > > Modernize version check for _suppressedAutoAddedHTTPHeaders >diff --git a/Source/WTF/wtf/PlatformGTK.cmake b/Source/WTF/wtf/PlatformGTK.cmake >index 006fc22d616..673f02d0d59 100644 >--- a/Source/WTF/wtf/PlatformGTK.cmake >+++ b/Source/WTF/wtf/PlatformGTK.cmake >@@ -6,7 +6,6 @@ list(APPEND WTF_PUBLIC_HEADERS > glib/GRefPtr.h > glib/GTypedefs.h > glib/GUniquePtr.h >- glib/GUniquePtrSoup.h > glib/RunLoopSourcePriority.h > glib/WTFGType.h > ) >@@ -26,7 +25,7 @@ list(APPEND WTF_SOURCES > glib/GLibUtilities.cpp > glib/GRefPtr.cpp > glib/RunLoopGLib.cpp >- glib/URLSoup.cpp >+ glib/URLGLib.cpp > > text/unix/TextBreakIteratorInternalICUUnix.cpp > >@@ -52,11 +51,9 @@ list(APPEND WTF_LIBRARIES > ${GLIB_GIO_LIBRARIES} > ${GLIB_GOBJECT_LIBRARIES} > ${GLIB_LIBRARIES} >- ${LIBSOUP_LIBRARIES} > ${ZLIB_LIBRARIES} > ) > > list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES > ${GLIB_INCLUDE_DIRS} >- ${LIBSOUP_INCLUDE_DIRS} > ) >diff --git a/Source/WTF/wtf/PlatformWPE.cmake b/Source/WTF/wtf/PlatformWPE.cmake >index a02da5278ee..473cfd6026b 100644 >--- a/Source/WTF/wtf/PlatformWPE.cmake >+++ b/Source/WTF/wtf/PlatformWPE.cmake >@@ -4,7 +4,6 @@ list(APPEND WTF_PUBLIC_HEADERS > glib/GRefPtr.h > glib/GTypedefs.h > glib/GUniquePtr.h >- glib/GUniquePtrSoup.h > glib/RunLoopSourcePriority.h > glib/WTFGType.h > >@@ -20,7 +19,7 @@ list(APPEND WTF_SOURCES > glib/GLibUtilities.cpp > glib/GRefPtr.cpp > glib/RunLoopGLib.cpp >- glib/URLSoup.cpp >+ glib/URLGLib.cpp > > linux/CurrentProcessMemoryStatus.cpp > linux/MemoryFootprintLinux.cpp >@@ -37,11 +36,9 @@ list(APPEND WTF_LIBRARIES > ${GLIB_GIO_LIBRARIES} > ${GLIB_GOBJECT_LIBRARIES} > ${GLIB_LIBRARIES} >- ${LIBSOUP_LIBRARIES} > ${ZLIB_LIBRARIES} > ) > > list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES > ${GLIB_INCLUDE_DIRS} >- ${LIBSOUP_INCLUDE_DIRS} > ) >diff --git a/Source/WTF/wtf/URL.h b/Source/WTF/wtf/URL.h >index 9979e69b096..268867ec172 100644 >--- a/Source/WTF/wtf/URL.h >+++ b/Source/WTF/wtf/URL.h >@@ -33,10 +33,6 @@ > typedef const struct __CFURL* CFURLRef; > #endif > >-#if USE(SOUP) >-#include <wtf/glib/GUniquePtrSoup.h> >-#endif >- > #if USE(FOUNDATION) > OBJC_CLASS NSURL; > #endif >@@ -179,11 +175,6 @@ public: > RetainPtr<CFURLRef> createCFURL() const; > #endif > >-#if USE(SOUP) >- URL(SoupURI*); >- GUniquePtr<SoupURI> createSoupURI() const; >-#endif >- > #if USE(FOUNDATION) > URL(NSURL*); > operator NSURL*() const; >diff --git a/Source/WTF/wtf/glib/URLSoup.cpp b/Source/WTF/wtf/glib/URLGLib.cpp >similarity index 61% >rename from Source/WTF/wtf/glib/URLSoup.cpp >rename to Source/WTF/wtf/glib/URLGLib.cpp >index 55dbc7e17b8..f8aaab88c6a 100644 >--- a/Source/WTF/wtf/glib/URLSoup.cpp >+++ b/Source/WTF/wtf/glib/URLGLib.cpp >@@ -24,47 +24,15 @@ > */ > > #include "config.h" >+#include "URL.h" > >-#if USE(SOUP) >+#if USE(GLIB) > >-#include <libsoup/soup.h> >-#include <wtf/URL.h> >-#include <wtf/URLParser.h> >+#include <glib.h> > #include <wtf/text/CString.h> > > namespace WTF { > >-URL::URL(SoupURI* soupURI) >-{ >- if (!soupURI) { >- invalidate(); >- return; >- } >- >- GUniquePtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE)); >- URLParser parser(String::fromUTF8(urlString.get())); >- *this = parser.result(); >- >- if (!isValid()) >- return; >- >- // Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup >- // does not add the password to the URL when calling >- // soup_uri_to_string, and thus the requests are not properly >- // built. Fixing soup_uri_to_string is a no-no as the maintainer does >- // not want to break compatibility with previous implementations >- if (soupURI->password) >- setPass(String::fromUTF8(soupURI->password)); >-} >- >-GUniquePtr<SoupURI> URL::createSoupURI() const >-{ >- if (!isValid()) >- return nullptr; >- >- return GUniquePtr<SoupURI>(soup_uri_new(string().utf8().data())); >-} >- > bool URL::hostIsIPAddress(StringView host) > { > return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data()); >@@ -72,4 +40,4 @@ bool URL::hostIsIPAddress(StringView host) > > } // namespace WTF > >-#endif >+#endif // USE(GLIB) >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d1ac56ff4ac..a339c97545d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,45 @@ >+2018-12-03 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [SOUP] Move URLSoup back to WebCore after r238771 >+ https://bugs.webkit.org/show_bug.cgi?id=192306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and >+ URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL >+ header. >+ >+ * platform/Cookie.h: >+ * platform/SharedBuffer.h: >+ * platform/SourcesSoup.txt: >+ * platform/network/soup/CookieSoup.cpp: >+ * platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h. >+ * platform/network/soup/NetworkStorageSessionSoup.cpp: >+ (WebCore::NetworkStorageSession::setCookiesFromDOM const): >+ (WebCore::NetworkStorageSession::deleteCookie const): >+ (WebCore::NetworkStorageSession::getCookies): >+ (WebCore::NetworkStorageSession::getRawCookies const): >+ (WebCore::cookiesForSession): >+ * platform/network/soup/ResourceErrorSoup.cpp: >+ (WebCore::failingURI): >+ * platform/network/soup/ResourceHandleSoup.cpp: >+ * platform/network/soup/ResourceRequest.h: >+ (WebCore::ResourceRequest::ResourceRequest): >+ * platform/network/soup/ResourceRequestSoup.cpp: >+ (WebCore::ResourceRequest::updateSoupMessageMembers const): >+ (WebCore::ResourceRequest::updateFromSoupMessage): >+ (WebCore::ResourceRequest::createSoupURI const): >+ * platform/network/soup/ResourceResponseSoup.cpp: >+ (WebCore::ResourceResponse::updateFromSoupMessage): >+ * platform/network/soup/SocketStreamHandleImpl.h: >+ * platform/network/soup/SocketStreamHandleImplSoup.cpp: >+ (WebCore::SocketStreamHandleImpl::create): >+ * platform/network/soup/SoupNetworkSession.cpp: >+ * platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp. >+ (WebCore::soupURIToURL): >+ (WebCore::urlToSoupURI): >+ * platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp. >+ > 2018-12-02 Zalan Bujtas <zalan@apple.com> > > Add a runtime feature flag for LayoutFormattingContext. >diff --git a/Source/WebCore/platform/Cookie.h b/Source/WebCore/platform/Cookie.h >index 16ca9639db4..b1517db6c3f 100644 >--- a/Source/WebCore/platform/Cookie.h >+++ b/Source/WebCore/platform/Cookie.h >@@ -34,6 +34,10 @@ > #include <objc/objc.h> > #endif > >+#if USE(SOUP) >+typedef struct _SoupCookie SoupCookie; >+#endif >+ > namespace WebCore { > > struct Cookie { >diff --git a/Source/WebCore/platform/SharedBuffer.h b/Source/WebCore/platform/SharedBuffer.h >index f868c2c01d6..e2aae2f3045 100644 >--- a/Source/WebCore/platform/SharedBuffer.h >+++ b/Source/WebCore/platform/SharedBuffer.h >@@ -40,7 +40,7 @@ > #endif > > #if USE(SOUP) >-#include <wtf/glib/GUniquePtrSoup.h> >+#include "GUniquePtrSoup.h" > #endif > > #if USE(GLIB) >diff --git a/Source/WebCore/platform/SourcesSoup.txt b/Source/WebCore/platform/SourcesSoup.txt >index dbac3134e8b..f225a3895cd 100644 >--- a/Source/WebCore/platform/SourcesSoup.txt >+++ b/Source/WebCore/platform/SourcesSoup.txt >@@ -37,6 +37,7 @@ platform/network/soup/ResourceResponseSoup.cpp > platform/network/soup/SocketStreamHandleImplSoup.cpp > platform/network/soup/SoupNetworkSession.cpp > platform/network/soup/SynchronousLoaderClientSoup.cpp >+platform/network/soup/URLSoup.cpp > platform/network/soup/WebKitSoupRequestGeneric.cpp > > platform/soup/PublicSuffixSoup.cpp >diff --git a/Source/WebCore/platform/network/soup/CookieSoup.cpp b/Source/WebCore/platform/network/soup/CookieSoup.cpp >index eec169bac1e..e44c4ae6706 100644 >--- a/Source/WebCore/platform/network/soup/CookieSoup.cpp >+++ b/Source/WebCore/platform/network/soup/CookieSoup.cpp >@@ -27,6 +27,7 @@ > #include "config.h" > #include "Cookie.h" > >+#include <libsoup/soup.h> > #include <wtf/DateMath.h> > > namespace WebCore { >diff --git a/Source/WTF/wtf/glib/GUniquePtrSoup.h b/Source/WebCore/platform/network/soup/GUniquePtrSoup.h >similarity index 100% >rename from Source/WTF/wtf/glib/GUniquePtrSoup.h >rename to Source/WebCore/platform/network/soup/GUniquePtrSoup.h >diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >index 03d156e5ed6..7e213e8a758 100644 >--- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >+++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >@@ -33,14 +33,15 @@ > > #include "Cookie.h" > #include "CookieRequestHeaderFieldProxy.h" >+#include "GUniquePtrSoup.h" > #include "ResourceHandle.h" > #include "SoupNetworkSession.h" >+#include "URLSoup.h" > #include <libsoup/soup.h> > #include <wtf/DateMath.h> > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/glib/GUniquePtr.h> >-#include <wtf/glib/GUniquePtrSoup.h> > > #if USE(LIBSECRET) > #include "GRefPtrGtk.h" >@@ -318,11 +319,11 @@ void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameS > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >- GUniquePtr<SoupURI> origin = url.createSoupURI(); >+ GUniquePtr<SoupURI> origin = urlToSoupURI(url); > if (!origin) > return; > >- GUniquePtr<SoupURI> firstPartyURI = firstParty.createSoupURI(); >+ GUniquePtr<SoupURI> firstPartyURI = urlToSoupURI(firstParty); > if (!firstPartyURI) > return; > >@@ -369,7 +370,7 @@ void NetworkStorageSession::deleteCookie(const Cookie& cookie) > > void NetworkStorageSession::deleteCookie(const URL& url, const String& name) const > { >- GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ GUniquePtr<SoupURI> uri = urlToSoupURI(url); > if (!uri) > return; > >@@ -447,7 +448,7 @@ Vector<Cookie> NetworkStorageSession::getAllCookies() > Vector<Cookie> NetworkStorageSession::getCookies(const URL& url) > { > Vector<Cookie> cookies; >- GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ GUniquePtr<SoupURI> uri = urlToSoupURI(url); > if (!uri) > return cookies; > >@@ -466,7 +467,7 @@ bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteI > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); > rawCookies.clear(); >- GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ GUniquePtr<SoupURI> uri = urlToSoupURI(url); > if (!uri) > return false; > >@@ -495,7 +496,7 @@ bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteI > > static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& session, const URL& url, bool forHTTPHeader, IncludeSecureCookies includeSecureCookies) > { >- GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ GUniquePtr<SoupURI> uri = urlToSoupURI(url); > if (!uri) > return { { }, false }; > >diff --git a/Source/WebCore/platform/network/soup/ResourceErrorSoup.cpp b/Source/WebCore/platform/network/soup/ResourceErrorSoup.cpp >index f2e3b28fbe8..eeec3281e38 100644 >--- a/Source/WebCore/platform/network/soup/ResourceErrorSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceErrorSoup.cpp >@@ -29,6 +29,7 @@ > #if USE(SOUP) > > #include "LocalizedStrings.h" >+#include "URLSoup.h" > #include <libsoup/soup.h> > #include <wtf/glib/GUniquePtr.h> > #include <wtf/text/CString.h> >@@ -38,7 +39,7 @@ namespace WebCore { > static URL failingURI(SoupURI* soupURI) > { > ASSERT(soupURI); >- return URL(soupURI); >+ return soupURIToURL(soupURI); > } > > static URL failingURI(SoupRequest* request) >diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp >index fb71813a375..63734c674c5 100644 >--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp >@@ -33,6 +33,7 @@ > > #include "CredentialStorage.h" > #include "FileSystem.h" >+#include "GUniquePtrSoup.h" > #include "HTTPParsers.h" > #include "LocalizedStrings.h" > #include "MIMETypeRegistry.h" >@@ -57,7 +58,6 @@ > #endif > #include <wtf/CompletionHandler.h> > #include <wtf/glib/GRefPtr.h> >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/RunLoopSourcePriority.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebCore/platform/network/soup/ResourceRequest.h b/Source/WebCore/platform/network/soup/ResourceRequest.h >index 7472ad238b3..9661bc437e9 100644 >--- a/Source/WebCore/platform/network/soup/ResourceRequest.h >+++ b/Source/WebCore/platform/network/soup/ResourceRequest.h >@@ -28,8 +28,7 @@ > #define ResourceRequest_h > > #include "ResourceRequestBase.h" >-#include <libsoup/soup.h> >-#include <wtf/glib/GUniquePtrSoup.h> >+#include "URLSoup.h" > > namespace WebCore { > >@@ -78,7 +77,7 @@ namespace WebCore { > } > > ResourceRequest(SoupRequest* soupRequest) >- : ResourceRequestBase(URL(soup_request_get_uri(soupRequest)), ResourceRequestCachePolicy::UseProtocolCachePolicy) >+ : ResourceRequestBase(soupURIToURL(soup_request_get_uri(soupRequest)), ResourceRequestCachePolicy::UseProtocolCachePolicy) > , m_acceptEncoding(true) > , m_soupFlags(static_cast<SoupMessageFlags>(0)) > , m_initiatingPageID(0) >diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >index 229c53cf572..dfcca109115 100644 >--- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >@@ -24,11 +24,12 @@ > > #include "BlobData.h" > #include "BlobRegistryImpl.h" >+#include "GUniquePtrSoup.h" > #include "HTTPParsers.h" > #include "MIMETypeRegistry.h" > #include "SharedBuffer.h" >+#include "URLSoup.h" > #include "WebKitSoupRequestGeneric.h" >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >@@ -104,7 +105,7 @@ void ResourceRequest::updateSoupMessageMembers(SoupMessage* soupMessage) const > { > updateSoupMessageHeaders(soupMessage->request_headers); > >- GUniquePtr<SoupURI> firstParty = firstPartyForCookies().createSoupURI(); >+ GUniquePtr<SoupURI> firstParty = urlToSoupURI(firstPartyForCookies()); > if (firstParty) > soup_message_set_first_party(soupMessage, firstParty.get()); > >@@ -151,7 +152,7 @@ void ResourceRequest::updateSoupMessage(SoupMessage* soupMessage) const > void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage) > { > bool shouldPortBeResetToZero = m_url.port() && !m_url.port().value(); >- m_url = URL(soup_message_get_uri(soupMessage)); >+ m_url = soupURIToURL(soup_message_get_uri(soupMessage)); > > // SoupURI cannot differeniate between an explicitly specified port 0 and > // no port specified. >@@ -166,7 +167,7 @@ void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage) > m_httpBody = FormData::create(soupMessage->request_body->data, soupMessage->request_body->length); > > if (SoupURI* firstParty = soup_message_get_first_party(soupMessage)) >- m_firstPartyForCookies = URL(firstParty); >+ m_firstPartyForCookies = soupURIToURL(firstParty); > > m_soupFlags = soup_message_get_flags(soupMessage); > >@@ -214,7 +215,7 @@ GUniquePtr<SoupURI> ResourceRequest::createSoupURI() const > return GUniquePtr<SoupURI>(soup_uri_new(urlString.utf8().data())); > } > >- GUniquePtr<SoupURI> soupURI = m_url.createSoupURI(); >+ GUniquePtr<SoupURI> soupURI = urlToSoupURI(m_url); > > // Versions of libsoup prior to 2.42 have a soup_uri_new that will convert empty passwords that are not > // prefixed by a colon into null. Some parts of soup like the SoupAuthenticationManager will only be active >diff --git a/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp b/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp >index e3a1c3e336b..03b350db3a1 100644 >--- a/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp >@@ -27,6 +27,7 @@ > #include "HTTPHeaderNames.h" > #include "HTTPParsers.h" > #include "MIMETypeRegistry.h" >+#include "URLSoup.h" > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >@@ -40,7 +41,7 @@ void ResourceResponse::updateSoupMessageHeaders(SoupMessageHeaders* soupHeaders) > > void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage) > { >- m_url = URL(soup_message_get_uri(soupMessage)); >+ m_url = soupURIToURL(soup_message_get_uri(soupMessage)); > > switch (soup_message_get_http_version(soupMessage)) { > case SOUP_HTTP_1_0: >diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h >index 6b8316f66bf..6c4ddbbbc35 100644 >--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h >+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h >@@ -41,6 +41,9 @@ > #include <wtf/UniqueArray.h> > #include <wtf/glib/GRefPtr.h> > >+typedef struct _GIOStream GIOStream; >+typedef struct _GObject GObject; >+ > namespace WebCore { > > class SocketStreamError; >diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >index 5af9473f377..b5ebde6526c 100644 >--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >@@ -41,6 +41,7 @@ > #include "SocketStreamError.h" > #include "SocketStreamHandleClient.h" > #include "SoupNetworkSession.h" >+#include "URLSoup.h" > #include <gio/gio.h> > #include <glib.h> > #include <wtf/URL.h> >@@ -89,7 +90,7 @@ Ref<SocketStreamHandleImpl> SocketStreamHandleImpl::create(const URL& url, Socke > if (!networkStorageSession) > return socket; > >- auto uri = url.createSoupURI(); >+ auto uri = urlToSoupURI(url); > Ref<SocketStreamHandle> protectedSocketStreamHandle = socket.copyRef(); > soup_session_connect_async(networkStorageSession->getOrCreateSoupNetworkSession().soupSession(), uri.get(), socket->m_cancellable.get(), > url.protocolIs("wss") ? reinterpret_cast<SoupSessionConnectProgressCallback>(connectProgressCallback) : nullptr, >diff --git a/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp b/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >index 6004d17f76a..13ecb5b0f76 100644 >--- a/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >+++ b/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >@@ -31,6 +31,7 @@ > > #include "AuthenticationChallenge.h" > #include "FileSystem.h" >+#include "GUniquePtrSoup.h" > #include "Logging.h" > #include "SoupNetworkProxySettings.h" > #include <glib/gstdio.h> >@@ -38,7 +39,6 @@ > #include <pal/crypto/CryptoDigest.h> > #include <wtf/HashSet.h> > #include <wtf/NeverDestroyed.h> >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/text/Base64.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebCore/platform/network/soup/URLSoup.cpp b/Source/WebCore/platform/network/soup/URLSoup.cpp >new file mode 100644 >index 00000000000..f51c4fd57f8 >--- /dev/null >+++ b/Source/WebCore/platform/network/soup/URLSoup.cpp >@@ -0,0 +1,61 @@ >+/* >+ * Copyright (C) 2014, 2018 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "URLSoup.h" >+ >+#include <wtf/URL.h> >+ >+namespace WebCore { >+ >+URL soupURIToURL(SoupURI* soupURI) >+{ >+ if (!soupURI) >+ return URL(); >+ >+ GUniquePtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE)); >+ URL url(URL(), String::fromUTF8(urlString.get())); >+ if (url.isValid()) { >+ // Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup >+ // does not add the password to the URL when calling >+ // soup_uri_to_string, and thus the requests are not properly >+ // built. Fixing soup_uri_to_string is a no-no as the maintainer does >+ // not want to break compatibility with previous implementations >+ if (soupURI->password) >+ url.setPass(String::fromUTF8(soupURI->password)); >+ } >+ >+ return url; >+} >+ >+GUniquePtr<SoupURI> urlToSoupURI(const URL& url) >+{ >+ if (!url.isValid()) >+ return nullptr; >+ >+ return GUniquePtr<SoupURI>(soup_uri_new(url.string().utf8().data())); >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/network/soup/URLSoup.h b/Source/WebCore/platform/network/soup/URLSoup.h >new file mode 100644 >index 00000000000..5e3a89beb6b >--- /dev/null >+++ b/Source/WebCore/platform/network/soup/URLSoup.h >@@ -0,0 +1,37 @@ >+/* >+ * Copyright (C) 2018 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "GUniquePtrSoup.h" >+ >+namespace WTF { >+class URL; >+} >+ >+namespace WebCore { >+URL soupURIToURL(SoupURI*); >+GUniquePtr<SoupURI> urlToSoupURI(const WTF::URL&); >+} // namespace WebCore >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6ac3e62f45e..37871072438 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,28 @@ >+2018-12-03 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [SOUP] Move URLSoup back to WebCore after r238771 >+ https://bugs.webkit.org/show_bug.cgi?id=192306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup >+ includes from URL header. >+ >+ * NetworkProcess/soup/NetworkDataTaskSoup.cpp: >+ (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): >+ * PluginProcess/PluginProcess.cpp: >+ * Shared/API/glib/WebKitURIRequest.cpp: >+ * Shared/API/glib/WebKitURIResponse.cpp: >+ * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: >+ * UIProcess/API/glib/WebKitURISchemeRequest.cpp: >+ (webkit_uri_scheme_request_finish_error): Use soupURIToURL(). >+ * UIProcess/API/glib/WebKitWebView.cpp: >+ (webkit_web_view_load_uri): Use soupURIToURL(). >+ * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: >+ * UIProcess/Launcher/glib/BubblewrapLauncher.h: >+ * UIProcess/Launcher/glib/FlatpakLauncher.cpp: >+ * UIProcess/Launcher/glib/FlatpakLauncher.h: >+ > 2018-12-02 Zalan Bujtas <zalan@apple.com> > > Add a runtime feature flag for LayoutFormattingContext. >diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp >index d6d9ae24d38..0b7b6350a26 100644 >--- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp >+++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp >@@ -423,7 +423,7 @@ gboolean NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback(GTlsConnect > bool NetworkDataTaskSoup::tlsConnectionAcceptCertificate(GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors) > { > ASSERT(m_soupRequest); >- URL url(soup_request_get_uri(m_soupRequest.get())); >+ URL url = soupURIToURL(soup_request_get_uri(m_soupRequest.get())); > auto error = SoupNetworkSession::checkTLSErrors(url, certificate, tlsErrors); > if (!error) > return true; >diff --git a/Source/WebKit/PluginProcess/PluginProcess.cpp b/Source/WebKit/PluginProcess/PluginProcess.cpp >index 08231099e71..9c4e7a18684 100644 >--- a/Source/WebKit/PluginProcess/PluginProcess.cpp >+++ b/Source/WebKit/PluginProcess/PluginProcess.cpp >@@ -39,6 +39,7 @@ > #include "WebProcessConnection.h" > #include <WebCore/NetworkStorageSession.h> > #include <WebCore/NotImplemented.h> >+#include <unistd.h> > #include <wtf/MemoryPressureHandler.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/ProcessPrivilege.h> >diff --git a/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp b/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp >index 31f61ce7eaf..9fe5957204c 100644 >--- a/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp >+++ b/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp >@@ -21,8 +21,8 @@ > #include "WebKitURIRequest.h" > > #include "WebKitURIRequestPrivate.h" >+#include <WebCore/GUniquePtrSoup.h> > #include <glib/gi18n-lib.h> >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp b/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp >index 287eefd4d9c..d24558936cf 100644 >--- a/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp >+++ b/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp >@@ -21,8 +21,8 @@ > #include "WebKitURIResponse.h" > > #include "WebKitURIResponsePrivate.h" >+#include <WebCore/GUniquePtrSoup.h> > #include <glib/gi18n-lib.h> >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp b/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp >index 319684726f9..7ff7062103e 100644 >--- a/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp >+++ b/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp >@@ -27,6 +27,7 @@ > #include "APIWebsiteDataStore.h" > > #include <WebCore/FileSystem.h> >+#include <wtf/glib/GUniquePtr.h> > > #if PLATFORM(GTK) > #define BASE_DIRECTORY "webkitgtk" >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp b/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp >index 07b58ad323d..793cdbfd849 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp >@@ -26,10 +26,11 @@ > #include "WebKitWebContextPrivate.h" > #include "WebKitWebView.h" > #include "WebPageProxy.h" >+#include <WebCore/GUniquePtrSoup.h> > #include <WebCore/ResourceError.h> >+#include <WebCore/URLSoup.h> > #include <libsoup/soup.h> > #include <wtf/glib/GRefPtr.h> >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/RunLoopSourcePriority.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> >@@ -257,7 +258,7 @@ void webkit_uri_scheme_request_finish_error(WebKitURISchemeRequest* request, GEr > return; > > priv->stream = nullptr; >- ResourceError resourceError(g_quark_to_string(error->domain), toWebCoreError(error->code), URL(priv->soupURI.get()), String::fromUTF8(error->message)); >+ ResourceError resourceError(g_quark_to_string(error->domain), toWebCoreError(error->code), soupURIToURL(priv->soupURI.get()), String::fromUTF8(error->message)); > priv->manager->didFailWithError(priv->requestID, resourceError); > webkitWebContextDidFinishLoadingCustomProtocol(priv->webContext, priv->requestID); > } >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >index 234859663d1..acec9a6e59a 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >@@ -66,12 +66,13 @@ > #include <JavaScriptCore/JSRetainPtr.h> > #include <jsc/JSCContextPrivate.h> > #include <WebCore/CertificateInfo.h> >+#include <WebCore/GUniquePtrSoup.h> > #include <WebCore/JSDOMExceptionHandling.h> > #include <WebCore/RefPtrCairo.h> >+#include <WebCore/URLSoup.h> > #include <glib/gi18n-lib.h> > #include <wtf/URL.h> > #include <wtf/glib/GRefPtr.h> >-#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> >@@ -2584,7 +2585,7 @@ void webkit_web_view_load_uri(WebKitWebView* webView, const gchar* uri) > g_return_if_fail(uri); > > GUniquePtr<SoupURI> soupURI(soup_uri_new(uri)); >- getPage(webView).loadRequest(URL(soupURI.get())); >+ getPage(webView).loadRequest(soupURIToURL(soupURI.get())); > } > > /** >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp >index cae09a1158a..c734d8fec12 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp >@@ -25,6 +25,8 @@ > #include "WebKitCredentialPrivate.h" > #include "WebKitWebView.h" > #include <glib/gi18n-lib.h> >+#include <wtf/glib/GRefPtr.h> >+#include <wtf/glib/GUniquePtr.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.h b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.h >index 550c520087c..0c2cd5554f0 100644 >--- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.h >+++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.h >@@ -29,7 +29,10 @@ > > #include "ProcessLauncher.h" > >-#include <glib.h> >+#include <wtf/glib/GRefPtr.h> >+ >+typedef struct _GSubprocess GSubprocess; >+typedef struct _GSubprocessLauncher GSubprocessLauncher; > > namespace WebKit { > >diff --git a/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.cpp b/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.cpp >index bcb139ff325..c21b0edb1a9 100644 >--- a/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.cpp >+++ b/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.cpp >@@ -28,6 +28,8 @@ > > #if OS(LINUX) > >+#include <gio/gio.h> >+ > namespace WebKit { > > GRefPtr<GSubprocess> flatpakSpawn(GSubprocessLauncher* launcher, const WebKit::ProcessLauncher::LaunchOptions& launchOptions, char** argv, GError **error) >diff --git a/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.h b/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.h >index 75cba9fdc2e..c8442c10b1b 100644 >--- a/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.h >+++ b/Source/WebKit/UIProcess/Launcher/glib/FlatpakLauncher.h >@@ -29,7 +29,10 @@ > > #include "ProcessLauncher.h" > >-#include <glib.h> >+#include <wtf/glib/GRefPtr.h> >+ >+typedef struct _GSubprocess GSubprocess; >+typedef struct _GSubprocessLauncher GSubprocessLauncher; > > namespace WebKit { > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index c1ea44ce11c..a5a290ae11c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-03 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [SOUP] Move URLSoup back to WebCore after r238771 >+ https://bugs.webkit.org/show_bug.cgi?id=192306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Include GUniquePtrSoup from WebCore again. >+ >+ * TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp: >+ > 2018-12-01 Don Olmstead <don.olmstead@sony.com> > > Cleanup WebKit Features >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >index 1baae95ac06..b0514524f72 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >@@ -22,8 +22,8 @@ > > #include "WebKitTestServer.h" > #include "WebViewTest.h" >+#include <WebCore/GUniquePtrSoup.h> > #include <glib/gstdio.h> >-#include <wtf/glib/GUniquePtrSoup.h> > > static WebKitTestServer* kServer; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mcatanzaro
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192306
: 356372