[webkit-changes] [WebKit/WebKit] 5078ad: Make download placeholder and final URL available ...

Per Arne Vollan noreply at github.com
Mon Sep 9 20:55:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5078adc67152c261c7fb6c83de4a4fc4540c8164
      https://github.com/WebKit/WebKit/commit/5078adc67152c261c7fb6c83de4a4fc4540c8164
  Author: Per Arne Vollan <pvollan at apple.com>
  Date:   2024-09-09 (Mon, 09 Sep 2024)

  Changed paths:
    M Source/WebKit/NetworkProcess/Downloads/Download.cpp
    M Source/WebKit/NetworkProcess/Downloads/Download.h
    M Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm
    M Source/WebKit/NetworkProcess/NetworkProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkProcess.h
    M Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
    M Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.serialization.in
    M Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
    M Source/WebKit/UIProcess/API/APIDownloadClient.h
    M Source/WebKit/UIProcess/API/Cocoa/WKDownload.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKDownloadDelegatePrivate.h
    M Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp
    M Source/WebKit/UIProcess/Downloads/DownloadProxy.h
    M Source/WebKit/UIProcess/Downloads/DownloadProxy.messages.in
    M Source/WebKit/UIProcess/Downloads/DownloadProxyCocoa.mm
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm
    M Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.h
    M Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.mm

  Log Message:
  -----------
  Make download placeholder and final URL available to client
https://bugs.webkit.org/show_bug.cgi?id=278688
rdar://134745889

Reviewed by Alex Christensen.

In some cases, it is important for the download client to know the location of the
placeholder file created for ongoing downloads as well as the final location. This
patch prepares for this by sending the placeholder URL and final URL from the
Networking process back to the client in the UI process. In order for the UI process
to be able to relocate the file if it is being moved at some point, we also send
bookmark data for the URL. Additionally, this patch adds a URL parameter to the
decidePlaceholderPolicy delegate completion handler, since a client should be able
to specify a custom URL if it chooses to manage the placeholder on its own.

* Source/WebKit/NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::didFinish):
* Source/WebKit/NetworkProcess/Downloads/Download.h:
* Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::publishDownloadProgress):
(WebKit::DownloadManager::clientReceivedPlaceholderURL): Deleted.
* Source/WebKit/NetworkProcess/Downloads/DownloadManager.h:
* Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::publishProgress):
(WebKit::Download::setPlaceholderURL):
(WebKit::Download::setFinalURL):
(WebKit::Download::startUpdatingProgress const):
(WebKit::Download::clientReceivedPlaceholderURL): Deleted.
(WebKit::Download::startObservingProgress const): Deleted.
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::publishDownloadProgress):
(WebKit::NetworkProcess::clientReceivedPlaceholderURL): Deleted.
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/NetworkProcess.messages.in:
* Source/WebKit/UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::didReceivePlaceholderURL):
(API::DownloadClient::didReceiveFinalURL):
* Source/WebKit/UIProcess/API/Cocoa/WKDownload.mm:
* Source/WebKit/UIProcess/API/Cocoa/WKDownloadDelegatePrivate.h:
* Source/WebKit/UIProcess/Downloads/DownloadProxy.h:
* Source/WebKit/UIProcess/Downloads/DownloadProxy.messages.in:
* Source/WebKit/UIProcess/Downloads/DownloadProxyCocoa.mm:
(WebKit::DownloadProxy::didReceivePlaceholderURL):
(WebKit::DownloadProxy::didReceiveFinalURL):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(-[ProgressObserver init]):
(-[ProgressObserver observeValueForKeyPath:ofObject:change:context:]):
(-[ProgressObserver waitForProgress]):
(tempFileThatDoesExist):
(TestWebKitAPI::PlaceholderPolicyEnable)):
(TestWebKitAPI::PlaceholderPolicyDisable)):
* Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.h:
* Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.mm:
(-[TestDownloadDelegate _download:didReceivePlaceholderURL:completionHandler:]):
(-[TestDownloadDelegate _download:didReceiveFinalURL:]):

Canonical link: https://commits.webkit.org/283386@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list