Changeset 238937 in webkit


Ignore:
Timestamp:
Dec 6, 2018 12:07:38 PM (5 years ago)
Author:
david_quesada@apple.com
Message:

-[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
https://bugs.webkit.org/show_bug.cgi?id=192411
rdar://problem/46492487

Reviewed by Alex Christensen.

  • UIProcess/API/C/WKContext.cpp:

(WKContextResumeDownload):

  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.

  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::resumeDownload):

  • Set the originating page of the DownloadProxy.
  • If the originating page is non-null, use its session ID for the download.
  • Remove a FIXME. It's possible to do this now by providing the web view whose session should be used for the download.
  • UIProcess/WebProcessPool.h:
Location:
trunk/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238936 r238937  
     12018-12-06  David Quesada  <david_quesada@apple.com>
     2
     3        -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
     4        https://bugs.webkit.org/show_bug.cgi?id=192411
     5        rdar://problem/46492487
     6
     7        Reviewed by Alex Christensen.
     8
     9        * UIProcess/API/C/WKContext.cpp:
     10        (WKContextResumeDownload):
     11        * UIProcess/API/Cocoa/WKProcessPool.mm:
     12        (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
     13        (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
     14        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
     15        * UIProcess/WebProcessPool.cpp:
     16        (WebKit::WebProcessPool::resumeDownload):
     17         - Set the originating page of the DownloadProxy.
     18         - If the originating page is non-null, use its session ID for the download.
     19         - Remove a FIXME. It's possible to do this now by providing the web view whose session
     20           should be used for the download.
     21        * UIProcess/WebProcessPool.h:
     22
    1232018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
    224
  • trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp

    r238248 r238937  
    283283WKDownloadRef WKContextResumeDownload(WKContextRef contextRef, WKDataRef resumeData, WKStringRef path)
    284284{
    285     return toAPI(toImpl(contextRef)->resumeDownload(toImpl(resumeData), toWTFString(path)));
     285    return toAPI(toImpl(contextRef)->resumeDownload(nullptr, toImpl(resumeData), toWTFString(path)));
    286286}
    287287
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm

    r238742 r238937  
    577577}
    578578
    579 - (_WKDownload *)_resumeDownloadFromData:(NSData *)resumeData path:(NSString *)path
    580 {
    581     return wrapper(_processPool->resumeDownload(API::Data::createWithoutCopying(resumeData).ptr(), path));
     579- (_WKDownload *)_resumeDownloadFromData:(NSData *)resumeData path:(NSString *)path originatingWebView:(WKWebView *)webView
     580{
     581    return wrapper(_processPool->resumeDownload([webView _page], API::Data::createWithoutCopying(resumeData).ptr(), path));
    582582}
    583583
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h

    r238742 r238937  
    8383
    8484- (_WKDownload *)_downloadURLRequest:(NSURLRequest *)request originatingWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
    85 - (_WKDownload *)_resumeDownloadFromData:(NSData *)resumeData path:(NSString *)path WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
     85- (_WKDownload *)_resumeDownloadFromData:(NSData *)resumeData path:(NSString *)path originatingWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
    8686
    8787// Test only. Should be called only while no web content processes are running.
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r238909 r238937  
    12621262}
    12631263
    1264 DownloadProxy* WebProcessPool::resumeDownload(const API::Data* resumeData, const String& path)
    1265 {
    1266     auto* downloadProxy = createDownloadProxy(ResourceRequest(), nullptr);
     1264DownloadProxy* WebProcessPool::resumeDownload(WebPageProxy* initiatingPage, const API::Data* resumeData, const String& path)
     1265{
     1266    auto* downloadProxy = createDownloadProxy(ResourceRequest(), initiatingPage);
     1267    PAL::SessionID sessionID = initiatingPage ? initiatingPage->sessionID() : PAL::SessionID::defaultSessionID();
    12671268
    12681269    SandboxExtension::Handle sandboxExtensionHandle;
     
    12711272
    12721273    if (networkProcess()) {
    1273         // FIXME: If we started a download in an ephemeral session and that session still exists, we should find a way to use that same session.
    1274         networkProcess()->send(Messages::NetworkProcess::ResumeDownload(PAL::SessionID::defaultSessionID(), downloadProxy->downloadID(), resumeData->dataReference(), path, sandboxExtensionHandle), 0);
     1274        networkProcess()->send(Messages::NetworkProcess::ResumeDownload(sessionID, downloadProxy->downloadID(), resumeData->dataReference(), path, sandboxExtensionHandle), 0);
    12751275        return downloadProxy;
    12761276    }
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r238771 r238937  
    190190
    191191    DownloadProxy* download(WebPageProxy* initiatingPage, const WebCore::ResourceRequest&, const String& suggestedFilename = { });
    192     DownloadProxy* resumeDownload(const API::Data* resumeData, const String& path);
     192    DownloadProxy* resumeDownload(WebPageProxy* initiatingPage, const API::Data* resumeData, const String& path);
    193193
    194194    void setInjectedBundleInitializationUserData(RefPtr<API::Object>&& userData) { m_injectedBundleInitializationUserData = WTFMove(userData); }
Note: See TracChangeset for help on using the changeset viewer.