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

Changeset 194080 in webkit


Ignore:
Timestamp:
Dec 14, 2015, 4:35:44 PM (11 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r193380. rdar://problem/23816165

Location:
branches/safari-601-branch/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601-branch/Source/WebCore/platform/URL.cpp

    r190142 r194080  
    15981598}
    15991599
     1600bool hostsAreEqual(const URL& a, const URL& b)
     1601{
     1602    int hostStartA = a.hostStart();
     1603    int hostLengthA = a.hostEnd() - hostStartA;
     1604    int hostStartB = b.hostStart();
     1605    int hostLengthB = b.hostEnd() - hostStartB;
     1606    if (hostLengthA != hostLengthB)
     1607        return false;
     1608
     1609    for (int i = 0; i < hostLengthA; ++i) {
     1610        if (a.string()[hostStartA + i] != b.string()[hostStartB + i])
     1611            return false;
     1612    }
     1613   
     1614    return true;
     1615}
     1616
    16001617String encodeWithURLEscapeSequences(const String& notEncodedString, PercentEncodeCharacterClass whatToEncode)
    16011618{
  • branches/safari-601-branch/Source/WebCore/platform/URL.h

    r183901 r194080  
    233233WEBCORE_EXPORT bool equalIgnoringFragmentIdentifier(const URL&, const URL&);
    234234WEBCORE_EXPORT bool protocolHostAndPortAreEqual(const URL&, const URL&);
     235WEBCORE_EXPORT bool hostsAreEqual(const URL&, const URL&);
    235236
    236237WEBCORE_EXPORT const URL& blankURL();
  • branches/safari-601-branch/Source/WebKit2/ChangeLog

    r194079 r194080  
     12015-12-08  Harris Papadopoulos  <cpapadopoulos@apple.com>
     2
     3        Merge r193380. rdar://problem/23816165
     4
     5    2015-12-03  Sam Weinig  <sam@webkit.org>
     6
     7            It should be possible to use version 6 of the WKPageUIClient without adopting the new createNewPage
     8            https://bugs.webkit.org/show_bug.cgi?id=151826
     9
     10            Reviewed by Anders Carlsson.
     11
     12            * UIProcess/API/C/WKPage.cpp:
     13            (WKPageSetPageUIClient):
     14            Pick which variant of createNewPage to use based on which function pointer is available,
     15            not the version number.
     16
    1172015-12-08  Harris Papadopoulos  <cpapadopoulos@apple.com>
    218
  • branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r194079 r194080  
    15921592        virtual PassRefPtr<WebPageProxy> createNewPage(WebPageProxy* page, WebFrameProxy* initiatingFrame, const SecurityOriginData& securityOriginData, const ResourceRequest& resourceRequest, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override
    15931593        {
    1594             if (m_client.base.version < 6) {
    1595                 if (!m_client.base.version && !m_client.createNewPage_deprecatedForUseWithV0)
    1596                     return nullptr;
    1597 
    1598                 if (!m_client.createNewPage_deprecatedForUseWithV1)
    1599                     return nullptr;
    1600 
     1594            if (m_client.createNewPage) {
     1595                auto configuration = page->configuration().copy();
     1596                configuration->setRelatedPage(page);
     1597
     1598                auto sourceFrameInfo = API::FrameInfo::create(*initiatingFrame, securityOriginData.securityOrigin());
     1599
     1600                bool shouldOpenAppLinks = !hostsAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame->url()), resourceRequest.url());
     1601                auto apiNavigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, resourceRequest, WebCore::URL(), shouldOpenAppLinks);
     1602
     1603                auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
     1604
     1605                return adoptRef(toImpl(m_client.createNewPage(toAPI(page), toAPI(configuration.ptr()), toAPI(apiNavigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo)));
     1606            }
     1607       
     1608            if (m_client.createNewPage_deprecatedForUseWithV1 || m_client.createNewPage_deprecatedForUseWithV0) {
    16011609                API::Dictionary::MapType map;
    16021610                if (windowFeatures.x)
     
    16181626                Ref<API::Dictionary> featuresMap = API::Dictionary::create(WTF::move(map));
    16191627
    1620                 if (!m_client.base.version)
    1621                     return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
    1622 
    1623                 Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
    1624                 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)));
     1628                if (m_client.createNewPage_deprecatedForUseWithV1) {
     1629                    Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
     1630                    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)));
     1631                }
     1632   
     1633                ASSERT(m_client.createNewPage_deprecatedForUseWithV0);
     1634                return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
    16251635            }
    16261636
Note: See TracChangeset for help on using the changeset viewer.