⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242705 in webkit


Ignore:
Timestamp:
Mar 11, 2019, 8:55:07 AM (7 years ago)
Author:
Truitt Savell
Message:

Unreviewed, rolling out r242697.

Broke internal builders.

Reverted changeset:

"Optimizing loads when creating new pages"
https://bugs.webkit.org/show_bug.cgi?id=195516
https://trac.webkit.org/changeset/242697

Location:
trunk/Source/WebKit
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r242698 r242705  
     12019-03-11  Truitt Savell  <tsavell@apple.com>
     2
     3        Unreviewed, rolling out r242697.
     4
     5        Broke internal builders.
     6
     7        Reverted changeset:
     8
     9        "Optimizing loads when creating new pages"
     10        https://bugs.webkit.org/show_bug.cgi?id=195516
     11        https://trac.webkit.org/changeset/242697
     12
    1132019-03-10  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebKit/UIProcess/API/APINavigationAction.h

    r242697 r242705  
    3434#include <wtf/URL.h>
    3535
    36 #if USE(APPLE_INTERNAL_SDK)
    37 #include <WebKitAdditions/APINavigationActionAdditions.h>
    38 #endif
    39 
    4036namespace API {
    4137
     
    7066    Navigation* mainFrameNavigation() const { return m_mainFrameNavigation.get(); }
    7167
    72 #if HAVE(LOAD_OPTIMIZER)
    73 APINAVIGATIONACTION_LOADOPTIMIZER_ADDITIONS_1
    74 #endif
    75 
    7668private:
    7769    NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, Optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction, API::Navigation* mainFrameNavigation)
     
    10193
    10294    bool m_shouldOpenAppLinks;
    103 #if HAVE(LOAD_OPTIMIZER)
    104 APINAVIGATIONACTION_LOADOPTIMIZER_ADDITIONS_2
    105 #endif
    10695
    10796    RefPtr<UserInitiatedAction> m_userInitiatedAction;
  • trunk/Source/WebKit/UIProcess/API/APIUIClient.h

    r242697 r242705  
    7474    virtual ~UIClient() { }
    7575
    76     virtual void createNewPage(WebKit::WebPageProxy&, WebCore::WindowFeatures&&, Ref<API::NavigationAction>&&, CompletionHandler<void(RefPtr<WebKit::WebPageProxy>&&)>&& completionHandler) { completionHandler(nullptr); }
     76    virtual void createNewPage(WebKit::WebPageProxy&, Ref<FrameInfo>&&, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, WebKit::NavigationActionData&&, CompletionHandler<void(RefPtr<WebKit::WebPageProxy>&&)>&& completionHandler) { completionHandler(nullptr); }
    7777    virtual void showPage(WebKit::WebPageProxy*) { }
    7878    virtual void fullscreenMayReturnToInline(WebKit::WebPageProxy*) { }
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r242697 r242705  
    14751475
    14761476    private:
    1477         void createNewPage(WebPageProxy& page, WebCore::WindowFeatures&& windowFeatures, Ref<API::NavigationAction>&& navigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final
     1477        void createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& sourceFrameInfo, WebCore::ResourceRequest&& resourceRequest, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final
    14781478        {
    14791479            if (m_client.createNewPage) {
     
    14811481                configuration->setRelatedPage(&page);
    14821482
     1483                auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
     1484                bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo->request().url(), resourceRequest.url());
     1485                auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(resourceRequest), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
     1486
    14831487                auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
    14841488
    1485                 return completionHandler(adoptRef(toImpl(m_client.createNewPage(toAPI(&page), toAPI(configuration.ptr()), toAPI(navigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo))));
     1489                return completionHandler(adoptRef(toImpl(m_client.createNewPage(toAPI(&page), toAPI(configuration.ptr()), toAPI(apiNavigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo))));
    14861490            }
    14871491       
     
    15071511
    15081512                if (m_client.createNewPage_deprecatedForUseWithV1) {
    1509                     Ref<API::URLRequest> request = API::URLRequest::create(navigationAction->request());
    1510                     return completionHandler(adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV1(toAPI(&page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationAction->modifiers()), toAPI(navigationAction->mouseButton()), m_client.base.clientInfo))));
     1513                    Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
     1514                    return completionHandler(adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV1(toAPI(&page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo))));
    15111515                }
    15121516   
    15131517                ASSERT(m_client.createNewPage_deprecatedForUseWithV0);
    1514                 return completionHandler(adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(&page), toAPI(featuresMap.ptr()), toAPI(navigationAction->modifiers()), toAPI(navigationAction->mouseButton()), m_client.base.clientInfo))));
     1518                return completionHandler(adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(&page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo))));
    15151519            }
    15161520
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp

    r242697 r242705  
    5151
    5252private:
    53     void createNewPage(WebPageProxy& page, WebCore::WindowFeatures&& windowFeatures, Ref<API::NavigationAction>&& apiNavigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final
    54     {
    55         WebKitNavigationAction navigationAction(WTFMove(apiNavigationAction));
     53    void createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& frameInfo, WebCore::ResourceRequest&& resourceRequest, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final
     54    {
     55        auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
     56        WebKitNavigationAction navigationAction(API::NavigationAction::create(WTFMove(navigationActionData), frameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(resourceRequest), URL { }, false, WTFMove(userInitiatedActivity)));
    5657        completionHandler(webkitWebViewCreateNewPage(m_webView, windowFeatures, &navigationAction));
    5758    }
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r242697 r242705  
    468468
    469469#if !USE(APPLE_INTERNAL_SDK)
    470 static void tryOptimizingLoad(Ref<API::NavigationAction>&&, WebPageProxy&, Function<void(bool)>&& completionHandler)
     470static void tryOptimizingLoad(const WebCore::ResourceRequest&, WebPageProxy&, Function<void(bool)>&& completionHandler)
    471471{
    472472    completionHandler(false);
     
    478478#if HAVE(APP_LINKS)
    479479    if (navigationAction->shouldOpenAppLinks()) {
    480         auto url = navigationAction->request().url();
    481         auto* localCompletionHandler = new WTF::Function<void (bool)>([navigationAction = WTFMove(navigationAction), weakPage = makeWeakPtr(page), completionHandler = WTFMove(completionHandler)] (bool success) mutable {
     480        auto* localCompletionHandler = new WTF::Function<void (bool)>([request = navigationAction->request().isolatedCopy(), weakPage = makeWeakPtr(page), completionHandler = WTFMove(completionHandler)] (bool success) mutable {
    482481            ASSERT(RunLoop::isMain());
    483482            if (!success && weakPage) {
    484                 tryOptimizingLoad(WTFMove(navigationAction), *weakPage, WTFMove(completionHandler));
     483                tryOptimizingLoad(request, *weakPage, WTFMove(completionHandler));
    485484                return;
    486485            }
    487486            completionHandler(success);
    488487        });
    489         [LSAppLink openWithURL:url completionHandler:[localCompletionHandler](BOOL success, NSError *) {
     488        [LSAppLink openWithURL:navigationAction->request().url() completionHandler:[localCompletionHandler](BOOL success, NSError *) {
    490489            dispatch_async(dispatch_get_main_queue(), [localCompletionHandler, success] {
    491490                (*localCompletionHandler)(success);
     
    497496#endif
    498497
    499     tryOptimizingLoad(WTFMove(navigationAction), page, WTFMove(completionHandler));
     498    tryOptimizingLoad(navigationAction->request(), page, WTFMove(completionHandler));
    500499}
    501500
     
    589588            break;
    590589        case _WKNavigationActionPolicyAllowWithoutTryingAppLink:
    591             tryOptimizingLoad(WTFMove(navigationAction), webPageProxy, [localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)] (bool optimizedLoad) {
     590            tryOptimizingLoad(navigationAction->request(), webPageProxy, [localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)] (bool optimizedLoad) {
    592591                if (optimizedLoad) {
    593592                    localListener->ignore();
  • trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h

    r242697 r242705  
    8080    private:
    8181        // API::UIClient
    82         void createNewPage(WebKit::WebPageProxy&, WebCore::WindowFeatures&&, Ref<API::NavigationAction>&&, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&&) final;
     82        void createNewPage(WebPageProxy&, Ref<API::FrameInfo>&&, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&&) final;
    8383        void close(WebPageProxy*) final;
    8484        void fullscreenMayReturnToInline(WebPageProxy*) final;
  • trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm

    r242697 r242705  
    229229}
    230230
    231 void UIDelegate::UIClient::createNewPage(WebKit::WebPageProxy&, WebCore::WindowFeatures&& windowFeatures, Ref<API::NavigationAction>&& navigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler)
     231void UIDelegate::UIClient::createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& sourceFrameInfo, WebCore::ResourceRequest&& request, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler)
    232232{
    233233    auto delegate = m_uiDelegate.m_delegate.get();
     
    237237    [configuration _setRelatedWebView:m_uiDelegate.m_webView];
    238238
     239    auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
     240    bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo->request().url(), request.url());
     241    auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(request), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
     242
    239243    auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
    240244
     
    242246        auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:completionHandler:));
    243247
    244         [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(navigationAction) windowFeatures:wrapper(apiWindowFeatures) completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker), relatedWebView = RetainPtr<WKWebView>(m_uiDelegate.m_webView)] (WKWebView *webView) mutable {
     248        [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(apiNavigationAction) windowFeatures:wrapper(apiWindowFeatures) completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker), relatedWebView = RetainPtr<WKWebView>(m_uiDelegate.m_webView)] (WKWebView *webView) mutable {
    245249            if (checker->completionHandlerHasBeenCalled())
    246250                return;
     
    262266        return completionHandler(nullptr);
    263267
    264     RetainPtr<WKWebView> webView = [delegate webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(navigationAction) windowFeatures:wrapper(apiWindowFeatures)];
     268    RetainPtr<WKWebView> webView = [delegate webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(apiNavigationAction) windowFeatures:wrapper(apiWindowFeatures)];
    265269    if (!webView)
    266270        return completionHandler(nullptr);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r242697 r242705  
    46034603        auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTF::nullopt, WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity), mainFrameNavigation);
    46044604
    4605 #if HAVE(LOAD_OPTIMIZER)
    4606 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_3
    4607 #endif
    4608 
    46094605        m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navigationAction), WTFMove(listener), process->transformHandlesToObjects(userData.object()).get());
    46104606    }
    46114607
    46124608    m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false;
    4613 
    4614 #if HAVE(LOAD_OPTIMIZER)
    4615 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_4
    4616 #endif
    46174609}
    46184610
     
    49004892// UIClient
    49014893
    4902 using NewPageCallback = CompletionHandler<void(RefPtr<WebPageProxy>&&)>;
    4903 using UIClientCallback = Function<void(Ref<API::NavigationAction>&&, NewPageCallback&&)>;
    4904 static void tryOptimizingLoad(Ref<API::NavigationAction>&& navigationAction, WebPageProxy& page, NewPageCallback&& newPageCallback, UIClientCallback&& uiClientCallback)
    4905 {
    4906 #if HAVE(LOAD_OPTIMIZER)
    4907 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_6
    4908 #else
    4909     ASSERT_UNUSED(page, page.pageID());
    4910     uiClientCallback(WTFMove(navigationAction), WTFMove(newPageCallback));
    4911 #endif
    4912 }
    4913 
    49144894void WebPageProxy::createNewPage(const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, ResourceRequest&& request, WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, Messages::WebPageProxy::CreateNewPage::DelayedReply&& reply)
    49154895{
    49164896    MESSAGE_CHECK(m_process, m_process->webFrame(originatingFrameInfoData.frameID));
    49174897    auto originatingFrameInfo = API::FrameInfo::create(originatingFrameInfoData, m_process->webPage(originatingPageID));
     4898
    49184899    auto mainFrameURL = m_mainFrame->url();
    4919     auto completionHandler = [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply)] (RefPtr<WebPageProxy> newPage) mutable {
     4900
     4901    m_uiClient->createNewPage(*this, WTFMove(originatingFrameInfo), WTFMove(request), WTFMove(windowFeatures), WTFMove(navigationActionData), [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply)] (RefPtr<WebPageProxy> newPage) mutable {
    49204902        if (!newPage) {
    49214903            reply(0, WTF::nullopt);
     
    49294911        WebsiteDataStore::cloneSessionData(*this, *newPage);
    49304912        newPage->m_shouldSuppressAppLinksInNextNavigationPolicyDecision = hostsAreEqual(URL({ }, mainFrameURL), request.url());
    4931 
    4932 #if HAVE(LOAD_OPTIMIZER)
    4933 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_5
    4934 #endif
    4935     };
    4936 
    4937     auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
    4938     bool shouldOpenAppLinks = !hostsAreEqual(originatingFrameInfo->request().url(), request.url());
    4939     auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), originatingFrameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(request), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
    4940 
    4941     tryOptimizingLoad(WTFMove(navigationAction), *this, WTFMove(completionHandler), [this, protectedThis = makeRef(*this), windowFeatures = WTFMove(windowFeatures)] (Ref<API::NavigationAction>&& navigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) mutable {
    4942         m_uiClient->createNewPage(*this, WTFMove(windowFeatures), WTFMove(navigationAction), WTFMove(completionHandler));
    49434913    });
    49444914}
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r242697 r242705  
    136136#endif
    137137
    138 #if USE(APPLE_INTERNAL_SDK)
    139 #include <WebKitAdditions/WebPageProxyAdditions.h>
    140 #endif
    141 
    142138#if ENABLE(MEDIA_SESSION)
    143139namespace WebCore {
     
    14851481    void webViewDidMoveToWindow();
    14861482
    1487 #if HAVE(LOAD_OPTIMIZER)
    1488 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_1
    1489 #endif
    1490 
    14911483    // IPC::MessageReceiver
    14921484    // Implemented in generated WebPageProxyMessageReceiver.cpp
     
    21962188    bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
    21972189
    2198 #if HAVE(LOAD_OPTIMIZER)
    2199 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_2
    2200 #endif
    2201 
    22022190    Deque<NativeWebMouseEvent> m_mouseEventQueue;
    22032191    Deque<NativeWebKeyboardEvent> m_keyEventQueue;
Note: See TracChangeset for help on using the changeset viewer.