Changeset 238655 in webkit


Ignore:
Timestamp:
Nov 28, 2018, 6:19:54 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Modernize BlobRegistry::writeBlobsToTemporaryFiles
https://bugs.webkit.org/show_bug.cgi?id=192117

Reviewed by Dean Jackson.

Source/WebCore:

No change in behavior. Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging
and manual completion handler management.

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):

  • platform/network/BlobRegistry.h:
  • platform/network/BlobRegistryImpl.cpp:

(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):

  • platform/network/BlobRegistryImpl.h:

Source/WebKit:

  • NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:

(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):

  • NetworkProcess/FileAPI/NetworkBlobRegistry.h:
  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/NetworkConnectionToWebProcess.messages.in:
  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::writeBlobToFilePath):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • UIProcess/ChildProcessProxy.h:

(WebKit::ChildProcessProxy::sendWithAsyncReply):

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::writeBlobToFilePath):
(WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/Network/NetworkProcessProxy.messages.in:
  • WebProcess/FileAPI/BlobRegistryProxy.cpp:

(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):

  • WebProcess/FileAPI/BlobRegistryProxy.h:
  • WebProcess/Network/NetworkProcessConnection.cpp:

(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
(WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.

  • WebProcess/Network/NetworkProcessConnection.h:
  • WebProcess/Network/NetworkProcessConnection.messages.in:
Location:
trunk/Source
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238653 r238655  
     12018-11-28  Alex Christensen  <achristensen@webkit.org>
     2
     3        Modernize BlobRegistry::writeBlobsToTemporaryFiles
     4        https://bugs.webkit.org/show_bug.cgi?id=192117
     5
     6        Reviewed by Dean Jackson.
     7
     8        No change in behavior.  Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging
     9        and manual completion handler management.
     10
     11        * bindings/js/SerializedScriptValue.cpp:
     12        (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
     13        * platform/network/BlobRegistry.h:
     14        * platform/network/BlobRegistryImpl.cpp:
     15        (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
     16        * platform/network/BlobRegistryImpl.h:
     17
    1182018-11-15  Megan Gardner  <megan_gardner@apple.com>
    219
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r238632 r238655  
    35673567    ASSERT(hasBlobURLs());
    35683568
    3569     RefPtr<SerializedScriptValue> protectedThis(this);
    35703569    // FIXME: Add m_sessionID as a parameter here.
    3571     blobRegistry().writeBlobsToTemporaryFiles(m_blobURLs, [completionHandler = WTFMove(completionHandler), this, protectedThis = WTFMove(protectedThis)] (auto& blobFilePaths) mutable {
     3570    blobRegistry().writeBlobsToTemporaryFiles(m_blobURLs, [completionHandler = WTFMove(completionHandler), this, protectedThis = makeRef(*this)] (auto&& blobFilePaths) mutable {
    35723571        ASSERT(isMainThread());
    35733572
  • trunk/Source/WebCore/platform/network/BlobRegistry.h

    r222113 r238655  
    3232#pragma once
    3333
    34 #include <functional>
    3534#include <wtf/Forward.h>
    36 #include <wtf/Function.h>
    3735
    3836namespace WebCore {
     
    6866    virtual unsigned long long blobSize(const URL&) = 0;
    6967
    70     virtual void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, WTF::Function<void (const Vector<String>& filePaths)>&& completionHandler) = 0;
     68    virtual void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) = 0;
    7169
    7270    virtual bool isBlobRegistryImpl() const { return false; }
  • trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp

    r236762 r238655  
    4242#include "ResourceRequest.h"
    4343#include "ResourceResponse.h"
     44#include <wtf/CompletionHandler.h>
    4445#include <wtf/MainThread.h>
    4546#include <wtf/NeverDestroyed.h>
     
    301302}
    302303
    303 void BlobRegistryImpl::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void(const Vector<String>& filePaths)>&& completionHandler)
     304void BlobRegistryImpl::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
    304305{
    305306    Vector<BlobForFileWriting> blobsForWriting;
     
    321322        }
    322323
    323         callOnMainThread([completionHandler = WTFMove(completionHandler), filePaths = WTFMove(filePaths)]() {
    324             completionHandler(filePaths);
     324        callOnMainThread([completionHandler = WTFMove(completionHandler), filePaths = WTFMove(filePaths)] () mutable {
     325            completionHandler(WTFMove(filePaths));
    325326        });
    326327    });
  • trunk/Source/WebCore/platform/network/BlobRegistryImpl.h

    r226470 r238655  
    7171    unsigned long long blobSize(const URL&) override;
    7272
    73     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler) override;
     73    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) override;
    7474
    7575    struct BlobForFileWriting {
  • trunk/Source/WebKit/ChangeLog

    r238654 r238655  
     1
     22018-11-28  Alex Christensen  <achristensen@webkit.org>
     3
     4        Modernize BlobRegistry::writeBlobsToTemporaryFiles
     5        https://bugs.webkit.org/show_bug.cgi?id=192117
     6
     7        Reviewed by Dean Jackson.
     8
     9        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
     10        (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
     11        (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
     12        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
     13        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     14        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
     15        * NetworkProcess/NetworkConnectionToWebProcess.h:
     16        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
     17        * NetworkProcess/NetworkProcess.cpp:
     18        (WebKit::NetworkProcess::writeBlobToFilePath):
     19        * NetworkProcess/NetworkProcess.h:
     20        * NetworkProcess/NetworkProcess.messages.in:
     21        * UIProcess/ChildProcessProxy.h:
     22        (WebKit::ChildProcessProxy::sendWithAsyncReply):
     23        * UIProcess/Network/NetworkProcessProxy.cpp:
     24        (WebKit::NetworkProcessProxy::didClose):
     25        (WebKit::NetworkProcessProxy::writeBlobToFilePath):
     26        (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
     27        * UIProcess/Network/NetworkProcessProxy.h:
     28        * UIProcess/Network/NetworkProcessProxy.messages.in:
     29        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
     30        (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
     31        * WebProcess/FileAPI/BlobRegistryProxy.h:
     32        * WebProcess/Network/NetworkProcessConnection.cpp:
     33        (WebKit::NetworkProcessConnection::didClose):
     34        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
     35        (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
     36        * WebProcess/Network/NetworkProcessConnection.h:
     37        * WebProcess/Network/NetworkProcessConnection.messages.in:
     38
    1392018-11-28  Alex Christensen  <achristensen@webkit.org>
    240
  • trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp

    r238283 r238655  
    131131}
    132132
    133 void NetworkBlobRegistry::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void(const Vector<String>&)>&& completionHandler)
     133void NetworkBlobRegistry::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
    134134{
    135135    blobRegistry().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
    136136}
    137137
    138 void NetworkBlobRegistry::writeBlobToFilePath(const URL& blobURL, const String& path, Function<void(bool success)>&& completionHandler)
     138void NetworkBlobRegistry::writeBlobToFilePath(const URL& blobURL, const String& path, CompletionHandler<void(bool success)>&& completionHandler)
    139139{
    140140    if (!blobRegistry().isBlobRegistryImpl()) {
     
    148148        file->prepareForFileAccess();
    149149
    150     static_cast<BlobRegistryImpl&>(blobRegistry()).writeBlobToFilePath(blobURL, path, [blobFiles = WTFMove(blobFiles), completionHandler = WTFMove(completionHandler)] (bool success) {
     150    static_cast<BlobRegistryImpl&>(blobRegistry()).writeBlobToFilePath(blobURL, path, [blobFiles = WTFMove(blobFiles), completionHandler = WTFMove(completionHandler)] (bool success) mutable {
    151151        for (auto& file : blobFiles)
    152152            file->revokeFileAccess();
  • trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h

    r226470 r238655  
    5454    void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&);
    5555    uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&);
    56     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>&)>&& completionHandler);
    57     void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, Function<void(bool success)>&& completionHandler);
     56    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);
     57    void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, CompletionHandler<void(bool success)>&&);
    5858
    5959    void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*);
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r238630 r238655  
    533533}
    534534
    535 void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, uint64_t requestIdentifier)
     535void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
    536536{
    537537    Vector<RefPtr<BlobDataFileReference>> fileReferences;
     
    542542        file->prepareForFileAccess();
    543543
    544     NetworkBlobRegistry::singleton().writeBlobsToTemporaryFiles(blobURLs, [this, protectedThis = makeRef(*this), requestIdentifier, fileReferences = WTFMove(fileReferences)](auto& fileNames) mutable {
     544    NetworkBlobRegistry::singleton().writeBlobsToTemporaryFiles(blobURLs, [fileReferences = WTFMove(fileReferences), completionHandler = WTFMove(completionHandler)](auto&& fileNames) mutable {
    545545        for (auto& file : fileReferences)
    546546            file->revokeFileAccess();
    547 
    548         m_connection->send(Messages::NetworkProcessConnection::DidWriteBlobsToTemporaryFiles(requestIdentifier, fileNames), 0);
     547        completionHandler(WTFMove(fileNames));
    549548    });
    550549}
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r238283 r238655  
    169169    void blobSize(const WebCore::URL&, uint64_t& resultSize);
    170170    void unregisterBlobURL(const WebCore::URL&);
    171     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, uint64_t requestIdentifier);
     171    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);
    172172
    173173    void storeDerivedDataToCache(const WebKit::NetworkCache::DataKey&, const IPC::DataReference&);
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in

    r238283 r238655  
    4949    UnregisterBlobURL(WebCore::URL url)
    5050    BlobSize(WebCore::URL url) -> (uint64_t resultSize) LegacySync
    51     WriteBlobsToTemporaryFiles(Vector<String> blobURLs, uint64_t requestIdentifier)
     51    WriteBlobsToTemporaryFiles(Vector<String> blobURLs) -> (Vector<String> fileNames) Async
    5252
    5353    StoreDerivedDataToCache(WebKit::NetworkCache::DataKey key, IPC::SharedBufferDataReference data)
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r238654 r238655  
    483483}
    484484
    485 void NetworkProcess::writeBlobToFilePath(const WebCore::URL& url, const String& path, SandboxExtension::Handle&& handleForWriting, uint64_t requestID)
     485void NetworkProcess::writeBlobToFilePath(const WebCore::URL& url, const String& path, SandboxExtension::Handle&& handleForWriting, CompletionHandler<void(bool)>&& completionHandler)
    486486{
    487487    auto extension = SandboxExtension::create(WTFMove(handleForWriting));
    488488    if (!extension) {
    489         parentProcessConnection()->send(Messages::NetworkProcessProxy::DidWriteBlobToFilePath(false, requestID), 0);
     489        completionHandler(false);
    490490        return;
    491491    }
    492492
    493493    extension->consume();
    494     NetworkBlobRegistry::singleton().writeBlobToFilePath(url, path, [this, extension = WTFMove(extension), requestID] (bool success) {
     494    NetworkBlobRegistry::singleton().writeBlobToFilePath(url, path, [extension = WTFMove(extension), completionHandler = WTFMove(completionHandler)] (bool success) mutable {
    495495        extension->revoke();
    496         parentProcessConnection()->send(Messages::NetworkProcessProxy::DidWriteBlobToFilePath(success, requestID), 0);
     496        completionHandler(success);
    497497    });
    498498}
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.h

    r238654 r238655  
    288288    void didSyncAllCookies();
    289289
    290     void writeBlobToFilePath(const WebCore::URL&, const String& path, SandboxExtension::Handle&&, uint64_t requestID);
     290    void writeBlobToFilePath(const WebCore::URL&, const String& path, SandboxExtension::Handle&&, CompletionHandler<void(bool)>&&);
    291291
    292292#if USE(SOUP)
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in

    r238063 r238655  
    7878    ProcessDidResume()
    7979
    80     WriteBlobToFilePath(WebCore::URL blobURL, String path, WebKit::SandboxExtension::Handle handle, uint64_t callbackID)
     80    WriteBlobToFilePath(WebCore::URL blobURL, String path, WebKit::SandboxExtension::Handle handle) -> (bool success) Async
    8181
    8282    PreconnectTo(WebCore::URL url, enum:bool WebCore::StoredCredentialsPolicy storedCredentialsPolicy);
  • trunk/Source/WebKit/UIProcess/ChildProcessProxy.h

    r237107 r238655  
    5151    template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions = { });
    5252    template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
     53    template<typename T, typename... Args> void sendWithAsyncReply(T&&, CompletionHandler<void(Args...)>&&);
    5354
    5455    IPC::Connection* connection() const
     
    132133}
    133134
     135template<typename T, typename... Args>
     136void ChildProcessProxy::sendWithAsyncReply(T&& message, CompletionHandler<void(Args...)>&& completionHandler)
     137{
     138    if (!m_connection) {
     139        T::cancelReply(WTFMove(completionHandler));
     140        return;
     141    }
     142
     143    connection()->sendWithAsyncReply(std::forward<T>(message), WTFMove(completionHandler));
     144}
     145   
    134146} // namespace WebKit
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r238351 r238655  
    273273    m_syncAllCookiesCounter = 0;
    274274
    275     for (auto& callback : m_writeBlobToFilePathCallbackMap.values())
    276         callback(false);
    277     m_writeBlobToFilePathCallbackMap.clear();
    278 
    279275    for (auto& callback : m_removeAllStorageAccessCallbackMap.values())
    280276        callback();
     
    565561}
    566562
    567 void NetworkProcessProxy::writeBlobToFilePath(const WebCore::URL& url, const String& path, CompletionHandler<void(bool)>&& callback)
     563void NetworkProcessProxy::writeBlobToFilePath(const WebCore::URL& url, const String& path, CompletionHandler<void(bool)>&& completionHandler)
    568564{
    569565    if (!canSendMessage()) {
    570         callback(false);
    571         return;
    572     }
    573 
    574     static uint64_t writeBlobToFilePathCallbackIdentifiers = 0;
    575     uint64_t callbackID = ++writeBlobToFilePathCallbackIdentifiers;
    576     m_writeBlobToFilePathCallbackMap.add(callbackID, WTFMove(callback));
     566        completionHandler(false);
     567        return;
     568    }
    577569
    578570    SandboxExtension::Handle handleForWriting;
    579571    SandboxExtension::createHandle(path, SandboxExtension::Type::ReadWrite, handleForWriting);
    580     send(Messages::NetworkProcess::WriteBlobToFilePath(url, path, handleForWriting, callbackID), 0);
    581 }
    582 
    583 void NetworkProcessProxy::didWriteBlobToFilePath(bool success, uint64_t callbackID)
    584 {
    585     if (auto handler = m_writeBlobToFilePathCallbackMap.take(callbackID))
    586         handler(success);
    587     else
    588         ASSERT_NOT_REACHED();
     572    sendWithAsyncReply(Messages::NetworkProcess::WriteBlobToFilePath(url, path, handleForWriting), WTFMove(completionHandler));
    589573}
    590574
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r238335 r238655  
    8989#endif
    9090
    91     void writeBlobToFilePath(const WebCore::URL&, const String& path, CompletionHandler<void(bool)>&& callback);
     91    void writeBlobToFilePath(const WebCore::URL&, const String& path, CompletionHandler<void(bool)>&&);
    9292
    9393    void processReadyToSuspend();
     
    140140    void didDeleteWebsiteData(uint64_t callbackID);
    141141    void didDeleteWebsiteDataForOrigins(uint64_t callbackID);
    142     void didWriteBlobToFilePath(bool success, uint64_t callbackID);
    143142    void logDiagnosticMessage(uint64_t pageID, const String& message, const String& description, WebCore::ShouldSample);
    144143    void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
     
    192191    unsigned m_syncAllCookiesCounter { 0 };
    193192
    194     HashMap<uint64_t, CompletionHandler<void(bool success)>> m_writeBlobToFilePathCallbackMap;
    195193    HashMap<uint64_t, CompletionHandler<void()>> m_updateBlockCookiesCallbackMap;
    196194    HashMap<uint64_t, CompletionHandler<void(bool wasGranted)>> m_storageAccessResponseCallbackMap;
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in

    r238063 r238655  
    3232    DidSyncAllCookies()
    3333
    34     DidWriteBlobToFilePath(bool success, uint64_t callbackID)
    35 
    3634    ProcessReadyToSuspend()
    3735    SetIsHoldingLockedFiles(bool isHoldingLockedFiles)
  • trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp

    r235205 r238655  
    8686}
    8787
    88 void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
     88void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
    8989{
    9090    WebProcess::singleton().ensureNetworkProcessConnection().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
  • trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h

    r209184 r238655  
    3939    void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override;
    4040    unsigned long long blobSize(const WebCore::URL&) override;
    41     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler) override;
     41    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) override;
    4242};
    4343
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp

    r236477 r238655  
    165165    WebProcess::singleton().networkProcessConnectionClosed(this);
    166166
    167     Vector<String> dummyFilenames;
    168     for (auto& handler : m_writeBlobToFileCompletionHandlers.values())
    169         handler(dummyFilenames);
    170 
    171     m_writeBlobToFileCompletionHandlers.clear();
    172 
    173 
    174167#if ENABLE(INDEXED_DATABASE)
    175168    for (auto& connection : m_webIDBConnectionsByIdentifier.values())
     
    193186}
    194187
    195 void NetworkProcessConnection::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
    196 {
    197     static uint64_t writeBlobToFileIdentifier;
    198     uint64_t requestIdentifier = ++writeBlobToFileIdentifier;
    199 
    200     m_writeBlobToFileCompletionHandlers.set(requestIdentifier, WTFMove(completionHandler));
    201 
    202     WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs, requestIdentifier), 0);
    203 }
    204 
    205 void NetworkProcessConnection::didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames)
    206 {
    207     auto handler = m_writeBlobToFileCompletionHandlers.take(requestIdentifier);
    208     if (handler)
    209         handler(filenames);
     188void NetworkProcessConnection::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
     189{
     190    WebProcess::singleton().ensureNetworkProcessConnection().connection().sendWithAsyncReply(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs), WTFMove(completionHandler));
    210191}
    211192
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h

    r236477 r238655  
    6565    void didReceiveNetworkProcessConnectionMessage(IPC::Connection&, IPC::Decoder&);
    6666
    67     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler);
     67    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&);
    6868
    6969#if ENABLE(INDEXED_DATABASE)
     
    8686    void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
    8787
    88     void didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames);
    8988    void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&&, WebCore::ResourceResponse&&);
    9089    void didFinishPreconnection(uint64_t preconnectionIdentifier, WebCore::ResourceError&&);
     
    9897    // The connection from the web process to the network process.
    9998    Ref<IPC::Connection> m_connection;
    100 
    101     HashMap<uint64_t, Function<void (const Vector<String>&)>> m_writeBlobToFileCompletionHandlers;
    10299
    103100#if ENABLE(INDEXED_DATABASE)
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.messages.in

    r230007 r238655  
    2727#endif
    2828
    29     DidWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, Vector<String> filenames)
    3029    DidFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError error, WebCore::ResourceResponse response)
    3130    DidFinishPreconnection(uint64_t preconnectionIdentifier, WebCore::ResourceError error)
Note: See TracChangeset for help on using the changeset viewer.