Changeset 250457 in webkit


Ignore:
Timestamp:
Sep 27, 2019 1:55:59 PM (5 years ago)
Author:
achristensen@apple.com
Message:

Move legacy custom protocol registration from process pool to NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=202315

Reviewed by Tim Horton.

Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.

  • UIProcess/WebProcessPool.h:
Location:
trunk/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r250456 r250457  
     12019-09-27  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move legacy custom protocol registration from process pool to NetworkProcessProxy
     4        https://bugs.webkit.org/show_bug.cgi?id=202315
     5
     6        Reviewed by Tim Horton.
     7
     8        Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
     9        In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.
     10
     11        * UIProcess/WebProcessPool.cpp:
     12        (WebKit::WebProcessPool::ensureNetworkProcess):
     13        (WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
     14        (WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
     15        (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
     16        (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.
     17        * UIProcess/WebProcessPool.h:
     18
    1192019-09-27  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp

    r250421 r250457  
    11391139    auto addResult = context->priv->uriSchemeHandlers.set(String::fromUTF8(scheme), handler.get());
    11401140    if (addResult.isNewEntry)
    1141         context->priv->processPool->registerSchemeForCustomProtocol(String::fromUTF8(scheme));
     1141        WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(String::fromUTF8(scheme));
    11421142}
    11431143
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r250413 r250457  
    3232#include "DownloadProxyMessages.h"
    3333#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
     34#include "LegacyCustomProtocolManagerMessages.h"
    3435#include "LegacyCustomProtocolManagerProxyMessages.h"
    3536#endif
     
    12581259}
    12591260
     1261void NetworkProcessProxy::registerSchemeForLegacyCustomProtocol(const String& scheme)
     1262{
     1263#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
     1264    send(Messages::LegacyCustomProtocolManager::RegisterScheme(scheme), 0);
     1265#else
     1266    UNUSED_PARAM(scheme);
     1267#endif
     1268}
     1269
     1270void NetworkProcessProxy::unregisterSchemeForLegacyCustomProtocol(const String& scheme)
     1271{
     1272#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
     1273    send(Messages::LegacyCustomProtocolManager::UnregisterScheme(scheme), 0);
     1274#else
     1275    UNUSED_PARAM(scheme);
     1276#endif
     1277}
     1278
    12601279void NetworkProcessProxy::takeUploadAssertion()
    12611280{
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r250413 r250457  
    192192    void sendProcessWillSuspendImminentlyForTesting();
    193193
     194    void registerSchemeForLegacyCustomProtocol(const String&);
     195    void unregisterSchemeForLegacyCustomProtocol(const String&);
     196
    194197private:
    195198    // AuxiliaryProcessProxy
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r250456 r250457  
    103103#include <wtf/text/StringConcatenateNumbers.h>
    104104
    105 #if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
    106 #include "LegacyCustomProtocolManagerMessages.h"
    107 #endif
    108 
    109105#if ENABLE(SERVICE_CONTROLS)
    110106#include "ServicesController.h"
     
    494490
    495491    for (auto& scheme : globalURLSchemesWithCustomProtocolHandlers())
    496         parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
    497 
    498     for (auto& scheme : m_urlSchemesRegisteredForCustomProtocols)
    499492        parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
    500493
     
    15181511
    15191512    globalURLSchemesWithCustomProtocolHandlers().add(urlScheme);
    1520     for (auto* processPool : allProcessPools())
    1521         processPool->registerSchemeForCustomProtocol(urlScheme);
     1513    for (auto* processPool : allProcessPools()) {
     1514        if (auto* networkProcess = processPool->networkProcess())
     1515            networkProcess->registerSchemeForLegacyCustomProtocol(urlScheme);
     1516    }
    15221517}
    15231518
     
    15281523
    15291524    globalURLSchemesWithCustomProtocolHandlers().remove(urlScheme);
    1530     for (auto* processPool : allProcessPools())
    1531         processPool->unregisterSchemeForCustomProtocol(urlScheme);
     1525    for (auto* processPool : allProcessPools()) {
     1526        if (auto* networkProcess = processPool->networkProcess())
     1527            networkProcess->unregisterSchemeForLegacyCustomProtocol(urlScheme);
     1528    }
    15321529}
    15331530
     
    19691966{
    19701967    m_plugInAutoStartProvider.setAutoStartOriginsFilteringOutEntriesAddedAfterTime(dictionary, time);
    1971 }
    1972 
    1973 void WebProcessPool::registerSchemeForCustomProtocol(const String& scheme)
    1974 {
    1975 #if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
    1976     if (!globalURLSchemesWithCustomProtocolHandlers().contains(scheme))
    1977         m_urlSchemesRegisteredForCustomProtocols.add(scheme);
    1978     sendToNetworkingProcess(Messages::LegacyCustomProtocolManager::RegisterScheme(scheme));
    1979 #endif
    1980 }
    1981 
    1982 void WebProcessPool::unregisterSchemeForCustomProtocol(const String& scheme)
    1983 {
    1984 #if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
    1985     m_urlSchemesRegisteredForCustomProtocols.remove(scheme);
    1986     sendToNetworkingProcess(Messages::LegacyCustomProtocolManager::UnregisterScheme(scheme));
    1987 #endif
    19881968}
    19891969
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r250426 r250457  
    411411    void resetHSTSHostsAddedAfterDate(double startDateIntervalSince1970);
    412412
    413     void registerSchemeForCustomProtocol(const String&);
    414     void unregisterSchemeForCustomProtocol(const String&);
    415 
    416413    static void registerGlobalURLSchemeAsHavingCustomProtocolHandlers(const String&);
    417414    static void unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(const String&);
     
    678675    WebCore::SoupNetworkProxySettings m_networkProxySettings;
    679676#endif
    680     HashSet<String, ASCIICaseInsensitiveHash> m_urlSchemesRegisteredForCustomProtocols;
    681677
    682678#if PLATFORM(MAC)
Note: See TracChangeset for help on using the changeset viewer.