BlobDownloadClient.h [plain text]
#pragma once
#if !USE(NETWORK_SESSION)
#include <WebCore/FileSystem.h>
#include <WebCore/ResourceHandleClient.h>
#include <wtf/RefPtr.h>
namespace WebKit {
class Download;
class NetworkLoadParameters;
class BlobDownloadClient final : public WebCore::ResourceHandleClient {
public:
explicit BlobDownloadClient(Download&);
void didCancel();
void didDecideDownloadDestination(const String& destinationPath, bool allowOverwrite);
private:
void didReceiveResponseAsync(WebCore::ResourceHandle*, WebCore::ResourceResponse&&) final;
void didReceiveBuffer(WebCore::ResourceHandle*, Ref<WebCore::SharedBuffer>&&, int reportedEncodedDataLength) final;
void didFinishLoading(WebCore::ResourceHandle*) final;
void didFail(WebCore::ResourceHandle*, const WebCore::ResourceError&) final;
void willSendRequestAsync(WebCore::ResourceHandle*, WebCore::ResourceRequest&&, WebCore::ResourceResponse&&, CompletionHandler<void(WebCore::ResourceRequest&&)>&&) final;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&) final;
#endif
Download& m_download;
String m_destinationPath;
WebCore::FileSystem::PlatformFileHandle m_destinationFile { WebCore::FileSystem::invalidPlatformFileHandle };
};
}
#endif // !USE(NETWORK_SESSION)