Changeset 242705 in webkit
- Timestamp:
- Mar 11, 2019, 8:55:07 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/APINavigationAction.h (modified) (3 diffs)
-
UIProcess/API/APIUIClient.h (modified) (1 diff)
-
UIProcess/API/C/WKPage.cpp (modified) (3 diffs)
-
UIProcess/API/glib/WebKitUIClient.cpp (modified) (1 diff)
-
UIProcess/Cocoa/NavigationState.mm (modified) (4 diffs)
-
UIProcess/Cocoa/UIDelegate.h (modified) (1 diff)
-
UIProcess/Cocoa/UIDelegate.mm (modified) (4 diffs)
-
UIProcess/WebPageProxy.cpp (modified) (3 diffs)
-
UIProcess/WebPageProxy.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r242698 r242705 1 2019-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 1 13 2019-03-10 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Source/WebKit/UIProcess/API/APINavigationAction.h
r242697 r242705 34 34 #include <wtf/URL.h> 35 35 36 #if USE(APPLE_INTERNAL_SDK)37 #include <WebKitAdditions/APINavigationActionAdditions.h>38 #endif39 40 36 namespace API { 41 37 … … 70 66 Navigation* mainFrameNavigation() const { return m_mainFrameNavigation.get(); } 71 67 72 #if HAVE(LOAD_OPTIMIZER)73 APINAVIGATIONACTION_LOADOPTIMIZER_ADDITIONS_174 #endif75 76 68 private: 77 69 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) … … 101 93 102 94 bool m_shouldOpenAppLinks; 103 #if HAVE(LOAD_OPTIMIZER)104 APINAVIGATIONACTION_LOADOPTIMIZER_ADDITIONS_2105 #endif106 95 107 96 RefPtr<UserInitiatedAction> m_userInitiatedAction; -
trunk/Source/WebKit/UIProcess/API/APIUIClient.h
r242697 r242705 74 74 virtual ~UIClient() { } 75 75 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); } 77 77 virtual void showPage(WebKit::WebPageProxy*) { } 78 78 virtual void fullscreenMayReturnToInline(WebKit::WebPageProxy*) { } -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r242697 r242705 1475 1475 1476 1476 private: 1477 void createNewPage(WebPageProxy& page, WebCore::WindowFeatures&& windowFeatures, Ref<API::NavigationAction>&& navigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final1477 void createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& sourceFrameInfo, WebCore::ResourceRequest&& resourceRequest, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final 1478 1478 { 1479 1479 if (m_client.createNewPage) { … … 1481 1481 configuration->setRelatedPage(&page); 1482 1482 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 1483 1487 auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); 1484 1488 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)))); 1486 1490 } 1487 1491 … … 1507 1511 1508 1512 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)))); 1511 1515 } 1512 1516 1513 1517 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)))); 1515 1519 } 1516 1520 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp
r242697 r242705 51 51 52 52 private: 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))); 56 57 completionHandler(webkitWebViewCreateNewPage(m_webView, windowFeatures, &navigationAction)); 57 58 } -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
r242697 r242705 468 468 469 469 #if !USE(APPLE_INTERNAL_SDK) 470 static void tryOptimizingLoad( Ref<API::NavigationAction>&&, WebPageProxy&, Function<void(bool)>&& completionHandler)470 static void tryOptimizingLoad(const WebCore::ResourceRequest&, WebPageProxy&, Function<void(bool)>&& completionHandler) 471 471 { 472 472 completionHandler(false); … … 478 478 #if HAVE(APP_LINKS) 479 479 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 { 482 481 ASSERT(RunLoop::isMain()); 483 482 if (!success && weakPage) { 484 tryOptimizingLoad( WTFMove(navigationAction), *weakPage, WTFMove(completionHandler));483 tryOptimizingLoad(request, *weakPage, WTFMove(completionHandler)); 485 484 return; 486 485 } 487 486 completionHandler(success); 488 487 }); 489 [LSAppLink openWithURL: urlcompletionHandler:[localCompletionHandler](BOOL success, NSError *) {488 [LSAppLink openWithURL:navigationAction->request().url() completionHandler:[localCompletionHandler](BOOL success, NSError *) { 490 489 dispatch_async(dispatch_get_main_queue(), [localCompletionHandler, success] { 491 490 (*localCompletionHandler)(success); … … 497 496 #endif 498 497 499 tryOptimizingLoad( WTFMove(navigationAction), page, WTFMove(completionHandler));498 tryOptimizingLoad(navigationAction->request(), page, WTFMove(completionHandler)); 500 499 } 501 500 … … 589 588 break; 590 589 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) { 592 591 if (optimizedLoad) { 593 592 localListener->ignore(); -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h
r242697 r242705 80 80 private: 81 81 // API::UIClient 82 void createNewPage(Web Kit::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; 83 83 void close(WebPageProxy*) final; 84 84 void fullscreenMayReturnToInline(WebPageProxy*) final; -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
r242697 r242705 229 229 } 230 230 231 void UIDelegate::UIClient::createNewPage(Web Kit::WebPageProxy&, WebCore::WindowFeatures&& windowFeatures, Ref<API::NavigationAction>&& navigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler)231 void UIDelegate::UIClient::createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& sourceFrameInfo, WebCore::ResourceRequest&& request, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) 232 232 { 233 233 auto delegate = m_uiDelegate.m_delegate.get(); … … 237 237 [configuration _setRelatedWebView:m_uiDelegate.m_webView]; 238 238 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 239 243 auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); 240 244 … … 242 246 auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:completionHandler:)); 243 247 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 { 245 249 if (checker->completionHandlerHasBeenCalled()) 246 250 return; … … 262 266 return completionHandler(nullptr); 263 267 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)]; 265 269 if (!webView) 266 270 return completionHandler(nullptr); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r242697 r242705 4603 4603 auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTF::nullopt, WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity), mainFrameNavigation); 4604 4604 4605 #if HAVE(LOAD_OPTIMIZER)4606 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_34607 #endif4608 4609 4605 m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navigationAction), WTFMove(listener), process->transformHandlesToObjects(userData.object()).get()); 4610 4606 } 4611 4607 4612 4608 m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false; 4613 4614 #if HAVE(LOAD_OPTIMIZER)4615 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_44616 #endif4617 4609 } 4618 4610 … … 4900 4892 // UIClient 4901 4893 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_64908 #else4909 ASSERT_UNUSED(page, page.pageID());4910 uiClientCallback(WTFMove(navigationAction), WTFMove(newPageCallback));4911 #endif4912 }4913 4914 4894 void WebPageProxy::createNewPage(const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, ResourceRequest&& request, WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, Messages::WebPageProxy::CreateNewPage::DelayedReply&& reply) 4915 4895 { 4916 4896 MESSAGE_CHECK(m_process, m_process->webFrame(originatingFrameInfoData.frameID)); 4917 4897 auto originatingFrameInfo = API::FrameInfo::create(originatingFrameInfoData, m_process->webPage(originatingPageID)); 4898 4918 4899 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 { 4920 4902 if (!newPage) { 4921 4903 reply(0, WTF::nullopt); … … 4929 4911 WebsiteDataStore::cloneSessionData(*this, *newPage); 4930 4912 newPage->m_shouldSuppressAppLinksInNextNavigationPolicyDecision = hostsAreEqual(URL({ }, mainFrameURL), request.url()); 4931 4932 #if HAVE(LOAD_OPTIMIZER)4933 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_54934 #endif4935 };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));4943 4913 }); 4944 4914 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r242697 r242705 136 136 #endif 137 137 138 #if USE(APPLE_INTERNAL_SDK)139 #include <WebKitAdditions/WebPageProxyAdditions.h>140 #endif141 142 138 #if ENABLE(MEDIA_SESSION) 143 139 namespace WebCore { … … 1485 1481 void webViewDidMoveToWindow(); 1486 1482 1487 #if HAVE(LOAD_OPTIMIZER)1488 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_11489 #endif1490 1491 1483 // IPC::MessageReceiver 1492 1484 // Implemented in generated WebPageProxyMessageReceiver.cpp … … 2196 2188 bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false }; 2197 2189 2198 #if HAVE(LOAD_OPTIMIZER)2199 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_22200 #endif2201 2202 2190 Deque<NativeWebMouseEvent> m_mouseEventQueue; 2203 2191 Deque<NativeWebKeyboardEvent> m_keyEventQueue;
Note:
See TracChangeset
for help on using the changeset viewer.