Title: [268065] trunk/Source/WebKit
Revision
268065
Author
achristen...@apple.com
Date
2020-10-06 12:39:00 -0700 (Tue, 06 Oct 2020)

Log Message

Move ownership of DownloadClient from WebProcessPool to DownloadProxy
https://bugs.webkit.org/show_bug.cgi?id=217399

Reviewed by Tim Horton.

To keep binary compatibility, the WebProcessPool has a nullable DownloadClient that is used if it has been set.
This will allow us to get a DownloadClient from elsewhere, such as having the API Download object have its own delegate
or having the WKWebsiteDataStore have a delegate, which are two of the solutions I've considered.  We definitely don't
want it on the WebProcessPool, though.

* SourcesCocoa.txt:
* UIProcess/API/APIDownloadClient.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setDownloadDelegate:]):
* UIProcess/API/glib/WebKitDownloadClient.cpp:
(attachDownloadClientToContext):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextDispose):
* UIProcess/Cocoa/LegacyDownloadClient.h: Renamed from Source/WebKit/UIProcess/Cocoa/DownloadClient.h.
* UIProcess/Cocoa/LegacyDownloadClient.mm: Renamed from Source/WebKit/UIProcess/Cocoa/DownloadClient.mm.
(WebKit::LegacyDownloadClient::LegacyDownloadClient):
(WebKit::LegacyDownloadClient::didStart):
(WebKit::LegacyDownloadClient::didReceiveResponse):
(WebKit::LegacyDownloadClient::didReceiveData):
(WebKit::LegacyDownloadClient::didReceiveAuthenticationChallenge):
(WebKit::LegacyDownloadClient::didCreateDestination):
(WebKit::LegacyDownloadClient::processDidCrash):
(WebKit::LegacyDownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::LegacyDownloadClient::didFinish):
(WebKit::LegacyDownloadClient::didFail):
(WebKit::LegacyDownloadClient::didCancel):
(WebKit::LegacyDownloadClient::willSendRequest):
(WebKit::LegacyDownloadClient::takeActivityToken):
(WebKit::LegacyDownloadClient::releaseActivityTokenIfNecessary):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::DownloadProxy):
(WebKit::DownloadProxy::cancel):
(WebKit::DownloadProxy::invalidate):
(WebKit::DownloadProxy::processDidClose):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::willSendRequest):
(WebKit::DownloadProxy::didReceiveResponse):
(WebKit::DownloadProxy::didReceiveData):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
(WebKit::DownloadProxy::didCreateDestination):
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):
(WebKit::DownloadProxy::~DownloadProxy): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::setLegacyDownloadClient):
(WebKit::WebProcessPool::setDownloadClient): Deleted.
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (268064 => 268065)


