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

Changeset 193380 in webkit


Ignore:
Timestamp:
Dec 3, 2015, 2:54:40 PM (11 years ago)
Author:
weinig@apple.com
Message:

It should be possible to use version 6 of the WKPageUIClient without adopting the new createNewPage
https://bugs.webkit.org/show_bug.cgi?id=151826

Reviewed by Anders Carlsson.

  • UIProcess/API/C/WKPage.cpp:

(WKPageSetPageUIClient):
Pick which variant of createNewPage to use based on which function pointer is available,
not the version number.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r193378 r193380  
     12015-12-03  Sam Weinig  <sam@webkit.org>
     2
     3        It should be possible to use version 6 of the WKPageUIClient without adopting the new createNewPage
     4        https://bugs.webkit.org/show_bug.cgi?id=151826
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/C/WKPage.cpp:
     9        (WKPageSetPageUIClient):
     10        Pick which variant of createNewPage to use based on which function pointer is available,
     11        not the version number.
     12
    1132015-12-03  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r193367 r193380  
    16361636        virtual PassRefPtr<WebPageProxy> createNewPage(WebPageProxy* page, WebFrameProxy* initiatingFrame, const SecurityOriginData& securityOriginData, const ResourceRequest& resourceRequest, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override
    16371637        {
    1638             if (m_client.base.version < 6) {
    1639                 if (!m_client.base.version && !m_client.createNewPage_deprecatedForUseWithV0)
    1640                     return nullptr;
    1641 
    1642                 if (!m_client.createNewPage_deprecatedForUseWithV1)
    1643                     return nullptr;
    1644 
     1638            if (m_client.createNewPage) {
     1639                auto configuration = page->configuration().copy();
     1640                configuration->setRelatedPage(page);
     1641
     1642                auto sourceFrameInfo = API::FrameInfo::create(*initiatingFrame, securityOriginData.securityOrigin());
     1643
     1644                bool shouldOpenAppLinks = !hostsAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame->url()), resourceRequest.url());
     1645                auto apiNavigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, resourceRequest, WebCore::URL(), shouldOpenAppLinks);
     1646
     1647                auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
     1648
     1649                return adoptRef(toImpl(m_client.createNewPage(toAPI(page), toAPI(configuration.ptr()), toAPI(apiNavigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo)));
     1650            }
     1651       
     1652            if (m_client.createNewPage_deprecatedForUseWithV1 || m_client.createNewPage_deprecatedForUseWithV0) {
    16451653                API::Dictionary::MapType map;
    16461654                if (windowFeatures.x)
     
    16621670                Ref<API::Dictionary> featuresMap = API::Dictionary::create(WTF::move(map));
    16631671
    1664                 if (!m_client.base.version)
    1665                     return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
    1666 
    1667                 Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
    1668                 return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV1(toAPI(page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
     1672                if (m_client.createNewPage_deprecatedForUseWithV1) {
     1673                    Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
     1674                    return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV1(toAPI(page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
     1675                }
     1676   
     1677                ASSERT(m_client.createNewPage_deprecatedForUseWithV0);
     1678                return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
    16691679            }
    16701680
    1671             if (!m_client.createNewPage)
    1672                 return nullptr;
    1673 
    1674             auto configuration = page->configuration().copy();
    1675             configuration->setRelatedPage(page);
    1676 
    1677             auto sourceFrameInfo = API::FrameInfo::create(*initiatingFrame, securityOriginData.securityOrigin());
    1678 
    1679             bool shouldOpenAppLinks = !hostsAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame->url()), resourceRequest.url());
    1680             auto apiNavigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, resourceRequest, WebCore::URL(), shouldOpenAppLinks);
    1681 
    1682             auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
    1683 
    1684             return adoptRef(toImpl(m_client.createNewPage(toAPI(page), toAPI(configuration.ptr()), toAPI(apiNavigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo)));
     1681            return nullptr;
    16851682        }
    16861683
Note: See TracChangeset for help on using the changeset viewer.