Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit fde8de6

Browse files
[SOUP] Move URLSoup back to WebCore after r238771
https://bugs.webkit.org/show_bug.cgi?id=192306 Reviewed by Michael Catanzaro. Source/WebCore: 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. Source/WebKit: 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: Source/WTF: 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. Tools: Include GUniquePtrSoup from WebCore again. * TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 8a0bc01 commit fde8de6

36 files changed

+255
-84
lines changed

Source/WTF/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2018-12-04 Carlos Garcia Campos <[email protected]>
2+
3+
[SOUP] Move URLSoup back to WebCore after r238771
4+
https://bugs.webkit.org/show_bug.cgi?id=192306
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
In r238771 URL was moved from WebCore to WTF, including the soup implementation. Unfortunately that added
9+
libsoup as a new dependency of libjavascriptcoregtk.
10+
11+
* wtf/PlatformGTK.cmake:
12+
* wtf/PlatformWPE.cmake:
13+
* wtf/URL.h:
14+
* wtf/glib/URLGLib.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
15+
116
2018-12-03 Don Olmstead <[email protected]>
217

318
Fix some unused parameter warnings

Source/WTF/wtf/PlatformGTK.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ list(APPEND WTF_PUBLIC_HEADERS
66
glib/GRefPtr.h
77
glib/GTypedefs.h
88
glib/GUniquePtr.h
9-
glib/GUniquePtrSoup.h
109
glib/RunLoopSourcePriority.h
1110
glib/WTFGType.h
1211
)
@@ -26,7 +25,7 @@ list(APPEND WTF_SOURCES
2625
glib/GLibUtilities.cpp
2726
glib/GRefPtr.cpp
2827
glib/RunLoopGLib.cpp
29-
glib/URLSoup.cpp
28+
glib/URLGLib.cpp
3029

3130
text/unix/TextBreakIteratorInternalICUUnix.cpp
3231

@@ -52,11 +51,9 @@ list(APPEND WTF_LIBRARIES
5251
${GLIB_GIO_LIBRARIES}
5352
${GLIB_GOBJECT_LIBRARIES}
5453
${GLIB_LIBRARIES}
55-
${LIBSOUP_LIBRARIES}
5654
${ZLIB_LIBRARIES}
5755
)
5856

5957
list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
6058
${GLIB_INCLUDE_DIRS}
61-
${LIBSOUP_INCLUDE_DIRS}
6259
)

Source/WTF/wtf/PlatformWPE.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ list(APPEND WTF_PUBLIC_HEADERS
44
glib/GRefPtr.h
55
glib/GTypedefs.h
66
glib/GUniquePtr.h
7-
glib/GUniquePtrSoup.h
87
glib/RunLoopSourcePriority.h
98
glib/WTFGType.h
109

@@ -20,7 +19,7 @@ list(APPEND WTF_SOURCES
2019
glib/GLibUtilities.cpp
2120
glib/GRefPtr.cpp
2221
glib/RunLoopGLib.cpp
23-
glib/URLSoup.cpp
22+
glib/URLGLib.cpp
2423

2524
linux/CurrentProcessMemoryStatus.cpp
2625
linux/MemoryFootprintLinux.cpp
@@ -37,11 +36,9 @@ list(APPEND WTF_LIBRARIES
3736
${GLIB_GIO_LIBRARIES}
3837
${GLIB_GOBJECT_LIBRARIES}
3938
${GLIB_LIBRARIES}
40-
${LIBSOUP_LIBRARIES}
4139
${ZLIB_LIBRARIES}
4240
)
4341

4442
list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
4543
${GLIB_INCLUDE_DIRS}
46-
${LIBSOUP_INCLUDE_DIRS}
4744
)

Source/WTF/wtf/URL.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
typedef const struct __CFURL* CFURLRef;
3434
#endif
3535

36-
#if USE(SOUP)
37-
#include <wtf/glib/GUniquePtrSoup.h>
38-
#endif
39-
4036
#if USE(FOUNDATION)
4137
OBJC_CLASS NSURL;
4238
#endif
@@ -179,11 +175,6 @@ class WTF_EXPORT_PRIVATE URL {
179175
RetainPtr<CFURLRef> createCFURL() const;
180176
#endif
181177

182-
#if USE(SOUP)
183-
URL(SoupURI*);
184-
GUniquePtr<SoupURI> createSoupURI() const;
185-
#endif
186-
187178
#if USE(FOUNDATION)
188179
URL(NSURL*);
189180
operator NSURL*() const;

Source/WTF/wtf/glib/URLSoup.cpp renamed to Source/WTF/wtf/glib/URLGLib.cpp

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,52 +24,20 @@
2424
*/
2525

2626
#include "config.h"
27+
#include "URL.h"
2728

28-
#if USE(SOUP)
29+
#if USE(GLIB)
2930

30-
#include <libsoup/soup.h>
31-
#include <wtf/URL.h>
32-
#include <wtf/URLParser.h>
31+
#include <glib.h>
3332
#include <wtf/text/CString.h>
3433

3534
namespace WTF {
3635

37-
URL::URL(SoupURI* soupURI)
38-
{
39-
if (!soupURI) {
40-
invalidate();
41-
return;
42-
}
43-
44-
GUniquePtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE));
45-
URLParser parser(String::fromUTF8(urlString.get()));
46-
*this = parser.result();
47-
48-
if (!isValid())
49-
return;
50-
51-
// Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup
52-
// does not add the password to the URL when calling
53-
// soup_uri_to_string, and thus the requests are not properly
54-
// built. Fixing soup_uri_to_string is a no-no as the maintainer does
55-
// not want to break compatibility with previous implementations
56-
if (soupURI->password)
57-
setPass(String::fromUTF8(soupURI->password));
58-
}
59-
60-
GUniquePtr<SoupURI> URL::createSoupURI() const
61-
{
62-
if (!isValid())
63-
return nullptr;
64-
65-
return GUniquePtr<SoupURI>(soup_uri_new(string().utf8().data()));
66-
}
67-
6836
bool URL::hostIsIPAddress(StringView host)
6937
{
7038
return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data());
7139
}
7240