--- trunk/Source/WebKit/ChangeLog	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/ChangeLog	2020-10-06 19:39:00 UTC (rev 268065)
@@ -1,3 +1,67 @@
+2020-10-06  Alex Christensen  <achristen...@webkit.org>
+
+        Move ownership of DownloadClient from WebProcessPool to DownloadProxy
+        https://bugs.webkit.org/show_bug.cgi?id=217399
+
+        Reviewed by Tim Horton.
+
+        To keep binary compatibility, the WebProcessPool has a nullable DownloadClient that is used if it has been set.
+        This will allow us to get a DownloadClient from elsewhere, such as having the API Download object have its own delegate
+        or having the WKWebsiteDataStore have a delegate, which are two of the solutions I've considered.  We definitely don't
+        want it on the WebProcessPool, though.
+
+        * SourcesCocoa.txt:
+        * UIProcess/API/APIDownloadClient.h:
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextSetDownloadClient):
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (-[WKProcessPool _setDownloadDelegate:]):
+        * UIProcess/API/glib/WebKitDownloadClient.cpp:
+        (attachDownloadClientToContext):
+        * UIProcess/API/glib/WebKitWebContext.cpp:
+        (webkitWebContextDispose):
+        * UIProcess/Cocoa/LegacyDownloadClient.h: Renamed from Source/WebKit/UIProcess/Cocoa/DownloadClient.h.
+        * UIProcess/Cocoa/LegacyDownloadClient.mm: Renamed from Source/WebKit/UIProcess/Cocoa/DownloadClient.mm.
+        (WebKit::LegacyDownloadClient::LegacyDownloadClient):
+        (WebKit::LegacyDownloadClient::didStart):
+        (WebKit::LegacyDownloadClient::didReceiveResponse):
+        (WebKit::LegacyDownloadClient::didReceiveData):
+        (WebKit::LegacyDownloadClient::didReceiveAuthenticationChallenge):
+        (WebKit::LegacyDownloadClient::didCreateDestination):
+        (WebKit::LegacyDownloadClient::processDidCrash):
+        (WebKit::LegacyDownloadClient::decideDestinationWithSuggestedFilename):
+        (WebKit::LegacyDownloadClient::didFinish):
+        (WebKit::LegacyDownloadClient::didFail):
+        (WebKit::LegacyDownloadClient::didCancel):
+        (WebKit::LegacyDownloadClient::willSendRequest):
+        (WebKit::LegacyDownloadClient::takeActivityToken):
+        (WebKit::LegacyDownloadClient::releaseActivityTokenIfNecessary):
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::DownloadProxy):
+        (WebKit::DownloadProxy::cancel):
+        (WebKit::DownloadProxy::invalidate):
+        (WebKit::DownloadProxy::processDidClose):
+        (WebKit::DownloadProxy::didStart):
+        (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
+        (WebKit::DownloadProxy::willSendRequest):
+        (WebKit::DownloadProxy::didReceiveResponse):
+        (WebKit::DownloadProxy::didReceiveData):
+        (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
+        (WebKit::DownloadProxy::didCreateDestination):
+        (WebKit::DownloadProxy::didFinish):
+        (WebKit::DownloadProxy::didFail):
+        (WebKit::DownloadProxy::didCancel):
+        (WebKit::DownloadProxy::~DownloadProxy): Deleted.
+        * UIProcess/Downloads/DownloadProxy.h:
+        * UIProcess/Downloads/DownloadProxyMap.cpp:
+        (WebKit::DownloadProxyMap::createDownloadProxy):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::WebProcessPool):
+        (WebKit::WebProcessPool::setLegacyDownloadClient):
+        (WebKit::WebProcessPool::setDownloadClient): Deleted.
+        * UIProcess/WebProcessPool.h:
+        * WebKit.xcodeproj/project.pbxproj:
+
 2020-10-06  Youenn Fablet  <you...@apple.com>
 
         Enable video capture in WebProcess by default on MacOS

Modified: trunk/Source/WebKit/SourcesCocoa.txt (268064 => 268065)


--- trunk/Source/WebKit/SourcesCocoa.txt	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2020-10-06 19:39:00 UTC (rev 268065)
@@ -364,7 +364,7 @@
 UIProcess/Cocoa/AutomationClient.mm
 UIProcess/Cocoa/AutomationSessionClient.mm
 UIProcess/Cocoa/DiagnosticLoggingClient.mm
-UIProcess/Cocoa/DownloadClient.mm
+UIProcess/Cocoa/LegacyDownloadClient.mm
 UIProcess/Cocoa/DownloadProxyMapCocoa.mm
 UIProcess/Cocoa/FindClient.mm
 UIProcess/Cocoa/FullscreenClient.mm

Modified: trunk/Source/WebKit/UIProcess/API/APIDownloadClient.h (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/API/APIDownloadClient.h	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/API/APIDownloadClient.h	2020-10-06 19:39:00 UTC (rev 268065)
@@ -49,7 +49,7 @@
 
 namespace API {
 
-class DownloadClient {
+class DownloadClient : public RefCounted<DownloadClient> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     virtual ~DownloadClient() { }

Modified: trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp	2020-10-06 19:39:00 UTC (rev 268065)
@@ -170,9 +170,9 @@
 
 void WKContextSetDownloadClient(WKContextRef context, const WKContextDownloadClientBase* wkClient)
 {
-    class DownloadClient final : public API::Client<WKContextDownloadClientBase>, public API::DownloadClient {
+    class LegacyDownloadClient final : public API::Client<WKContextDownloadClientBase>, public API::DownloadClient {
     public:
-        explicit DownloadClient(const WKContextDownloadClientBase* client, WKContextRef context)
+        explicit LegacyDownloadClient(const WKContextDownloadClientBase* client, WKContextRef context)
             : m_context(context)
         {
             initialize(client);
@@ -248,7 +248,7 @@
         }
         WKContextRef m_context;
     };
-    WebKit::toImpl(context)->setDownloadClient(makeUniqueRef<DownloadClient>(wkClient, context));
+    WebKit::toImpl(context)->setLegacyDownloadClient(adoptRef(*new LegacyDownloadClient(wkClient, context)));
 }
 
 void WKContextSetConnectionClient(WKContextRef contextRef, const WKContextConnectionClientBase* wkClient)

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm	2020-10-06 19:39:00 UTC (rev 268065)
@@ -28,7 +28,7 @@
 
 #import "AutomationClient.h"
 #import "CacheModel.h"
-#import "DownloadClient.h"
+#import "LegacyDownloadClient.h"
 #import "Logging.h"
 #import "PluginProcessManager.h"
 #import "SandboxUtilities.h"
@@ -348,7 +348,7 @@
 - (void)_setDownloadDelegate:(id <_WKDownloadDelegate>)downloadDelegate
 {
     _downloadDelegate = downloadDelegate;
-    _processPool->setDownloadClient(makeUniqueRef<WebKit::DownloadClient>(downloadDelegate));
+    _processPool->setLegacyDownloadClient(adoptRef(*new WebKit::LegacyDownloadClient(downloadDelegate)));
 }
 
 - (id <_WKAutomationDelegate>)_automationDelegate

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp	2020-10-06 19:39:00 UTC (rev 268065)
@@ -33,9 +33,9 @@
 using namespace WebCore;
 using namespace WebKit;
 
-class DownloadClient final : public API::DownloadClient {
+class LegacyDownloadClient final : public API::DownloadClient {
 public:
-    explicit DownloadClient(WebKitWebContext* webContext)
+    explicit LegacyDownloadClient(WebKitWebContext* webContext)
         : m_webContext(webContext)
     {
     }
@@ -130,5 +130,5 @@
 
 void attachDownloadClientToContext(WebKitWebContext* webContext)
 {
-    webkitWebContextGetProcessPool(webContext).setDownloadClient(makeUniqueRef<DownloadClient>(webContext));
+    webkitWebContextGetProcessPool(webContext).setLegacyDownloadClient(adoptRef(*new LegacyDownloadClient(webContext)));
 }

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp	2020-10-06 19:39:00 UTC (rev 268065)
@@ -433,7 +433,7 @@
     if (!priv->clientsDetached) {
         priv->clientsDetached = true;
         priv->processPool->setInjectedBundleClient(nullptr);
-        priv->processPool->setDownloadClient(makeUniqueRef<API::DownloadClient>());
+        priv->processPool->setLegacyDownloadClient(nullptr);
     }
 
     if (priv->faviconDatabase) {

Deleted: trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.h (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.h	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.h	2020-10-06 19:39:00 UTC (rev 268065)
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#import "WKFoundation.h"
-
-#import "APIDownloadClient.h"
-#import "ProcessThrottler.h"
-#import <wtf/WeakObjCPtr.h>
-
-@protocol _WKDownloadDelegate;
-
-namespace WebCore {
-class ResourceError;
-class ResourceResponse;
-}
-
-namespace WebKit {
-
-class DownloadClient final : public API::DownloadClient {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit DownloadClient(id <_WKDownloadDelegate>);
-    
-private:
-    // From API::DownloadClient
-    void didStart(DownloadProxy&) final;
-    void didReceiveResponse(DownloadProxy&, const WebCore::ResourceResponse&) final;
-    void didReceiveData(DownloadProxy&, uint64_t, uint64_t, uint64_t) final;
-    void decideDestinationWithSuggestedFilename(DownloadProxy&, const String& suggestedFilename, Function<void(AllowOverwrite, String)>&&) final;
-    void didFinish(DownloadProxy&) final;
-    void didFail(DownloadProxy&, const WebCore::ResourceError&) final;
-    void didCancel(DownloadProxy&) final;
-    void willSendRequest(DownloadProxy&, WebCore::ResourceRequest&&, const WebCore::ResourceResponse&, CompletionHandler<void(WebCore::ResourceRequest&&)>&&) final;
-    void didReceiveAuthenticationChallenge(DownloadProxy&, AuthenticationChallengeProxy&) final;
-    void didCreateDestination(DownloadProxy&, const String&) final;
-    void processDidCrash(DownloadProxy&) final;
-
-#if USE(SYSTEM_PREVIEW)
-    void takeActivityToken(DownloadProxy&);
-    void releaseActivityTokenIfNecessary(DownloadProxy&);
-#endif
-
-    WeakObjCPtr<id <_WKDownloadDelegate>> m_delegate;
-
-#if PLATFORM(IOS_FAMILY) && USE(SYSTEM_PREVIEW)
-    std::unique_ptr<ProcessThrottler::BackgroundActivity> m_activity;
-#endif
-
-    struct {
-        bool downloadDidStart : 1;            
-        bool downloadDidReceiveResponse : 1;
-        bool downloadDidReceiveData : 1;
-        bool downloadDidWriteDataTotalBytesWrittenTotalBytesExpectedToWrite : 1;
-        bool downloadDecideDestinationWithSuggestedFilenameAllowOverwrite : 1;
-        bool downloadDecideDestinationWithSuggestedFilenameCompletionHandler : 1;
-        bool downloadDidFinish : 1;
-        bool downloadDidFail : 1;
-        bool downloadDidCancel : 1;
-        bool downloadDidReceiveServerRedirectToURL : 1;
-        bool downloadDidReceiveAuthenticationChallengeCompletionHandler : 1;
-        bool downloadShouldDecodeSourceDataOfMIMEType : 1;
-        bool downloadDidCreateDestination : 1;
-        bool downloadProcessDidCrash : 1;
-    } m_delegateMethods;
-};
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm	2020-10-06 19:39:00 UTC (rev 268065)
@@ -1,302 +0,0 @@
-/*
- * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "DownloadClient.h"
-
-#import "AuthenticationChallengeDisposition.h"
-#import "AuthenticationChallengeProxy.h"
-#import "AuthenticationDecisionListener.h"
-#import "CompletionHandlerCallChecker.h"
-#import "DownloadProxy.h"
-#import "Logging.h"
-#import "SystemPreviewController.h"
-#import "WKNSURLAuthenticationChallenge.h"
-#import "WKNSURLExtras.h"
-#import "WebCredential.h"
-#import "WebPageProxy.h"
-#import "WebProcessProxy.h"
-#import "_WKDownloadDelegate.h"
-#import "_WKDownloadInternal.h"
-#import <WebCore/ResourceError.h>
-#import <WebCore/ResourceResponse.h>
-#import <wtf/BlockPtr.h>
-#import <wtf/FileSystem.h>
-
-namespace WebKit {
-
-DownloadClient::DownloadClient(id <_WKDownloadDelegate> delegate)
-    : m_delegate(delegate)
-{
-    m_delegateMethods.downloadDidStart = [delegate respondsToSelector:@selector(_downloadDidStart:)];
-    m_delegateMethods.downloadDidReceiveResponse = [delegate respondsToSelector:@selector(_download:didReceiveResponse:)];
-    m_delegateMethods.downloadDidReceiveData = [delegate respondsToSelector:@selector(_download:didReceiveData:)];
-    m_delegateMethods.downloadDidWriteDataTotalBytesWrittenTotalBytesExpectedToWrite = [delegate respondsToSelector:@selector(_download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)];
-    m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite = [delegate respondsToSelector:@selector(_download:decideDestinationWithSuggestedFilename:allowOverwrite:)];
-    m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameCompletionHandler = [delegate respondsToSelector:@selector(_download:decideDestinationWithSuggestedFilename:completionHandler:)];
-    m_delegateMethods.downloadDidFinish = [delegate respondsToSelector:@selector(_downloadDidFinish:)];
-    m_delegateMethods.downloadDidFail = [delegate respondsToSelector:@selector(_download:didFailWithError:)];
-    m_delegateMethods.downloadDidCancel = [delegate respondsToSelector:@selector(_downloadDidCancel:)];
-    m_delegateMethods.downloadDidReceiveServerRedirectToURL = [delegate respondsToSelector:@selector(_download:didReceiveServerRedirectToURL:)];
-    m_delegateMethods.downloadDidReceiveAuthenticationChallengeCompletionHandler = [delegate respondsToSelector:@selector(_download:didReceiveAuthenticationChallenge:completionHandler:)];
-    m_delegateMethods.downloadShouldDecodeSourceDataOfMIMEType = [delegate respondsToSelector:@selector(_download:shouldDecodeSourceDataOfMIMEType:)];
-    m_delegateMethods.downloadDidCreateDestination = [delegate respondsToSelector:@selector(_download:didCreateDestination:)];
-    m_delegateMethods.downloadProcessDidCrash = [delegate respondsToSelector:@selector(_downloadProcessDidCrash:)];
-}
-
-#if USE(SYSTEM_PREVIEW)
-static SystemPreviewController* systemPreviewController(DownloadProxy& downloadProxy)
-{
-    auto* page = downloadProxy.originatingPage();
-    if (!page)
-        return nullptr;
-    return page->systemPreviewController();
-}
-#endif
-
-void DownloadClient::didStart(DownloadProxy& downloadProxy)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        if (auto* webPage = downloadProxy.originatingPage()) {
-            // FIXME: Update the MIME-type once it is known in the ResourceResponse.
-            webPage->systemPreviewController()->start(URL(URL(), webPage->currentURL()), "application/octet-stream"_s, downloadProxy.systemPreviewDownloadInfo());
-        }
-        takeActivityToken(downloadProxy);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidStart)
-        [m_delegate _downloadDidStart:wrapper(downloadProxy)];
-}
-
-void DownloadClient::didReceiveResponse(DownloadProxy& downloadProxy, const WebCore::ResourceResponse& response)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload() && response.isSuccessful()) {
-        if (auto* controller = systemPreviewController(downloadProxy))
-            controller->updateProgress(0);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidReceiveResponse)
-        [m_delegate _download:wrapper(downloadProxy) didReceiveResponse:response.nsURLResponse()];
-}
-
-void DownloadClient::didReceiveData(DownloadProxy& downloadProxy, uint64_t bytesWritten, uint64_t totalBytesWritten, uint64_t totalBytesExpectedToWrite)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        if (auto* controller = systemPreviewController(downloadProxy))
-            controller->updateProgress(static_cast<float>(totalBytesWritten) / totalBytesExpectedToWrite);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidWriteDataTotalBytesWrittenTotalBytesExpectedToWrite)
-        [m_delegate _download:wrapper(downloadProxy) didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
-    else if (m_delegateMethods.downloadDidReceiveData)
-        [m_delegate _download:wrapper(downloadProxy) didReceiveData:bytesWritten];
-}
-
-void DownloadClient::didReceiveAuthenticationChallenge(DownloadProxy& downloadProxy, AuthenticationChallengeProxy& authenticationChallenge)
-{
-    // FIXME: System Preview needs code here.
-    if (!m_delegateMethods.downloadDidReceiveAuthenticationChallengeCompletionHandler) {
-        authenticationChallenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling);
-        return;
-    }
-
-    [m_delegate _download:wrapper(downloadProxy) didReceiveAuthenticationChallenge:wrapper(authenticationChallenge) completionHandler:makeBlockPtr([authenticationChallenge = makeRef(authenticationChallenge), checker = CompletionHandlerCallChecker::create(m_delegate.get().get(), @selector(_download:didReceiveAuthenticationChallenge:completionHandler:))] (NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential) {
-        if (checker->completionHandlerHasBeenCalled())
-            return;
-        checker->didCallCompletionHandler();
-        switch (disposition) {
-        case NSURLSessionAuthChallengeUseCredential:
-            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::UseCredential, credential ? WebCore::Credential(credential) : WebCore::Credential());
-            break;
-        case NSURLSessionAuthChallengePerformDefaultHandling:
-            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
-            break;
-            
-        case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
-            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::Cancel);
-            break;
-            
-        case NSURLSessionAuthChallengeRejectProtectionSpace:
-            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue);
-            break;
-            
-        default:
-            [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
-        }
-    }).get()];
-}
-
-void DownloadClient::didCreateDestination(DownloadProxy& downloadProxy, const String& destination)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        downloadProxy.setDestinationFilename(destination);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidCreateDestination)
-        [m_delegate _download:wrapper(downloadProxy) didCreateDestination:destination];
-}
-
-void DownloadClient::processDidCrash(DownloadProxy& downloadProxy)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        if (auto* controller = systemPreviewController(downloadProxy))
-            controller->cancel();
-        releaseActivityTokenIfNecessary(downloadProxy);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadProcessDidCrash)
-        [m_delegate _downloadProcessDidCrash:wrapper(downloadProxy)];
-}
-
-void DownloadClient::decideDestinationWithSuggestedFilename(DownloadProxy& downloadProxy, const String& filename, Function<void(AllowOverwrite, String)>&& completionHandler)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        NSString *temporaryDirectory = FileSystem::createTemporaryDirectory(@"SystemPreviews");
-        NSString *destination = [temporaryDirectory stringByAppendingPathComponent:filename];
-        completionHandler(AllowOverwrite::Yes, destination);
-        return;
-    }
-#endif
-
-    if (!m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite && !m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameCompletionHandler)
-        return completionHandler(AllowOverwrite::No, { });
-
-    if (m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite) {
-        BOOL allowOverwrite = NO;
-        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-        NSString *destination = [m_delegate _download:wrapper(downloadProxy) decideDestinationWithSuggestedFilename:filename allowOverwrite:&allowOverwrite];
-        ALLOW_DEPRECATED_DECLARATIONS_END
-        completionHandler(allowOverwrite ? AllowOverwrite::Yes : AllowOverwrite::No, destination);
-    } else {
-        [m_delegate _download:wrapper(downloadProxy) decideDestinationWithSuggestedFilename:filename completionHandler:makeBlockPtr([checker = CompletionHandlerCallChecker::create(m_delegate.get().get(), @selector(_download:decideDestinationWithSuggestedFilename:completionHandler:)), completionHandler = WTFMove(completionHandler)] (BOOL allowOverwrite, NSString *destination) {
-            if (checker->completionHandlerHasBeenCalled())
-                return;
-            checker->didCallCompletionHandler();
-            completionHandler(allowOverwrite ? AllowOverwrite::Yes : AllowOverwrite::No, destination);
-        }).get()];
-    }
-}
-
-void DownloadClient::didFinish(DownloadProxy& downloadProxy)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        if (auto* controller = systemPreviewController(downloadProxy)) {
-            auto destinationURL = WTF::URL::fileURLWithFileSystemPath(downloadProxy.destinationFilename());
-            if (!destinationURL.hasFragmentIdentifier())
-                destinationURL.setFragmentIdentifier(downloadProxy.request().url().fragmentIdentifier());
-            controller->finish(destinationURL);
-        }
-        releaseActivityTokenIfNecessary(downloadProxy);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidFinish)
-        [m_delegate _downloadDidFinish:wrapper(downloadProxy)];
-}
-
-void DownloadClient::didFail(DownloadProxy& downloadProxy, const WebCore::ResourceError& error)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        if (auto* controller = systemPreviewController(downloadProxy))
-            controller->fail(error);
-        releaseActivityTokenIfNecessary(downloadProxy);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidFail)
-        [m_delegate _download:wrapper(downloadProxy) didFailWithError:error.nsError()];
-}
-
-void DownloadClient::didCancel(DownloadProxy& downloadProxy)
-{
-#if USE(SYSTEM_PREVIEW)
-    if (downloadProxy.isSystemPreviewDownload()) {
-        if (auto* controller = systemPreviewController(downloadProxy))
-            controller->cancel();
-        releaseActivityTokenIfNecessary(downloadProxy);
-        return;
-    }
-#endif
-
-    if (m_delegateMethods.downloadDidCancel)
-        [m_delegate _downloadDidCancel:wrapper(downloadProxy)];
-}
-
-void DownloadClient::willSendRequest(DownloadProxy& downloadProxy, WebCore::ResourceRequest&& request, const WebCore::ResourceResponse&, CompletionHandler<void(WebCore::ResourceRequest&&)>&& completionHandler)
-{
-    if (m_delegateMethods.downloadDidReceiveServerRedirectToURL)
-        [m_delegate _download:wrapper(downloadProxy) didReceiveServerRedirectToURL:[NSURL _web_URLWithWTFString:request.url().string()]];
-
-    completionHandler(WTFMove(request));
-}
-
-#if USE(SYSTEM_PREVIEW)
-void DownloadClient::takeActivityToken(DownloadProxy& downloadProxy)
-{
-#if PLATFORM(IOS_FAMILY)
-    if (auto* webPage = downloadProxy.originatingPage()) {
-        RELEASE_LOG_IF(webPage->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - UIProcess is taking a background assertion because it is downloading a system preview", this);
-        ASSERT(!m_activity);
-        m_activity = webPage->process().throttler().backgroundActivity("System preview download"_s).moveToUniquePtr();
-    }
-#else
-    UNUSED_PARAM(downloadProxy);
-#endif
-}
-
-void DownloadClient::releaseActivityTokenIfNecessary(DownloadProxy& downloadProxy)
-{
-#if PLATFORM(IOS_FAMILY)
-    if (m_activity) {
-        RELEASE_LOG_IF(downloadProxy.originatingPage()->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p UIProcess is releasing a background assertion because a system preview download completed", this);
-        m_activity = nullptr;
-    }
-#else
-    UNUSED_PARAM(downloadProxy);
-#endif
-}
-#endif
-
-} // namespace WebKit

Added: trunk/Source/WebKit/UIProcess/Cocoa/LegacyDownloadClient.h (0 => 268065)


--- trunk/Source/WebKit/UIProcess/Cocoa/LegacyDownloadClient.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/Cocoa/LegacyDownloadClient.h	2020-10-06 19:39:00 UTC (rev 268065)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#import "APIDownloadClient.h"
+#import "ProcessThrottler.h"
+#import "WKFoundation.h"
+#import <wtf/WeakObjCPtr.h>
+
+@protocol _WKDownloadDelegate;
+
+namespace WebCore {
+class ResourceError;
+class ResourceResponse;
+}
+
+namespace WebKit {
+
+class LegacyDownloadClient final : public API::DownloadClient {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit LegacyDownloadClient(id <_WKDownloadDelegate>);
+    
+private:
+    // From API::DownloadClient
+    void didStart(DownloadProxy&) final;
+    void didReceiveResponse(DownloadProxy&, const WebCore::ResourceResponse&) final;
+    void didReceiveData(DownloadProxy&, uint64_t, uint64_t, uint64_t) final;
+    void decideDestinationWithSuggestedFilename(DownloadProxy&, const String& suggestedFilename, Function<void(AllowOverwrite, String)>&&) final;
+    void didFinish(DownloadProxy&) final;
+    void didFail(DownloadProxy&, const WebCore::ResourceError&) final;
+    void didCancel(DownloadProxy&) final;
+    void willSendRequest(DownloadProxy&, WebCore::ResourceRequest&&, const WebCore::ResourceResponse&, CompletionHandler<void(WebCore::ResourceRequest&&)>&&) final;
+    void didReceiveAuthenticationChallenge(DownloadProxy&, AuthenticationChallengeProxy&) final;
+    void didCreateDestination(DownloadProxy&, const String&) final;
+    void processDidCrash(DownloadProxy&) final;
+
+#if USE(SYSTEM_PREVIEW)
+    void takeActivityToken(DownloadProxy&);
+    void releaseActivityTokenIfNecessary(DownloadProxy&);
+#endif
+
+    WeakObjCPtr<id <_WKDownloadDelegate>> m_delegate;
+
+#if PLATFORM(IOS_FAMILY) && USE(SYSTEM_PREVIEW)
+    std::unique_ptr<ProcessThrottler::BackgroundActivity> m_activity;
+#endif
+
+    struct {
+        bool downloadDidStart : 1;            
+        bool downloadDidReceiveResponse : 1;
+        bool downloadDidReceiveData : 1;
+        bool downloadDidWriteDataTotalBytesWrittenTotalBytesExpectedToWrite : 1;
+        bool downloadDecideDestinationWithSuggestedFilenameAllowOverwrite : 1;
+        bool downloadDecideDestinationWithSuggestedFilenameCompletionHandler : 1;
+        bool downloadDidFinish : 1;
+        bool downloadDidFail : 1;
+        bool downloadDidCancel : 1;
+        bool downloadDidReceiveServerRedirectToURL : 1;
+        bool downloadDidReceiveAuthenticationChallengeCompletionHandler : 1;
+        bool downloadShouldDecodeSourceDataOfMIMEType : 1;
+        bool downloadDidCreateDestination : 1;
+        bool downloadProcessDidCrash : 1;
+    } m_delegateMethods;
+};
+
+} // namespace WebKit

Added: trunk/Source/WebKit/UIProcess/Cocoa/LegacyDownloadClient.mm (0 => 268065)


--- trunk/Source/WebKit/UIProcess/Cocoa/LegacyDownloadClient.mm	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/Cocoa/LegacyDownloadClient.mm	2020-10-06 19:39:00 UTC (rev 268065)
@@ -0,0 +1,302 @@
+/*
+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "LegacyDownloadClient.h"
+
+#import "AuthenticationChallengeDisposition.h"
+#import "AuthenticationChallengeProxy.h"
+#import "AuthenticationDecisionListener.h"
+#import "CompletionHandlerCallChecker.h"
+#import "DownloadProxy.h"
+#import "Logging.h"
+#import "SystemPreviewController.h"
+#import "WKNSURLAuthenticationChallenge.h"
+#import "WKNSURLExtras.h"
+#import "WebCredential.h"
+#import "WebPageProxy.h"
+#import "WebProcessProxy.h"
+#import "_WKDownloadDelegate.h"
+#import "_WKDownloadInternal.h"
+#import <WebCore/ResourceError.h>
+#import <WebCore/ResourceResponse.h>
+#import <wtf/BlockPtr.h>
+#import <wtf/FileSystem.h>
+
+namespace WebKit {
+
+LegacyDownloadClient::LegacyDownloadClient(id <_WKDownloadDelegate> delegate)
+    : m_delegate(delegate)
+{
+    m_delegateMethods.downloadDidStart = [delegate respondsToSelector:@selector(_downloadDidStart:)];
+    m_delegateMethods.downloadDidReceiveResponse = [delegate respondsToSelector:@selector(_download:didReceiveResponse:)];
+    m_delegateMethods.downloadDidReceiveData = [delegate respondsToSelector:@selector(_download:didReceiveData:)];
+    m_delegateMethods.downloadDidWriteDataTotalBytesWrittenTotalBytesExpectedToWrite = [delegate respondsToSelector:@selector(_download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)];
+    m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite = [delegate respondsToSelector:@selector(_download:decideDestinationWithSuggestedFilename:allowOverwrite:)];
+    m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameCompletionHandler = [delegate respondsToSelector:@selector(_download:decideDestinationWithSuggestedFilename:completionHandler:)];
+    m_delegateMethods.downloadDidFinish = [delegate respondsToSelector:@selector(_downloadDidFinish:)];
+    m_delegateMethods.downloadDidFail = [delegate respondsToSelector:@selector(_download:didFailWithError:)];
+    m_delegateMethods.downloadDidCancel = [delegate respondsToSelector:@selector(_downloadDidCancel:)];
+    m_delegateMethods.downloadDidReceiveServerRedirectToURL = [delegate respondsToSelector:@selector(_download:didReceiveServerRedirectToURL:)];
+    m_delegateMethods.downloadDidReceiveAuthenticationChallengeCompletionHandler = [delegate respondsToSelector:@selector(_download:didReceiveAuthenticationChallenge:completionHandler:)];
+    m_delegateMethods.downloadShouldDecodeSourceDataOfMIMEType = [delegate respondsToSelector:@selector(_download:shouldDecodeSourceDataOfMIMEType:)];
+    m_delegateMethods.downloadDidCreateDestination = [delegate respondsToSelector:@selector(_download:didCreateDestination:)];
+    m_delegateMethods.downloadProcessDidCrash = [delegate respondsToSelector:@selector(_downloadProcessDidCrash:)];
+}
+
+#if USE(SYSTEM_PREVIEW)
+static SystemPreviewController* systemPreviewController(DownloadProxy& downloadProxy)
+{
+    auto* page = downloadProxy.originatingPage();
+    if (!page)
+        return nullptr;
+    return page->systemPreviewController();
+}
+#endif
+
+void LegacyDownloadClient::didStart(DownloadProxy& downloadProxy)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        if (auto* webPage = downloadProxy.originatingPage()) {
+            // FIXME: Update the MIME-type once it is known in the ResourceResponse.
+            webPage->systemPreviewController()->start(URL(URL(), webPage->currentURL()), "application/octet-stream"_s, downloadProxy.systemPreviewDownloadInfo());
+        }
+        takeActivityToken(downloadProxy);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidStart)
+        [m_delegate _downloadDidStart:wrapper(downloadProxy)];
+}
+
+void LegacyDownloadClient::didReceiveResponse(DownloadProxy& downloadProxy, const WebCore::ResourceResponse& response)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload() && response.isSuccessful()) {
+        if (auto* controller = systemPreviewController(downloadProxy))
+            controller->updateProgress(0);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidReceiveResponse)
+        [m_delegate _download:wrapper(downloadProxy) didReceiveResponse:response.nsURLResponse()];
+}
+
+void LegacyDownloadClient::didReceiveData(DownloadProxy& downloadProxy, uint64_t bytesWritten, uint64_t totalBytesWritten, uint64_t totalBytesExpectedToWrite)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        if (auto* controller = systemPreviewController(downloadProxy))
+            controller->updateProgress(static_cast<float>(totalBytesWritten) / totalBytesExpectedToWrite);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidWriteDataTotalBytesWrittenTotalBytesExpectedToWrite)
+        [m_delegate _download:wrapper(downloadProxy) didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
+    else if (m_delegateMethods.downloadDidReceiveData)
+        [m_delegate _download:wrapper(downloadProxy) didReceiveData:bytesWritten];
+}
+
+void LegacyDownloadClient::didReceiveAuthenticationChallenge(DownloadProxy& downloadProxy, AuthenticationChallengeProxy& authenticationChallenge)
+{
+    // FIXME: System Preview needs code here.
+    if (!m_delegateMethods.downloadDidReceiveAuthenticationChallengeCompletionHandler) {
+        authenticationChallenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling);
+        return;
+    }
+
+    [m_delegate _download:wrapper(downloadProxy) didReceiveAuthenticationChallenge:wrapper(authenticationChallenge) completionHandler:makeBlockPtr([authenticationChallenge = makeRef(authenticationChallenge), checker = CompletionHandlerCallChecker::create(m_delegate.get().get(), @selector(_download:didReceiveAuthenticationChallenge:completionHandler:))] (NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential) {
+        if (checker->completionHandlerHasBeenCalled())
+            return;
+        checker->didCallCompletionHandler();
+        switch (disposition) {
+        case NSURLSessionAuthChallengeUseCredential:
+            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::UseCredential, credential ? WebCore::Credential(credential) : WebCore::Credential());
+            break;
+        case NSURLSessionAuthChallengePerformDefaultHandling:
+            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
+            break;
+            
+        case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
+            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::Cancel);
+            break;
+            
+        case NSURLSessionAuthChallengeRejectProtectionSpace:
+            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue);
+            break;
+            
+        default:
+            [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
+        }
+    }).get()];
+}
+
+void LegacyDownloadClient::didCreateDestination(DownloadProxy& downloadProxy, const String& destination)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        downloadProxy.setDestinationFilename(destination);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidCreateDestination)
+        [m_delegate _download:wrapper(downloadProxy) didCreateDestination:destination];
+}
+
+void LegacyDownloadClient::processDidCrash(DownloadProxy& downloadProxy)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        if (auto* controller = systemPreviewController(downloadProxy))
+            controller->cancel();
+        releaseActivityTokenIfNecessary(downloadProxy);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadProcessDidCrash)
+        [m_delegate _downloadProcessDidCrash:wrapper(downloadProxy)];
+}
+
+void LegacyDownloadClient::decideDestinationWithSuggestedFilename(DownloadProxy& downloadProxy, const String& filename, Function<void(AllowOverwrite, String)>&& completionHandler)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        NSString *temporaryDirectory = FileSystem::createTemporaryDirectory(@"SystemPreviews");
+        NSString *destination = [temporaryDirectory stringByAppendingPathComponent:filename];
+        completionHandler(AllowOverwrite::Yes, destination);
+        return;
+    }
+#endif
+
+    if (!m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite && !m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameCompletionHandler)
+        return completionHandler(AllowOverwrite::No, { });
+
+    if (m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite) {
+        BOOL allowOverwrite = NO;
+        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
+        NSString *destination = [m_delegate _download:wrapper(downloadProxy) decideDestinationWithSuggestedFilename:filename allowOverwrite:&allowOverwrite];
+        ALLOW_DEPRECATED_DECLARATIONS_END
+        completionHandler(allowOverwrite ? AllowOverwrite::Yes : AllowOverwrite::No, destination);
+    } else {
+        [m_delegate _download:wrapper(downloadProxy) decideDestinationWithSuggestedFilename:filename completionHandler:makeBlockPtr([checker = CompletionHandlerCallChecker::create(m_delegate.get().get(), @selector(_download:decideDestinationWithSuggestedFilename:completionHandler:)), completionHandler = WTFMove(completionHandler)] (BOOL allowOverwrite, NSString *destination) {
+            if (checker->completionHandlerHasBeenCalled())
+                return;
+            checker->didCallCompletionHandler();
+            completionHandler(allowOverwrite ? AllowOverwrite::Yes : AllowOverwrite::No, destination);
+        }).get()];
+    }
+}
+
+void LegacyDownloadClient::didFinish(DownloadProxy& downloadProxy)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        if (auto* controller = systemPreviewController(downloadProxy)) {
+            auto destinationURL = WTF::URL::fileURLWithFileSystemPath(downloadProxy.destinationFilename());
+            if (!destinationURL.hasFragmentIdentifier())
+                destinationURL.setFragmentIdentifier(downloadProxy.request().url().fragmentIdentifier());
+            controller->finish(destinationURL);
+        }
+        releaseActivityTokenIfNecessary(downloadProxy);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidFinish)
+        [m_delegate _downloadDidFinish:wrapper(downloadProxy)];
+}
+
+void LegacyDownloadClient::didFail(DownloadProxy& downloadProxy, const WebCore::ResourceError& error)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        if (auto* controller = systemPreviewController(downloadProxy))
+            controller->fail(error);
+        releaseActivityTokenIfNecessary(downloadProxy);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidFail)
+        [m_delegate _download:wrapper(downloadProxy) didFailWithError:error.nsError()];
+}
+
+void LegacyDownloadClient::didCancel(DownloadProxy& downloadProxy)
+{
+#if USE(SYSTEM_PREVIEW)
+    if (downloadProxy.isSystemPreviewDownload()) {
+        if (auto* controller = systemPreviewController(downloadProxy))
+            controller->cancel();
+        releaseActivityTokenIfNecessary(downloadProxy);
+        return;
+    }
+#endif
+
+    if (m_delegateMethods.downloadDidCancel)
+        [m_delegate _downloadDidCancel:wrapper(downloadProxy)];
+}
+
+void LegacyDownloadClient::willSendRequest(DownloadProxy& downloadProxy, WebCore::ResourceRequest&& request, const WebCore::ResourceResponse&, CompletionHandler<void(WebCore::ResourceRequest&&)>&& completionHandler)
+{
+    if (m_delegateMethods.downloadDidReceiveServerRedirectToURL)
+        [m_delegate _download:wrapper(downloadProxy) didReceiveServerRedirectToURL:[NSURL _web_URLWithWTFString:request.url().string()]];
+
+    completionHandler(WTFMove(request));
+}
+
+#if USE(SYSTEM_PREVIEW)
+void LegacyDownloadClient::takeActivityToken(DownloadProxy& downloadProxy)
+{
+#if PLATFORM(IOS_FAMILY)
+    if (auto* webPage = downloadProxy.originatingPage()) {
+        RELEASE_LOG_IF(webPage->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - UIProcess is taking a background assertion because it is downloading a system preview", this);
+        ASSERT(!m_activity);
+        m_activity = webPage->process().throttler().backgroundActivity("System preview download"_s).moveToUniquePtr();
+    }
+#else
+    UNUSED_PARAM(downloadProxy);
+#endif
+}
+
+void LegacyDownloadClient::releaseActivityTokenIfNecessary(DownloadProxy& downloadProxy)
+{
+#if PLATFORM(IOS_FAMILY)
+    if (m_activity) {
+        RELEASE_LOG_IF(downloadProxy.originatingPage()->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p UIProcess is releasing a background assertion because a system preview download completed", this);
+        m_activity = nullptr;
+    }
+#else
+    UNUSED_PARAM(downloadProxy);
+#endif
+}
+#endif
+
+} // namespace WebKit

Modified: trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp	2020-10-06 19:39:00 UTC (rev 268065)
@@ -48,10 +48,10 @@
 namespace WebKit {
 using namespace WebCore;
 
-DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebsiteDataStore& dataStore, WebProcessPool& processPool, const ResourceRequest& resourceRequest, const FrameInfoData& frameInfoData, WebPageProxy* originatingPage)
+DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebsiteDataStore& dataStore, API::DownloadClient& client, const ResourceRequest& resourceRequest, const FrameInfoData& frameInfoData, WebPageProxy* originatingPage)
     : m_downloadProxyMap(downloadProxyMap)
     , m_dataStore(&dataStore)
-    , m_processPool(&processPool)
+    , m_client(client)
     , m_downloadID(DownloadID::generate())
     , m_request(resourceRequest)
     , m_originatingPage(makeWeakPtr(originatingPage))
@@ -59,16 +59,10 @@
 {
 }
 
-DownloadProxy::~DownloadProxy()
-{
-    ASSERT(!m_processPool);
-}
+DownloadProxy::~DownloadProxy() = default;
 
 void DownloadProxy::cancel()
 {
-    if (!m_processPool)
-        return;
-
     if (m_dataStore)
         m_dataStore->networkProcess().send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
 }
@@ -75,8 +69,6 @@
 
 void DownloadProxy::invalidate()
 {
-    ASSERT(m_processPool);
-    m_processPool = nullptr;
     ASSERT(m_dataStore);
     m_dataStore = nullptr;
 }
@@ -83,10 +75,7 @@
 
 void DownloadProxy::processDidClose()
 {
-    if (!m_processPool)
-        return;
-
-    m_processPool->downloadClient().processDidCrash(*this);
+    m_client->processDidCrash(*this);
 }
 
 WebPageProxy* DownloadProxy::originatingPage() const
@@ -115,27 +104,21 @@
     if (m_redirectChain.isEmpty() || m_redirectChain.last() != request.url())
         m_redirectChain.append(request.url());
 
-    if (!m_processPool)
-        return;
-
-    m_processPool->downloadClient().didStart(*this);
+    m_client->didStart(*this);
 }
 
 void DownloadProxy::didReceiveAuthenticationChallenge(AuthenticationChallenge&& authenticationChallenge, uint64_t challengeID)
 {
-    if (!m_processPool || !m_dataStore)
+    if (!m_dataStore)
         return;
 
     auto authenticationChallengeProxy = AuthenticationChallengeProxy::create(WTFMove(authenticationChallenge), challengeID, makeRef(*m_dataStore->networkProcess().connection()), nullptr);
-    m_processPool->downloadClient().didReceiveAuthenticationChallenge(*this, authenticationChallengeProxy.get());
+    m_client->didReceiveAuthenticationChallenge(*this, authenticationChallengeProxy.get());
 }
 
 void DownloadProxy::willSendRequest(ResourceRequest&& proposedRequest, const ResourceResponse& redirectResponse)
 {
-    if (!m_processPool)
-        return;
-
-    m_processPool->downloadClient().willSendRequest(*this, WTFMove(proposedRequest), redirectResponse, [this, protectedThis = makeRef(*this)](ResourceRequest&& newRequest) {
+    m_client->willSendRequest(*this, WTFMove(proposedRequest), redirectResponse, [this, protectedThis = makeRef(*this)](ResourceRequest&& newRequest) {
         m_redirectChain.append(newRequest.url());
         if (!protectedThis->m_dataStore)
             return;
@@ -146,26 +129,17 @@
 
 void DownloadProxy::didReceiveResponse(const ResourceResponse& response)
 {
-    if (!m_processPool)
-        return;
-
-    m_processPool->downloadClient().didReceiveResponse(*this, response);
+    m_client->didReceiveResponse(*this, response);
 }
 
 void DownloadProxy::didReceiveData(uint64_t bytesWritten, uint64_t totalBytesWritten, uint64_t totalBytesExpectedToWrite)
 {
-    if (!m_processPool)
-        return;
-
-    m_processPool->downloadClient().didReceiveData(*this, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
+    m_client->didReceiveData(*this, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
 }
 
 void DownloadProxy::decideDestinationWithSuggestedFilename(const String& suggestedFilename, CompletionHandler<void(String, SandboxExtension::Handle, AllowOverwrite)>&& completionHandler)
 {
-    if (!m_processPool)
-        return completionHandler({ }, { }, { });
-    
-    m_processPool->downloadClient().decideDestinationWithSuggestedFilename(*this, ResourceResponseBase::sanitizeSuggestedFilename(suggestedFilename), [completionHandler = WTFMove(completionHandler)] (AllowOverwrite allowOverwrite, String destination) mutable {
+    m_client->decideDestinationWithSuggestedFilename(*this, ResourceResponseBase::sanitizeSuggestedFilename(suggestedFilename), [completionHandler = WTFMove(completionHandler)] (AllowOverwrite allowOverwrite, String destination) mutable {
         SandboxExtension::Handle sandboxExtensionHandle;
         if (!destination.isNull())
             SandboxExtension::createHandle(destination, SandboxExtension::Type::ReadWrite, sandboxExtensionHandle);
@@ -176,19 +150,13 @@
 
 void DownloadProxy::didCreateDestination(const String& path)
 {
-    if (!m_processPool)
-        return;
-
-    m_processPool->downloadClient().didCreateDestination(*this, path);
+    m_client->didCreateDestination(*this, path);
 }
 
 void DownloadProxy::didFinish()
 {
-    if (!m_processPool)
-        return;
+    m_client->didFinish(*this);
 
-    m_processPool->downloadClient().didFinish(*this);
-
     // This can cause the DownloadProxy object to be deleted.
     m_downloadProxyMap.downloadFinished(*this);
 }
@@ -203,12 +171,9 @@
 
 void DownloadProxy::didFail(const ResourceError& error, const IPC::DataReference& resumeData)
 {
-    if (!m_processPool)
-        return;
-
     m_resumeData = createData(resumeData);
 
-    m_processPool->downloadClient().didFail(*this, error);
+    m_client->didFail(*this, error);
 
     // This can cause the DownloadProxy object to be deleted.
     m_downloadProxyMap.downloadFinished(*this);
@@ -218,7 +183,7 @@
 {
     m_resumeData = createData(resumeData);
 
-    m_processPool->downloadClient().didCancel(*this);
+    m_client->didCancel(*this);
 
     // This can cause the DownloadProxy object to be deleted.
     m_downloadProxyMap.downloadFinished(*this);

Modified: trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.h (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.h	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.h	2020-10-06 19:39:00 UTC (rev 268065)
@@ -36,6 +36,7 @@
 
 namespace API {
 class Data;
+class DownloadClient;
 class FrameInfo;
 }
 
@@ -51,7 +52,6 @@
 
 class DownloadProxyMap;
 class WebPageProxy;
-class WebProcessPool;
 class WebsiteDataStore;
 
 enum class AllowOverwrite : bool;
@@ -102,7 +102,7 @@
     API::FrameInfo& frameInfo() { return m_frameInfo.get(); }
 
 private:
-    explicit DownloadProxy(DownloadProxyMap&, WebsiteDataStore&, WebProcessPool&, const WebCore::ResourceRequest&, const FrameInfoData&, WebPageProxy*);
+    explicit DownloadProxy(DownloadProxyMap&, WebsiteDataStore&, API::DownloadClient&, const WebCore::ResourceRequest&, const FrameInfoData&, WebPageProxy*);
 
     // IPC::MessageReceiver
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
@@ -122,7 +122,7 @@
 
     DownloadProxyMap& m_downloadProxyMap;
     RefPtr<WebsiteDataStore> m_dataStore;
-    RefPtr<WebProcessPool> m_processPool;
+    Ref<API::DownloadClient> m_client;
     DownloadID m_downloadID;
 
     RefPtr<API::Data> m_resumeData;

Modified: trunk/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp	2020-10-06 19:39:00 UTC (rev 268065)
@@ -80,7 +80,9 @@
 
 DownloadProxy& DownloadProxyMap::createDownloadProxy(WebsiteDataStore& dataStore, WebProcessPool& processPool, const WebCore::ResourceRequest& resourceRequest, const FrameInfoData& frameInfo, WebPageProxy* originatingPage)
 {
-    auto downloadProxy = DownloadProxy::create(*this, dataStore, processPool, resourceRequest, frameInfo, originatingPage);
+    auto* legacyDownloadClient = processPool.legacyDownloadClient();
+    Ref<API::DownloadClient> client = legacyDownloadClient ? Ref<API::DownloadClient>(*legacyDownloadClient) : adoptRef(*new API::DownloadClient);
+    auto downloadProxy = DownloadProxy::create(*this, dataStore, WTFMove(client), resourceRequest, frameInfo, originatingPage);
     m_downloads.set(downloadProxy->downloadID(), downloadProxy.copyRef());
 
     RELEASE_LOG(Loading, "Adding download %" PRIu64 " to UIProcess DownloadProxyMap", downloadProxy->downloadID().toUInt64());

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-10-06 19:39:00 UTC (rev 268065)
@@ -243,7 +243,6 @@
     , m_defaultPageGroup(WebPageGroup::create())
     , m_injectedBundleClient(makeUnique<API::InjectedBundleClient>())
     , m_automationClient(makeUnique<API::AutomationClient>())
-    , m_downloadClient(makeUniqueRef<API::DownloadClient>())
     , m_historyClient(makeUnique<API::LegacyContextHistoryClient>())
     , m_visitedLinkStore(VisitedLinkStore::create())
 #if PLATFORM(MAC)
@@ -384,9 +383,9 @@
         m_historyClient = WTFMove(historyClient);
 }
 
-void WebProcessPool::setDownloadClient(UniqueRef<API::DownloadClient>&& downloadClient)
+void WebProcessPool::setLegacyDownloadClient(RefPtr<API::DownloadClient>&& client)
 {
-    m_downloadClient = WTFMove(downloadClient);
+    m_legacyDownloadClient = WTFMove(client);
 }
 
 void WebProcessPool::setAutomationClient(std::unique_ptr<API::AutomationClient>&& automationClient)

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (268064 => 268065)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2020-10-06 19:39:00 UTC (rev 268065)
@@ -77,6 +77,7 @@
 class HTTPCookieStore;
 class InjectedBundleClient;
 class LegacyContextHistoryClient;
+class LegacyDownloadClient;
 class Navigation;
 class PageConfiguration;
 }
@@ -169,7 +170,7 @@
     void setInjectedBundleClient(std::unique_ptr<API::InjectedBundleClient>&&);
     void initializeConnectionClient(const WKContextConnectionClientBase*);
     void setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient>&&);
-    void setDownloadClient(UniqueRef<API::DownloadClient>&&);
+    void setLegacyDownloadClient(RefPtr<API::DownloadClient>&&);
     void setAutomationClient(std::unique_ptr<API::AutomationClient>&&);
 
     void setCustomWebContentServiceBundleIdentifier(const String&);
@@ -278,7 +279,7 @@
     
     // Downloads.
     DownloadProxy& createDownloadProxy(WebsiteDataStore&, const WebCore::ResourceRequest&, WebPageProxy* originatingPage, const FrameInfoData&);
-    API::DownloadClient& downloadClient() { return m_downloadClient.get(); }
+    API::DownloadClient* legacyDownloadClient() { return m_legacyDownloadClient.get(); }
 
     API::LegacyContextHistoryClient& historyClient() { return *m_historyClient; }
     WebContextClient& client() { return m_client; }
@@ -597,7 +598,7 @@
     WebContextClient m_client;
     WebContextConnectionClient m_connectionClient;
     std::unique_ptr<API::AutomationClient> m_automationClient;
-    UniqueRef<API::DownloadClient> m_downloadClient;
+    RefPtr<API::DownloadClient> m_legacyDownloadClient;
     std::unique_ptr<API::LegacyContextHistoryClient> m_historyClient;
 
     RefPtr<WebAutomationSession> m_automationSession;

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (268064 => 268065)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-10-06 19:36:02 UTC (rev 268064)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-10-06 19:39:00 UTC (rev 268065)
@@ -1444,7 +1444,7 @@
 		A1A4FE6118DD54A400B5EA8A /* _WKDownloadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A1A4FE6018DD54A400B5EA8A /* _WKDownloadDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A1ADAFB62368E6A8009CB776 /* SharedMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1ADAFB52368E4B8009CB776 /* SharedMemory.cpp */; };
 		A1C512C9190656E500448914 /* WebPreviewLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C512C7190656E500448914 /* WebPreviewLoaderClient.h */; };
-		A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1DF631118E0B7C8003A3E2A /* DownloadClient.h */; };
+		A1DF631318E0B7C8003A3E2A /* LegacyDownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1DF631118E0B7C8003A3E2A /* LegacyDownloadClient.h */; };
 		A1E688701F6E2BAB007006A6 /* QuarantineSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1E6886F1F6E2BAB007006A6 /* QuarantineSPI.h */; };
 		A1EA02381DABFF7E0096021F /* WKContextMenuListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A1EA02361DABFF7E0096021F /* WKContextMenuListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A1EA02401DAC31DB0096021F /* WebContextMenuListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A1EA023E1DAC31DB0096021F /* WebContextMenuListenerProxy.h */; };
@@ -4540,8 +4540,8 @@
 		A1B9CA382246E54A003D6DCA /* WebPaymentCoordinatorCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPaymentCoordinatorCocoa.mm; sourceTree = "<group>"; };
 		A1C512C6190656E500448914 /* WebPreviewLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPreviewLoaderClient.cpp; path = ios/WebPreviewLoaderClient.cpp; sourceTree = "<group>"; };
 		A1C512C7190656E500448914 /* WebPreviewLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPreviewLoaderClient.h; path = ios/WebPreviewLoaderClient.h; sourceTree = "<group>"; };
-		A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadClient.mm; sourceTree = "<group>"; };
-		A1DF631118E0B7C8003A3E2A /* DownloadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadClient.h; sourceTree = "<group>"; };
+		A1DF631018E0B7C8003A3E2A /* LegacyDownloadClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyDownloadClient.mm; sourceTree = "<group>"; };
+		A1DF631118E0B7C8003A3E2A /* LegacyDownloadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyDownloadClient.h; sourceTree = "<group>"; };
 		A1E6886F1F6E2BAB007006A6 /* QuarantineSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QuarantineSPI.h; sourceTree = "<group>"; };
 		A1EA02351DABFF7E0096021F /* WKContextMenuListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKContextMenuListener.cpp; sourceTree = "<group>"; };
 		A1EA02361DABFF7E0096021F /* WKContextMenuListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuListener.h; sourceTree = "<group>"; };
@@ -6303,8 +6303,6 @@
 				990D28B81C6539A000986977 /* AutomationSessionClient.mm */,
 				83891B6A1A68C30B0030F386 /* DiagnosticLoggingClient.h */,
 				83891B6B1A68C30B0030F386 /* DiagnosticLoggingClient.mm */,
-				A1DF631118E0B7C8003A3E2A /* DownloadClient.h */,
-				A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */,
 				5C2B1AF5223C1FD200B91CF7 /* DownloadProxyMapCocoa.mm */,
 				00B9661818E25AE100CE1F88 /* FindClient.h */,
 				00B9661718E25AE100CE1F88 /* FindClient.mm */,
@@ -6316,6 +6314,8 @@
 				51C0C9731DDD74F00032CAD3 /* IconLoadingDelegate.mm */,
 				7A821F4B1E2F664800604577 /* LegacyCustomProtocolManagerClient.h */,
 				7A821F4D1E2F679E00604577 /* LegacyCustomProtocolManagerClient.mm */,
+				A1DF631118E0B7C8003A3E2A /* LegacyDownloadClient.h */,
+				A1DF631018E0B7C8003A3E2A /* LegacyDownloadClient.mm */,
 				411286EF21C8A90C003A8550 /* MediaUtilities.h */,
 				411286F021C8A90D003A8550 /* MediaUtilities.mm */,
 				1ABC3DF41899E437004F0626 /* NavigationState.h */,
@@ -10783,7 +10783,6 @@
 				C18173612058424700DFDA65 /* DisplayLink.h in Headers */,
 				0F189CAC24749F2F00E58D81 /* DisplayLinkObserverID.h in Headers */,
 				5C1427021C23F84C00D41183 /* Download.h in Headers */,
-				A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */,
 				5C1427051C23F84C00D41183 /* DownloadID.h in Headers */,
 				5C1427071C23F84C00D41183 /* DownloadManager.h in Headers */,
 				51240EBA220A08D2005CFC63 /* DownloadMap.h in Headers */,
@@ -10868,6 +10867,7 @@
 				2984F589164BA095004BC0C6 /* LegacyCustomProtocolManagerMessages.h in Headers */,
 				29AD3093164B4C5D0072DEA9 /* LegacyCustomProtocolManagerProxy.h in Headers */,
 				2984F57D164B915F004BC0C6 /* LegacyCustomProtocolManagerProxyMessages.h in Headers */,
+				A1DF631318E0B7C8003A3E2A /* LegacyDownloadClient.h in Headers */,
 				1A1DC340196346D700FF7059 /* LegacySessionStateCoding.h in Headers */,
 				411B22641E371BA6004F7363 /* LibWebRTCNetwork.h in Headers */,
 				413075B41DE85F580039EC69 /* LibWebRTCProvider.h in Headers */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to