From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- .../UIProcess/Network/NetworkProcessProxy.h | 94 +++++++++++++++------- 1 file changed, 64 insertions(+), 30 deletions(-) (limited to 'Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h') diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h index ad13c702c..772840825 100644 --- a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h +++ b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h @@ -26,80 +26,114 @@ #ifndef NetworkProcessProxy_h #define NetworkProcessProxy_h -#if ENABLE(NETWORK_PROCESS) - #include "ChildProcessProxy.h" +#include "CustomProtocolManagerProxy.h" #include "ProcessLauncher.h" +#include "ProcessThrottler.h" +#include "ProcessThrottlerClient.h" #include "WebProcessProxyMessages.h" +#include #include -#if ENABLE(CUSTOM_PROTOCOLS) -#include "CustomProtocolManagerProxy.h" -#endif - namespace WebCore { class AuthenticationChallenge; +class ProtectionSpace; +class ResourceRequest; +enum class ShouldSample; +class SecurityOrigin; +struct SecurityOriginData; +class SessionID; } namespace WebKit { class DownloadProxy; class DownloadProxyMap; -class WebContext; +class WebProcessPool; +enum class WebsiteDataFetchOption; +enum class WebsiteDataType; struct NetworkProcessCreationParameters; +struct WebsiteData; -class NetworkProcessProxy : public ChildProcessProxy { +class NetworkProcessProxy : public ChildProcessProxy, private ProcessThrottlerClient { public: - static PassRefPtr create(WebContext&); + static Ref create(WebProcessPool&); ~NetworkProcessProxy(); - void getNetworkProcessConnection(PassRefPtr); + void getNetworkProcessConnection(Ref&&); + + DownloadProxy* createDownloadProxy(const WebCore::ResourceRequest&); - DownloadProxy* createDownloadProxy(); + void fetchWebsiteData(WebCore::SessionID, OptionSet, OptionSet, std::function completionHandler); + void deleteWebsiteData(WebCore::SessionID, OptionSet, std::chrono::system_clock::time_point modifiedSince, std::function completionHandler); + void deleteWebsiteDataForOrigins(WebCore::SessionID, OptionSet, const Vector& origins, const Vector& cookieHostNames, std::function completionHandler); -#if PLATFORM(MAC) +#if PLATFORM(COCOA) void setProcessSuppressionEnabled(bool); #endif + void processReadyToSuspend(); + + void setIsHoldingLockedFiles(bool); + + ProcessThrottler& throttler() { return m_throttler; } + private: - NetworkProcessProxy(WebContext&); + NetworkProcessProxy(WebProcessPool&); // ChildProcessProxy - virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override; - virtual void connectionWillOpen(IPC::Connection*) override; - virtual void connectionWillClose(IPC::Connection*) override; + void getLaunchOptions(ProcessLauncher::LaunchOptions&) override; + void connectionWillOpen(IPC::Connection&) override; + void processWillShutDown(IPC::Connection&) override; - void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&); void networkProcessCrashedOrFailedToLaunch(); + // ProcessThrottlerClient + void sendProcessWillSuspendImminently() override; + void sendPrepareToSuspend() override; + void sendCancelPrepareToSuspend() override; + void sendProcessDidResume() override; + void didSetAssertionState(AssertionState) override; + // IPC::Connection::Client - virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override; - virtual void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr&) override; - virtual void didClose(IPC::Connection*) override; - virtual void didReceiveInvalidMessage(IPC::Connection*, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; + void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; + void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr&) override; + void didClose(IPC::Connection&) override; + void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; // Message handlers - void didReceiveNetworkProcessProxyMessage(IPC::Connection*, IPC::MessageDecoder&); + void didReceiveNetworkProcessProxyMessage(IPC::Connection&, IPC::Decoder&); void didCreateNetworkConnectionToWebProcess(const IPC::Attachment&); void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID); + void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&); + void didDeleteWebsiteData(uint64_t callbackID); + void didDeleteWebsiteDataForOrigins(uint64_t callbackID); + void grantSandboxExtensionsToDatabaseProcessForBlobs(uint64_t requestID, const Vector& paths); + void logDiagnosticMessage(uint64_t pageID, const String& message, const String& description, WebCore::ShouldSample); + void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, WebCore::ShouldSample); + void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample); +#if USE(PROTECTION_SPACE_AUTH_CALLBACK) + void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, const WebCore::ProtectionSpace&); +#endif // ProcessLauncher::Client - virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier); + void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override; - WebContext& m_webContext; + WebProcessPool& m_processPool; unsigned m_numPendingConnectionRequests; - Deque> m_pendingConnectionReplies; + Deque> m_pendingConnectionReplies; - OwnPtr m_downloadProxyMap; + HashMap> m_pendingFetchWebsiteDataCallbacks; + HashMap> m_pendingDeleteWebsiteDataCallbacks; + HashMap> m_pendingDeleteWebsiteDataForOriginsCallbacks; -#if ENABLE(CUSTOM_PROTOCOLS) + std::unique_ptr m_downloadProxyMap; CustomProtocolManagerProxy m_customProtocolManagerProxy; -#endif + ProcessThrottler m_throttler; + ProcessThrottler::BackgroundActivityToken m_tokenForHoldingLockedFiles; }; } // namespace WebKit -#endif // ENABLE(NETWORK_PROCESS) - #endif // NetworkProcessProxy_h -- cgit v1.2.1