7341
} // namespace WTF
7442

75-
#endif
43+
#endif // USE(GLIB)

Source/WebCore/ChangeLog

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
2018-12-04 Carlos Garcia Campos <[email protected]>
2+
3+
[SOUP] Move URLSoup back to WebCore after r238771
4+
https://bugs.webkit.org/show_bug.cgi?id=192306
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and
9+
URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL
10+
header.
11+
12+
* platform/Cookie.h:
13+
* platform/SharedBuffer.h:
14+
* platform/SourcesSoup.txt:
15+
* platform/network/soup/CookieSoup.cpp:
16+
* platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h.
17+
* platform/network/soup/NetworkStorageSessionSoup.cpp:
18+
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
19+
(WebCore::NetworkStorageSession::deleteCookie const):
20+
(WebCore::NetworkStorageSession::getCookies):
21+
(WebCore::NetworkStorageSession::getRawCookies const):
22+
(WebCore::cookiesForSession):
23+
* platform/network/soup/ResourceErrorSoup.cpp:
24+
(WebCore::failingURI):
25+
* platform/network/soup/ResourceHandleSoup.cpp:
26+
* platform/network/soup/ResourceRequest.h:
27+
(WebCore::ResourceRequest::ResourceRequest):
28+
* platform/network/soup/ResourceRequestSoup.cpp:
29+
(WebCore::ResourceRequest::updateSoupMessageMembers const):
30+
(WebCore::ResourceRequest::updateFromSoupMessage):
31+
(WebCore::ResourceRequest::createSoupURI const):
32+
* platform/network/soup/ResourceResponseSoup.cpp:
33+
(WebCore::ResourceResponse::updateFromSoupMessage):
34+
* platform/network/soup/SocketStreamHandleImpl.h:
35+
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
36+
(WebCore::SocketStreamHandleImpl::create):
37+
* platform/network/soup/SoupNetworkSession.cpp:
38+
* platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
39+
(WebCore::soupURIToURL):
40+
(WebCore::urlToSoupURI):
41+
* platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp.
42+
143
2018-12-04 Devin Rousso <[email protected]>
244

345
Web Inspector: Audit: tests should support async operations

Source/WebCore/platform/Cookie.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include <objc/objc.h>
3535
#endif
3636

37+
#if USE(SOUP)
38+
typedef struct _SoupCookie SoupCookie;
39+
#endif
40+
3741
namespace WebCore {
3842

3943
struct Cookie {

Source/WebCore/platform/SharedBuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#endif
4141

4242
#if USE(SOUP)
43-
#include <wtf/glib/GUniquePtrSoup.h>
43+
#include "GUniquePtrSoup.h"
4444
#endif
4545

4646
#if USE(GLIB)

Source/WebCore/platform/SourcesSoup.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ platform/network/soup/ResourceResponseSoup.cpp
3737
platform/network/soup/SocketStreamHandleImplSoup.cpp
3838
platform/network/soup/SoupNetworkSession.cpp
3939
platform/network/soup/SynchronousLoaderClientSoup.cpp
40+
platform/network/soup/URLSoup.cpp
4041
platform/network/soup/WebKitSoupRequestGeneric.cpp
4142

4243
platform/soup/PublicSuffixSoup.cpp

Source/WebCore/platform/network/soup/CookieSoup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "config.h"
2828
#include "Cookie.h"
2929

30+
#include <libsoup/soup.h>
3031
#include <wtf/DateMath.h>
3132

3233
namespace WebCore {

0 commit comments

Comments
 (0)