⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 272301 in webkit


Ignore:
Timestamp:
Feb 3, 2021, 12:30:22 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK][WPE] Reduce the use of SoupURI in preparation for libsoup3
https://bugs.webkit.org/show_bug.cgi?id=221251

Reviewed by Adrian Perez de Castro.

Source/WebCore:

  • platform/network/soup/AuthenticationChallengeSoup.cpp:

(WebCore::protectionSpaceServerTypeFromURL):
(WebCore::protectionSpaceFromSoupAuthAndURL):
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::protectionSpaceServerTypeFromURI): Deleted.
(WebCore::protectionSpaceFromSoupAuthAndMessage): Deleted.

Source/WebKit:

  • UIProcess/API/glib/WebKitURISchemeRequest.cpp:

(webkit_uri_scheme_request_get_scheme):
(webkit_uri_scheme_request_get_path):

  • UIProcess/API/glib/WebKitWebView.cpp:

(webkit_web_view_load_uri):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r272300 r272301  
     12021-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Reduce the use of SoupURI in preparation for libsoup3
     4        https://bugs.webkit.org/show_bug.cgi?id=221251
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        * platform/network/soup/AuthenticationChallengeSoup.cpp:
     9        (WebCore::protectionSpaceServerTypeFromURL):
     10        (WebCore::protectionSpaceFromSoupAuthAndURL):
     11        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
     12        (WebCore::protectionSpaceServerTypeFromURI): Deleted.
     13        (WebCore::protectionSpaceFromSoupAuthAndMessage): Deleted.
     14
    1152021-02-02  Antti Koivisto  <antti@apple.com>
    216
  • trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp

    r220583 r272301  
    3535namespace WebCore {
    3636
    37 static ProtectionSpaceServerType protectionSpaceServerTypeFromURI(SoupURI* uri, bool isForProxy)
     37static ProtectionSpaceServerType protectionSpaceServerTypeFromURL(const URL& url, bool isForProxy)
    3838{
    39     if (uri->scheme == SOUP_URI_SCHEME_HTTPS)
     39    if (url.protocolIs("https"))
    4040        return isForProxy ? ProtectionSpaceProxyHTTPS : ProtectionSpaceServerHTTPS;
    41     if (uri->scheme == SOUP_URI_SCHEME_HTTP)
     41    if (url.protocolIs("http"))
    4242        return isForProxy ? ProtectionSpaceProxyHTTP : ProtectionSpaceServerHTTP;
    43     if (uri->scheme == SOUP_URI_SCHEME_FTP)
     43    if (url.protocolIs("ftp"))
    4444        return isForProxy ? ProtectionSpaceProxyFTP : ProtectionSpaceServerFTP;
    4545    return isForProxy ? ProtectionSpaceProxyHTTP : ProtectionSpaceServerHTTP;
    4646}
    4747
    48 static ProtectionSpace protectionSpaceFromSoupAuthAndMessage(SoupAuth* soupAuth, SoupMessage* message)
     48static ProtectionSpace protectionSpaceFromSoupAuthAndURL(SoupAuth* soupAuth, const URL& url)
    4949{
    5050    const char* schemeName = soup_auth_get_scheme_name(soupAuth);
     
    6161        scheme = ProtectionSpaceAuthenticationSchemeUnknown;
    6262
    63     SoupURI* soupURI = soup_message_get_uri(message);
    64     return ProtectionSpace(String::fromUTF8(soup_uri_get_host(soupURI)), soup_uri_get_port(soupURI),
    65         protectionSpaceServerTypeFromURI(soupURI, soup_auth_is_for_proxy(soupAuth)),
     63    return ProtectionSpace(url.host().toString(), static_cast<int>(url.port().valueOr(0)),
     64        protectionSpaceServerTypeFromURL(url, soup_auth_is_for_proxy(soupAuth)),
    6665        String::fromUTF8(soup_auth_get_realm(soupAuth)), scheme);
    6766}
    6867
    6968AuthenticationChallenge::AuthenticationChallenge(SoupMessage* soupMessage, SoupAuth* soupAuth, bool retrying, AuthenticationClient* client)
    70     : AuthenticationChallengeBase(protectionSpaceFromSoupAuthAndMessage(soupAuth, soupMessage),
    71         Credential(), // proposedCredentials
    72         retrying ? 1 : 0, // previousFailureCount
    73         soupMessage, // failureResponse
    74         ResourceError::authenticationError(soupMessage))
     69    : AuthenticationChallengeBase(protectionSpaceFromSoupAuthAndURL(soupAuth, soupURIToURL(soup_message_get_uri(soupMessage)))
     70        , Credential() // proposedCredentials
     71        , retrying ? 1 : 0 // previousFailureCount
     72        , soupMessage // failureResponse
     73        , ResourceError::authenticationError(soupMessage))
    7574    , m_soupMessage(soupMessage)
    7675    , m_soupAuth(soupAuth)
  • trunk/Source/WebKit/ChangeLog

    r272241 r272301  
     12021-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Reduce the use of SoupURI in preparation for libsoup3
     4        https://bugs.webkit.org/show_bug.cgi?id=221251
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
     9        (webkit_uri_scheme_request_get_scheme):
     10        (webkit_uri_scheme_request_get_path):
     11        * UIProcess/API/glib/WebKitWebView.cpp:
     12        (webkit_web_view_load_uri):
     13
    1142021-02-02  Per Arne Vollan  <pvollan@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp

    r263890 r272301  
    2727#include "WebKitWebView.h"
    2828#include "WebPageProxy.h"
    29 #include <WebCore/GUniquePtrSoup.h>
    3029#include <WebCore/HTTPParsers.h>
    3130#include <WebCore/MIMETypeRegistry.h>
    3231#include <WebCore/ResourceError.h>
    33 #include <WebCore/URLSoup.h>
    34 #include <libsoup/soup.h>
    3532#include <wtf/glib/GRefPtr.h>
    3633#include <wtf/glib/RunLoopSourcePriority.h>
     
    6562    RefPtr<WebPageProxy> initiatingPage;
    6663    CString uri;
    67     GUniquePtr<SoupURI> soupURI;
     64    CString uriScheme;
     65    CString uriPath;
    6866
    6967    GRefPtr<GInputStream> stream;
     
    107105    g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), nullptr);
    108106
    109     if (!request->priv->soupURI)
    110         request->priv->soupURI = urlToSoupURI(request->priv->task->request().url());
    111 
    112     return request->priv->soupURI->scheme;
     107    if (request->priv->uriScheme.isNull())
     108        request->priv->uriScheme = request->priv->task->request().url().protocol().toString().utf8();
     109
     110    return request->priv->uriScheme.data();
    113111}
    114112
     
    143141    g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), nullptr);
    144142
    145     if (!request->priv->soupURI)
    146         request->priv->soupURI = urlToSoupURI(request->priv->task->request().url());
    147 
    148     return request->priv->soupURI->path;
     143    if (request->priv->uriPath.isNull())
     144        request->priv->uriPath = request->priv->task->request().url().path().toString().utf8();
     145
     146    return request->priv->uriPath.data();
    149147}
    150148
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp

    r271354 r272301  
    7272#include <jsc/JSCContextPrivate.h>
    7373#include <WebCore/CertificateInfo.h>
    74 #include <WebCore/GUniquePtrSoup.h>
    7574#include <WebCore/JSDOMExceptionHandling.h>
    7675#include <WebCore/PlatformScreen.h>
    7776#include <WebCore/RefPtrCairo.h>
    78 #include <WebCore/URLSoup.h>
    7977#include <glib/gi18n-lib.h>
     78#include <libsoup/soup.h>
    8079#include <wtf/SetForScope.h>
    8180#include <wtf/URL.h>
     
    30213020    g_return_if_fail(uri);
    30223021
    3023     GUniquePtr<SoupURI> soupURI(soup_uri_new(uri));
    3024     getPage(webView).loadRequest(soupURIToURL(soupURI.get()));
     3022    getPage(webView).loadRequest(URL({ }, String::fromUTF8(uri)));
    30253023}
    30263024
Note: See TracChangeset for help on using the changeset viewer.