diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/Downloads/DownloadProxy.h')
-rw-r--r-- | Source/WebKit2/UIProcess/Downloads/DownloadProxy.h | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h index 6f8536146..1cada8e2a 100644 --- a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h +++ b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010-2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,6 +28,7 @@ #include "APIObject.h" #include "Connection.h" +#include "DownloadID.h" #include "SandboxExtension.h" #include <WebCore/ResourceRequest.h> #include <wtf/Forward.h> @@ -38,23 +39,25 @@ class Data; } namespace WebCore { - class AuthenticationChallenge; - class ResourceError; - class ResourceResponse; +class AuthenticationChallenge; +class ProtectionSpace; +class ResourceError; +class ResourceResponse; } namespace WebKit { +class DownloadID; class DownloadProxyMap; -class WebContext; class WebPageProxy; +class WebProcessPool; class DownloadProxy : public API::ObjectImpl<API::Object::Type::Download>, public IPC::MessageReceiver { public: - static PassRefPtr<DownloadProxy> create(DownloadProxyMap&, WebContext&); + static PassRefPtr<DownloadProxy> create(DownloadProxyMap&, WebProcessPool&, const WebCore::ResourceRequest&); ~DownloadProxy(); - uint64_t downloadID() const { return m_downloadID; } + DownloadID downloadID() const { return m_downloadID; } const WebCore::ResourceRequest& request() const { return m_request; } API::Data* resumeData() const { return m_resumeData.get(); } @@ -63,34 +66,43 @@ public: void invalidate(); void processDidClose(); - void didReceiveDownloadProxyMessage(IPC::Connection*, IPC::MessageDecoder&); - void didReceiveSyncDownloadProxyMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&); + void didReceiveDownloadProxyMessage(IPC::Connection&, IPC::Decoder&); + void didReceiveSyncDownloadProxyMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&); private: - explicit DownloadProxy(DownloadProxyMap&, WebContext&); + explicit DownloadProxy(DownloadProxyMap&, WebProcessPool&, const WebCore::ResourceRequest&); // IPC::MessageReceiver - virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override; - virtual void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override; + void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; + void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; // Message handlers. - void didStart(const WebCore::ResourceRequest&); + void didStart(const WebCore::ResourceRequest&, const String& suggestedFilename); void didReceiveAuthenticationChallenge(const WebCore::AuthenticationChallenge&, uint64_t challengeID); void didReceiveResponse(const WebCore::ResourceResponse&); void didReceiveData(uint64_t length); void shouldDecodeSourceDataOfMIMEType(const String& mimeType, bool& result); - void decideDestinationWithSuggestedFilename(const String& filename, String& destination, bool& allowOverwrite, SandboxExtension::Handle& sandboxExtensionHandle); void didCreateDestination(const String& path); void didFinish(); void didFail(const WebCore::ResourceError&, const IPC::DataReference& resumeData); void didCancel(const IPC::DataReference& resumeData); +#if USE(NETWORK_SESSION) +#if USE(PROTECTION_SPACE_AUTH_CALLBACK) + void canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace&); +#endif + void willSendRequest(const WebCore::ResourceRequest& redirectRequest, const WebCore::ResourceResponse& redirectResponse); +#else + void decideDestinationWithSuggestedFilename(const String& filename, const String& mimeType, String& destination, bool& allowOverwrite, SandboxExtension::Handle& sandboxExtensionHandle); +#endif + void decideDestinationWithSuggestedFilenameAsync(DownloadID, const String& suggestedFilename); DownloadProxyMap& m_downloadProxyMap; - RefPtr<WebContext> m_webContext; - uint64_t m_downloadID; + RefPtr<WebProcessPool> m_processPool; + DownloadID m_downloadID; RefPtr<API::Data> m_resumeData; WebCore::ResourceRequest m_request; + String m_suggestedFilename; }; } // namespace WebKit |