Changeset 260843 in webkit


Ignore:
Timestamp:
Apr 28, 2020 1:41:35 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Remove downloadAttribute from DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=210493

Patch by Rob Buis <rbuis@igalia.com> on 2020-04-28
Reviewed by Darin Adler.

Remove downloadAttribute from DocumentLoader since this
can be obtained from the NavigationAction.

  • loader/DocumentLoader.h:

(WebCore::DocumentLoader::downloadAttribute const):
(WebCore::DocumentLoader::setDownloadAttribute): Deleted.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadPostRequest):

  • loader/FrameLoader.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r260831 r260843  
     12020-04-28  Rob Buis  <rbuis@igalia.com>
     2
     3        Remove downloadAttribute from DocumentLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=210493
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove downloadAttribute from DocumentLoader since this
     9        can be obtained from the NavigationAction.
     10
     11        * loader/DocumentLoader.h:
     12        (WebCore::DocumentLoader::downloadAttribute const):
     13        (WebCore::DocumentLoader::setDownloadAttribute): Deleted.
     14        * loader/FrameLoader.cpp:
     15        (WebCore::FrameLoader::loadURL):
     16        (WebCore::FrameLoader::loadWithNavigationAction):
     17        (WebCore::FrameLoader::loadPostRequest):
     18        * loader/FrameLoader.h:
     19
    1202020-04-28  Jack Lee  <shihchieh_lee@apple.com>
    221
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r260709 r260843  
    398398    bool allowsDataURLsForMainFrame() const { return m_allowsDataURLsForMainFrame; }
    399399
    400     void setDownloadAttribute(const String& attribute) { m_downloadAttribute = attribute; }
    401     const String& downloadAttribute() const { return m_downloadAttribute; }
     400    const AtomString& downloadAttribute() const { return m_triggeringAction.downloadAttribute(); }
    402401
    403402    WEBCORE_EXPORT void applyPoliciesToSettings();
     
    646645    bool m_allowsWebArchiveForMainFrame { false };
    647646    bool m_allowsDataURLsForMainFrame { false };
    648     String m_downloadAttribute;
    649647};
    650648
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r260831 r260843  
    14191419        request.setSystemPreviewInfo(frameLoadRequest.systemPreviewInfo());
    14201420#endif
    1421     loadWithNavigationAction(request, WTFMove(action), newLoadType, WTFMove(formState), allowNavigationToInvalidURL, frameLoadRequest.downloadAttribute(), [this, isRedirect, sameURL, newLoadType, protectedFrame = makeRef(m_frame), completionHandler = completionHandlerCaller.release()] () mutable {
     1421    loadWithNavigationAction(request, WTFMove(action), newLoadType, WTFMove(formState), allowNavigationToInvalidURL, [this, isRedirect, sameURL, newLoadType, protectedFrame = makeRef(m_frame), completionHandler = completionHandlerCaller.release()] () mutable {
    14221422        if (isRedirect) {
    14231423            m_quickRedirectComing = false;
     
    14961496}
    14971497
    1498 void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, NavigationAction&& action, FrameLoadType type, RefPtr<FormState>&& formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, const String& downloadAttribute, CompletionHandler<void()>&& completionHandler)
     1498void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, NavigationAction&& action, FrameLoadType type, RefPtr<FormState>&& formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, CompletionHandler<void()>&& completionHandler)
    14991499{
    15001500    FRAMELOADER_RELEASE_LOG_IF_ALLOWED(ResourceLoading, "loadWithNavigationAction: frame load started");
    15011501
    15021502    Ref<DocumentLoader> loader = m_client->createDocumentLoader(request, defaultSubstituteDataForURL(request.url()));
    1503     loader->setDownloadAttribute(downloadAttribute);
    15041503    applyShouldOpenExternalURLsPolicyToNewDocumentLoader(m_frame, loader, action.initiatedByMainFrame(), action.shouldOpenExternalURLsPolicy());
    15051504
     
    30133012        document->contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(workingResourceRequest, ContentSecurityPolicy::InsecureRequestType::Load);
    30143013
    3015     NavigationAction action { request.requester(), workingResourceRequest, request.initiatedByMainFrame(), loadType, true, event, request.shouldOpenExternalURLsPolicy(), request.downloadAttribute() };
     3014    NavigationAction action { request.requester(), workingResourceRequest, request.initiatedByMainFrame(), loadType, true, event, request.shouldOpenExternalURLsPolicy(), { } };
    30163015    action.setLockHistory(lockHistory);
    30173016
     
    30193018        // The search for a target frame is done earlier in the case of form submission.
    30203019        if (auto* targetFrame = formState ? nullptr : findFrameForNavigation(frameName)) {
    3021             targetFrame->loader().loadWithNavigationAction(workingResourceRequest, WTFMove(action), loadType, WTFMove(formState), allowNavigationToInvalidURL, { }, WTFMove(completionHandler));
     3020            targetFrame->loader().loadWithNavigationAction(workingResourceRequest, WTFMove(action), loadType, WTFMove(formState), allowNavigationToInvalidURL, WTFMove(completionHandler));
    30223021            return;
    30233022        }
     
    30323031    // must grab this now, since this load may stop the previous load and clear this flag
    30333032    bool isRedirect = m_quickRedirectComing;
    3034     loadWithNavigationAction(workingResourceRequest, WTFMove(action), loadType, WTFMove(formState), allowNavigationToInvalidURL, { }, [this, isRedirect, protectedFrame = makeRef(m_frame), completionHandler = WTFMove(completionHandler)] () mutable {
     3033    loadWithNavigationAction(workingResourceRequest, WTFMove(action), loadType, WTFMove(formState), allowNavigationToInvalidURL, [this, isRedirect, protectedFrame = makeRef(m_frame), completionHandler = WTFMove(completionHandler)] () mutable {
    30353034        if (isRedirect) {
    30363035            m_quickRedirectComing = false;
  • trunk/Source/WebCore/loader/FrameLoader.h

    r260812 r260843  
    389389    void load(DocumentLoader&); // Calls loadWithDocumentLoader
    390390
    391     void loadWithNavigationAction(const ResourceRequest&, NavigationAction&&, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, const String& downloadAttribute = { }, CompletionHandler<void()>&& = [] { }); // Calls loadWithDocumentLoader
     391    void loadWithNavigationAction(const ResourceRequest&, NavigationAction&&, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, CompletionHandler<void()>&& = [] { }); // Calls loadWithDocumentLoader
    392392
    393393    void loadPostRequest(FrameLoadRequest&&, const String& referrer, FrameLoadType, Event*, RefPtr<FormState>&&, CompletionHandler<void()>&&);
Note: See TracChangeset for help on using the changeset viewer.