Changeset 249379 in webkit


Ignore:
Timestamp:
Sep 2, 2019 2:31:39 AM (5 years ago)
Author:
youenn@apple.com
Message:

Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
https://bugs.webkit.org/show_bug.cgi?id=201300

Reviewed by Alex Christensen.

Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
Pass the process identifier at creation time.
This will allow to have the message registry be moved to NetworkProcess
so as to check port activity between processes.
This identifier might also be used in the future for other connections like
service worker context/client/server identifiers.

No observable change of behavior.

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::create):
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):

  • NetworkProcess/NetworkConnectionToWebProcess.h:

(WebKit::NetworkConnectionToWebProcess::webProcessIdentifier const):

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::resume):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • Platform/IPC/Connection.h:

(IPC::Connection::sendWithAsyncReply):
Allow to pass send options.

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
Make use of async reply to simplify the handling of lambdas.
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
(WebKit::NetworkProcessProxy::didFinishLaunching):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/Network/NetworkProcessProxy.messages.in:
Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r249378 r249379  
    2555425554                                1CA0C2EC21EED6F600A11860 /* WHLSLLiteralTypeChecker.cpp */,
    2555525555                                1CA0C2EA21EED6F500A11860 /* WHLSLLiteralTypeChecker.h */,
    25556                                 52256CAA230F14AD0043E12F /* WHLSLNameSpace.h */,
    2555725556                                C234A98D21E88884003C984D /* WHLSLNameContext.cpp */,
    2555825557                                C234A98E21E88885003C984D /* WHLSLNameContext.h */,
    2555925558                                C234A98A21E8883E003C984D /* WHLSLNameResolver.cpp */,
    2556025559                                C234A98C21E8883E003C984D /* WHLSLNameResolver.h */,
     25560                                52256CAA230F14AD0043E12F /* WHLSLNameSpace.h */,
    2556125561                                C21BF73721CD8A0200227979 /* WHLSLParser.cpp */,
    2556225562                                C21BF73821CD8A0300227979 /* WHLSLParser.h */,
  • trunk/Source/WebKit/ChangeLog

    r249378 r249379  
     12019-09-02  Youenn Fablet  <youenn@apple.com>
     2
     3        Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
     4        https://bugs.webkit.org/show_bug.cgi?id=201300
     5
     6        Reviewed by Alex Christensen.
     7
     8        Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
     9        Pass the process identifier at creation time.
     10        This will allow to have the message registry be moved to NetworkProcess
     11        so as to check port activity between processes.
     12        This identifier might also be used in the future for other connections like
     13        service worker context/client/server identifiers.
     14
     15        No observable change of behavior.
     16
     17        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     18        (WebKit::NetworkConnectionToWebProcess::create):
     19        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
     20        * NetworkProcess/NetworkConnectionToWebProcess.h:
     21        (WebKit::NetworkConnectionToWebProcess::webProcessIdentifier const):
     22        * NetworkProcess/NetworkProcess.cpp:
     23        (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
     24        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
     25        (WebKit::NetworkProcess::actualPrepareToSuspend):
     26        (WebKit::NetworkProcess::resume):
     27        * NetworkProcess/NetworkProcess.h:
     28        * NetworkProcess/NetworkProcess.messages.in:
     29        * Platform/IPC/Connection.h:
     30        (IPC::Connection::sendWithAsyncReply):
     31        Allow to pass send options.
     32        * UIProcess/Network/NetworkProcessProxy.cpp:
     33        (WebKit::NetworkProcessProxy::NetworkProcessProxy):
     34        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
     35        Make use of async reply to simplify the handling of lambdas.
     36        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
     37        (WebKit::NetworkProcessProxy::didFinishLaunching):
     38        * UIProcess/Network/NetworkProcessProxy.h:
     39        * UIProcess/Network/NetworkProcessProxy.messages.in:
     40
    1412019-09-02  Youenn Fablet  <youenn@apple.com>
    242
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r249126 r249379  
    7676using namespace WebCore;
    7777
    78 Ref<NetworkConnectionToWebProcess> NetworkConnectionToWebProcess::create(NetworkProcess& networkProcess, IPC::Connection::Identifier connectionIdentifier)
    79 {
    80     return adoptRef(*new NetworkConnectionToWebProcess(networkProcess, connectionIdentifier));
    81 }
    82 
    83 NetworkConnectionToWebProcess::NetworkConnectionToWebProcess(NetworkProcess& networkProcess, IPC::Connection::Identifier connectionIdentifier)
     78Ref<NetworkConnectionToWebProcess> NetworkConnectionToWebProcess::create(NetworkProcess& networkProcess, WebCore::ProcessIdentifier webProcessIdentifier, IPC::Connection::Identifier connectionIdentifier)
     79{
     80    return adoptRef(*new NetworkConnectionToWebProcess(networkProcess, webProcessIdentifier, connectionIdentifier));
     81}
     82
     83NetworkConnectionToWebProcess::NetworkConnectionToWebProcess(NetworkProcess& networkProcess, WebCore::ProcessIdentifier webProcessIdentifier, IPC::Connection::Identifier connectionIdentifier)
    8484    : m_connection(IPC::Connection::createServerConnection(connectionIdentifier, *this))
    8585    , m_networkProcess(networkProcess)
     
    8787    , m_mdnsRegister(*this)
    8888#endif
     89    , m_webProcessIdentifier(webProcessIdentifier)
    8990{
    9091    RELEASE_ASSERT(RunLoop::isMain());
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r249126 r249379  
    8282    using RegistrableDomain = WebCore::RegistrableDomain;
    8383
    84     static Ref<NetworkConnectionToWebProcess> create(NetworkProcess&, IPC::Connection::Identifier);
     84    static Ref<NetworkConnectionToWebProcess> create(NetworkProcess&, WebCore::ProcessIdentifier, IPC::Connection::Identifier);
    8585    virtual ~NetworkConnectionToWebProcess();
    8686
     
    145145    void removeSocketChannel(uint64_t identifier);
    146146
     147    WebCore::ProcessIdentifier webProcessIdentifier() const { return m_webProcessIdentifier; }
     148
    147149private:
    148     NetworkConnectionToWebProcess(NetworkProcess&, IPC::Connection::Identifier);
     150    NetworkConnectionToWebProcess(NetworkProcess&, WebCore::ProcessIdentifier, IPC::Connection::Identifier);
    149151
    150152    void didFinishPreconnection(uint64_t preconnectionIdentifier, const WebCore::ResourceError&);
     
    309311    std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
    310312#endif
     313    const WebCore::ProcessIdentifier m_webProcessIdentifier;
    311314};
    312315
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r249192 r249379  
    161161        if (!weakThis)
    162162            return;
    163         for (auto& webProcessConnection : weakThis->m_webProcessConnections)
     163        for (auto& webProcessConnection : weakThis->m_webProcessConnections.values())
    164164            webProcessConnection->setOnLineState(isOnLine);
    165165    });
     
    188188void NetworkProcess::removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess& connection)
    189189{
    190     auto count = m_webProcessConnections.removeAllMatching([&] (const auto& c) {
    191         return c.ptr() == &connection;
    192     });
    193     ASSERT_UNUSED(count, count == 1);
     190    ASSERT(m_webProcessConnections.contains(connection.webProcessIdentifier()));
     191    m_webProcessConnections.remove(connection.webProcessIdentifier());
    194192}
    195193
     
    385383}
    386384
    387 void NetworkProcess::createNetworkConnectionToWebProcess(bool isServiceWorkerProcess, WebCore::RegistrableDomain&& registrableDomain)
     385static inline Optional<std::pair<IPC::Connection::Identifier, IPC::Attachment>> createIPCConnectionToWebProcess()
    388386{
    389387#if USE(UNIX_DOMAIN_SOCKETS)
    390388    IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection();
    391 
    392     auto connection = NetworkConnectionToWebProcess::create(*this, socketPair.server);
    393     m_webProcessConnections.append(WTFMove(connection));
    394 
    395     IPC::Attachment clientSocket(socketPair.client);
    396     parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientSocket), 0);
     389    return std::make_pair(socketPair.server, IPC::Attachment { socketPair.client });
    397390#elif OS(DARWIN)
    398391    // Create the listening port.
     
    407400        CRASH();
    408401    }
    409 
    410     // Create a listening connection.
    411     auto connection = NetworkConnectionToWebProcess::create(*this, IPC::Connection::Identifier(listeningPort));
    412     m_webProcessConnections.append(WTFMove(connection));
    413 
    414     IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
    415     parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientPort), 0);
     402    return std::make_pair(IPC::Connection::Identifier { listeningPort }, IPC::Attachment { listeningPort, MACH_MSG_TYPE_MAKE_SEND });
    416403#elif OS(WINDOWS)
    417404    IPC::Connection::Identifier serverIdentifier, clientIdentifier;
     
    420407        CRASH();
    421408    }
    422 
    423     auto connection = NetworkConnectionToWebProcess::create(*this, serverIdentifier);
    424     m_webProcessConnections.append(WTFMove(connection));
    425 
    426     IPC::Attachment clientSocket(clientIdentifier);
    427     parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientSocket), 0);
     409    return std::make_pair(serverIdentifier, IPC::Attachment { clientIdentifier });
    428410#else
    429411    notImplemented();
    430 #endif
    431 
    432     if (!m_webProcessConnections.isEmpty())
    433         m_webProcessConnections.last()->setOnLineState(NetworkStateNotifier::singleton().onLine());
     412    return { };
     413#endif
     414}
     415
     416void NetworkProcess::createNetworkConnectionToWebProcess(ProcessIdentifier identifier, bool isServiceWorkerProcess, WebCore::RegistrableDomain&& registrableDomain, CompletionHandler<void(Optional<IPC::Attachment>&&)>&& completionHandler)
     417{
     418    auto ipcConnection = createIPCConnectionToWebProcess();
     419    if (!ipcConnection) {
     420        completionHandler({ });
     421        return;
     422    }
     423
     424    auto newConnection = NetworkConnectionToWebProcess::create(*this, identifier, ipcConnection->first);
     425    auto& connection = newConnection.get();
     426
     427    ASSERT(!m_webProcessConnections.contains(identifier));
     428    m_webProcessConnections.add(identifier, WTFMove(newConnection));
     429
     430    completionHandler(WTFMove(ipcConnection->second));
     431
     432    connection.setOnLineState(NetworkStateNotifier::singleton().onLine());
    434433   
    435434#if ENABLE(SERVICE_WORKER)
    436     if (isServiceWorkerProcess && !m_webProcessConnections.isEmpty()) {
     435    if (isServiceWorkerProcess) {
    437436        ASSERT(parentProcessHasServiceWorkerEntitlement());
    438437        ASSERT(m_waitingForServerToContextProcessConnection);
    439         auto contextConnection = WebSWServerToContextConnection::create(*this, registrableDomain, m_webProcessConnections.last()->connection());
     438        auto contextConnection = WebSWServerToContextConnection::create(*this, registrableDomain, connection.connection());
    440439        auto addResult = m_serverToContextConnections.add(WTFMove(registrableDomain), contextConnection.copyRef());
    441440        ASSERT_UNUSED(addResult, addResult.isNewEntry);
     
    451450#endif
    452451
    453     m_storageManagerSet->addConnection(m_webProcessConnections.last()->connection());
     452    m_storageManagerSet->addConnection(connection.connection());
    454453}
    455454
     
    20832082    platformSyncAllCookies([callbackAggregator] { });
    20842083
    2085     for (auto& connection : m_webProcessConnections)
     2084    for (auto& connection : m_webProcessConnections.values())
    20862085        connection->cleanupForSuspension([callbackAggregator] { });
    20872086
     
    21572156
    21582157    platformProcessDidResume();
    2159     for (auto& connection : m_webProcessConnections)
     2158    for (auto& connection : m_webProcessConnections.values())
    21602159        connection->endSuspension();
    21612160
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.h

    r249192 r249379  
    391391    void didReceiveSyncNetworkProcessMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
    392392    void initializeNetworkProcess(NetworkProcessCreationParameters&&);
    393     void createNetworkConnectionToWebProcess(bool isServiceWorkerProcess, WebCore::RegistrableDomain&&);
     393    void createNetworkConnectionToWebProcess(WebCore::ProcessIdentifier, bool isServiceWorkerProcess, WebCore::RegistrableDomain&&, CompletionHandler<void(Optional<IPC::Attachment>&&)>&&);
    394394
    395395    void fetchWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, uint64_t callbackID);
     
    480480
    481481    // Connections to WebProcesses.
    482     Vector<Ref<NetworkConnectionToWebProcess>> m_webProcessConnections;
     482    HashMap<WebCore::ProcessIdentifier, Ref<NetworkConnectionToWebProcess>> m_webProcessConnections;
    483483
    484484    String m_diskCacheDirectory;
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in

    r248856 r249379  
    2626
    2727    # Creates a connection for communication with a WebProcess
    28     CreateNetworkConnectionToWebProcess(bool isServiceWorkerProcess, WebCore::RegistrableDomain registrableDomain)
     28    CreateNetworkConnectionToWebProcess(WebCore::ProcessIdentifier processIdentifier, bool isServiceWorkerProcess, WebCore::RegistrableDomain registrableDomain) -> (Optional<IPC::Attachment> connectionIdentifier) Async
    2929
    3030#if USE(SOUP)
  • trunk/Source/WebKit/Platform/IPC/Connection.h

    r248846 r249379  
    184184    void postConnectionDidCloseOnConnectionWorkQueue();
    185185
    186     template<typename T, typename C> void sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID = 0);
     186    template<typename T, typename C> void sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID = 0, OptionSet<SendOption> = { });
    187187    template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { });
    188188    template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { });
     
    190190   
    191191    template<typename T, typename C, typename U>
    192     void sendWithAsyncReply(T&& message, C&& completionHandler, ObjectIdentifier<U> destinationID = { })
    193     {
    194         sendWithAsyncReply<T, C>(WTFMove(message), WTFMove(completionHandler), destinationID.toUInt64());
     192    void sendWithAsyncReply(T&& message, C&& completionHandler, ObjectIdentifier<U> destinationID = { }, OptionSet<SendOption> sendOptions = { })
     193    {
     194        sendWithAsyncReply<T, C>(WTFMove(message), WTFMove(completionHandler), destinationID.toUInt64(), sendOptions);
    195195    }
    196196   
     
    445445
    446446template<typename T, typename C>
    447 void Connection::sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID)
     447void Connection::sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID, OptionSet<SendOption> sendOptions)
    448448{
    449449    COMPILE_ASSERT(!T::isSync, AsyncMessageExpected);
     
    453453    encoder->encode(listenerID);
    454454    encoder->encode(message.arguments());
    455     sendMessage(WTFMove(encoder), { });
     455    sendMessage(WTFMove(encoder), sendOptions);
    456456    addAsyncReplyHandler(*this, listenerID, [completionHandler = WTFMove(completionHandler)] (Decoder* decoder) mutable {
    457457        if (decoder && !decoder->isInvalid())
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r249329 r249379  
    8080    : AuxiliaryProcessProxy(processPool.alwaysRunsAtBackgroundPriority())
    8181    , m_processPool(processPool)
    82     , m_numPendingConnectionRequests(0)
    8382#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
    8483    , m_customProtocolManagerProxy(*this)
     
    105104        m_downloadProxyMap->invalidate();
    106105
    107     for (auto& reply : m_pendingConnectionReplies)
    108         reply.second({ });
     106    for (auto& request : m_connectionRequests.values())
     107        request.reply({ });
    109108}
    110109
     
    136135void NetworkProcessProxy::getNetworkProcessConnection(WebProcessProxy& webProcessProxy, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&& reply)
    137136{
    138     m_pendingConnectionReplies.append(std::make_pair(makeWeakPtr(webProcessProxy), WTFMove(reply)));
    139 
    140     if (state() == State::Launching) {
    141         m_numPendingConnectionRequests++;
    142         return;
    143     }
    144 
     137    m_connectionRequests.add(++m_connectionRequestIdentifier, ConnectionRequest { makeWeakPtr(webProcessProxy), WTFMove(reply) });
     138    if (state() == State::Launching)
     139        return;
     140    openNetworkProcessConnection(m_connectionRequestIdentifier, webProcessProxy);
     141}
     142
     143void NetworkProcessProxy::openNetworkProcessConnection(uint64_t connectionRequestIdentifier, WebProcessProxy& webProcessProxy)
     144{
    145145    bool isServiceWorkerProcess = false;
    146146    RegistrableDomain registrableDomain;
     
    152152#endif
    153153
    154     connection()->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(isServiceWorkerProcess, registrableDomain), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
     154    connection()->sendWithAsyncReply(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), isServiceWorkerProcess, registrableDomain }, [this, weakThis = makeWeakPtr(this), webProcessProxy = makeWeakPtr(webProcessProxy), connectionRequestIdentifier](auto&& connectionIdentifier) mutable {
     155        if (!weakThis)
     156            return;
     157
     158        if (!connectionIdentifier) {
     159            // Network process probably crashed, the connection request should have been moved.
     160            ASSERT(m_connectionRequests.isEmpty());
     161            return;
     162        }
     163
     164        ASSERT(m_connectionRequests.contains(connectionRequestIdentifier));
     165        auto request = m_connectionRequests.take(connectionRequestIdentifier);
     166
     167#if USE(UNIX_DOMAIN_SOCKETS) || OS(WINDOWS)
     168        request.reply(*connectionIdentifier);
     169#elif OS(DARWIN)
     170        MESSAGE_CHECK(MACH_PORT_VALID(connectionIdentifier->port()));
     171        request.reply(IPC::Attachment { connectionIdentifier->port(), MACH_MSG_TYPE_MOVE_SEND });
     172#else
     173        notImplemented();
     174#endif
     175    }, 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
    155176}
    156177
     
    231252    clearCallbackStates();
    232253
    233     Vector<std::pair<RefPtr<WebProcessProxy>, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>> pendingReplies;
    234     pendingReplies.reserveInitialCapacity(m_pendingConnectionReplies.size());
    235     for (auto& reply : m_pendingConnectionReplies) {
    236         if (reply.first)
    237             pendingReplies.append(std::make_pair(makeRefPtr(reply.first.get()), WTFMove(reply.second)));
     254    Vector<std::pair<RefPtr<WebProcessProxy>, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>> pendingRequests;
     255    pendingRequests.reserveInitialCapacity(m_connectionRequests.size());
     256    for (auto& request : m_connectionRequests.values()) {
     257        if (request.webProcess)
     258            pendingRequests.uncheckedAppend(std::make_pair(makeRefPtr(request.webProcess.get()), WTFMove(request.reply)));
    238259        else
    239             reply.second({ });
    240     }
    241     m_pendingConnectionReplies.clear();
     260            request.reply({ });
     261    }
     262    m_connectionRequests.clear();
    242263
    243264    // Tell the network process manager to forget about this network process proxy. This will cause us to be deleted.
    244     m_processPool.networkProcessCrashed(*this, WTFMove(pendingReplies));
     265    m_processPool.networkProcessCrashed(*this, WTFMove(pendingRequests));
    245266}
    246267
     
    297318void NetworkProcessProxy::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
    298319{
    299 }
    300 
    301 void NetworkProcessProxy::didCreateNetworkConnectionToWebProcess(const IPC::Attachment& connectionIdentifier)
    302 {
    303     ASSERT(!m_pendingConnectionReplies.isEmpty());
    304 
    305     // Grab the first pending connection reply.
    306     auto reply = m_pendingConnectionReplies.takeFirst().second;
    307 
    308 #if USE(UNIX_DOMAIN_SOCKETS) || OS(WINDOWS)
    309     reply(connectionIdentifier);
    310 #elif OS(DARWIN)
    311     MESSAGE_CHECK(MACH_PORT_VALID(connectionIdentifier.port()));
    312     reply(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND));
    313 #else
    314     notImplemented();
    315 #endif
    316320}
    317321
     
    395399    }
    396400
    397     for (unsigned i = 0; i < m_numPendingConnectionRequests; ++i)
    398         connection()->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(false, { }), 0);
    399    
    400     m_numPendingConnectionRequests = 0;
     401    auto connectionRequests = WTFMove(m_connectionRequests);
     402    for (auto& connectionRequest : connectionRequests.values()) {
     403        if (connectionRequest.webProcess)
     404            getNetworkProcessConnection(*connectionRequest.webProcess, WTFMove(connectionRequest.reply));
     405        else
     406            connectionRequest.reply({ });
     407    }
    401408
    402409#if PLATFORM(COCOA)
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r249277 r249379  
    213213    // Message handlers
    214214    void didReceiveNetworkProcessProxyMessage(IPC::Connection&, IPC::Decoder&);
    215     void didCreateNetworkConnectionToWebProcess(const IPC::Attachment&);
    216215    void didReceiveAuthenticationChallenge(PAL::SessionID, WebCore::PageIdentifier, const Optional<WebCore::SecurityOriginData>&, WebCore::AuthenticationChallenge&&, uint64_t challengeID);
    217216    void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&);
     
    251250    void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
    252251
     252    void openNetworkProcessConnection(uint64_t connectionRequestIdentifier, WebProcessProxy&);
     253
    253254    void processAuthenticationChallenge(PAL::SessionID, Ref<AuthenticationChallengeProxy>&&);
    254255
    255256    WebProcessPool& m_processPool;
    256    
    257     unsigned m_numPendingConnectionRequests;
    258     Deque<std::pair<WeakPtr<WebProcessProxy>, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>> m_pendingConnectionReplies;
     257
     258    struct ConnectionRequest {
     259        WeakPtr<WebProcessProxy> webProcess;
     260        Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply reply;
     261    };
     262    uint64_t m_connectionRequestIdentifier { 0 };
     263    HashMap<uint64_t, ConnectionRequest> m_connectionRequests;
    259264
    260265    HashMap<uint64_t, CompletionHandler<void(WebsiteData)>> m_pendingFetchWebsiteDataCallbacks;
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in

    r249277 r249379  
    2222
    2323messages -> NetworkProcessProxy LegacyReceiver {
    24     DidCreateNetworkConnectionToWebProcess(IPC::Attachment connectionIdentifier)
    25 
    2624    DidReceiveAuthenticationChallenge(PAL::SessionID sessionID, WebCore::PageIdentifier pageID, Optional<WebCore::SecurityOriginData> topOrigin, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
    2725
Note: See TracChangeset for help on using the changeset viewer.