NetworkProcessConnection.h [plain text]
#ifndef NetworkProcessConnection_h
#define NetworkProcessConnection_h
#include "Connection.h"
#include "ShareableResource.h"
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace IPC {
class DataReference;
}
namespace PAL {
class SessionID;
}
namespace WebCore {
class ResourceError;
class ResourceRequest;
class ResourceResponse;
}
namespace WebKit {
typedef uint64_t ResourceLoadIdentifier;
class NetworkProcessConnection : public RefCounted<NetworkProcessConnection>, IPC::Connection::Client {
public:
static Ref<NetworkProcessConnection> create(IPC::Connection::Identifier connectionIdentifier)
{
return adoptRef(*new NetworkProcessConnection(connectionIdentifier));
}
~NetworkProcessConnection();
IPC::Connection& connection() { return m_connection.get(); }
void didReceiveNetworkProcessConnectionMessage(IPC::Connection&, IPC::Decoder&);
void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler);
private:
NetworkProcessConnection(IPC::Connection::Identifier);
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
void didClose(IPC::Connection&) override;
void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
void didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames);
void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&&, WebCore::ResourceResponse&&);
void didFinishPreconnection(uint64_t preconnectionIdentifier, WebCore::ResourceError&&);
#if ENABLE(SHAREABLE_RESOURCE)
void didCacheResource(const WebCore::ResourceRequest&, const ShareableResource::Handle&, PAL::SessionID);
#endif
Ref<IPC::Connection> m_connection;
HashMap<uint64_t, Function<void (const Vector<String>&)>> m_writeBlobToFileCompletionHandlers;
};
}
#endif // NetworkProcessConnection_h