Changeset 238685 in webkit


Ignore:
Timestamp:
Nov 29, 2018, 12:52:46 PM (6 years ago)
Author:
ap@apple.com
Message:

Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
https://bugs.webkit.org/show_bug.cgi?id=192041

Reviewed by Tim Horton.

Source/WebCore:

  • loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options.

There is a lot of code that needs to be cleaned up here.

  • platform/network/mac/ResourceHandleMac.mm:

(WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):

Source/WebCore/PAL:

  • pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

  • NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):

Source/WTF:

  • wtf/Platform.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r238650 r238685  
     12018-11-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
     4        https://bugs.webkit.org/show_bug.cgi?id=192041
     5
     6        Reviewed by Tim Horton.
     7
     8        * wtf/Platform.h:
     9
    1102018-11-28  Mark Lam  <mark.lam@apple.com>
    211
  • trunk/Source/WTF/wtf/Platform.h

    r238650 r238685  
    13981398#define HAVE_NSHTTPCOOKIESTORAGE__INITWITHIDENTIFIER_WITH_INACCURATE_NULLABILITY 1
    13991399#endif
     1400
     1401#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS_FAMILY)
     1402#define HAVE_CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE 1
     1403/* The override isn't needed on iOS family, as the default behavior is to not sniff. */
     1404/* FIXME: This should probably be enabled on 10.13.2 and newer, not just 10.14 and newer. */
     1405#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     1406#define USE_CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE 1
     1407#endif
     1408#endif
  • trunk/Source/WebCore/ChangeLog

    r238683 r238685  
     12018-11-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
     4        https://bugs.webkit.org/show_bug.cgi?id=192041
     5
     6        Reviewed by Tim Horton.
     7
     8        * loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options.
     9        There is a lot of code that needs to be cleaned up here.
     10
     11        * platform/network/mac/ResourceHandleMac.mm:
     12        (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
     13
    1142018-11-29  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/PAL/ChangeLog

    r238682 r238685  
     12018-11-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
     4        https://bugs.webkit.org/show_bug.cgi?id=192041
     5
     6        Reviewed by Tim Horton.
     7
     8        * pal/spi/cf/CFNetworkSPI.h:
     9
    1102018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
    211
  • trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h

    r238614 r238685  
    266266extern const CFStringRef _kCFURLStorageSessionIsPrivate;
    267267
    268 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     268#if HAVE(CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE)
    269269extern const CFStringRef kCFURLRequestContentDecoderSkipURLCheck;
    270270#endif
  • trunk/Source/WebCore/loader/ResourceLoaderOptions.h

    r233839 r238685  
    4747};
    4848
     49// FIXME: These options are named poorly. We only implement force disabling content sniffing, not enabling it,
     50// and even that only on some platforms.
    4951enum class ContentSniffingPolicy : uint8_t {
    5052    SniffContent,
     
    108110};
    109111
     112// FIXME: These options are named poorly. We only implement force disabling content encoding sniffing, not enabling it,
     113// and even that only on some platforms.
    110114enum class ContentEncodingSniffingPolicy : uint8_t {
    111115    Sniff,
  • trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm

    r237266 r238685  
    110110NSURLRequest *ResourceHandle::applySniffingPoliciesIfNeeded(NSURLRequest *request, bool shouldContentSniff, bool shouldContentEncodingSniff)
    111111{
    112 #if !PLATFORM(MAC)
     112#if !USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
    113113    UNUSED_PARAM(shouldContentEncodingSniff);
    114 #elif __MAC_OS_X_VERSION_MIN_REQUIRED < 101302
    115     shouldContentEncodingSniff = true;
    116 #endif
    117     if (shouldContentSniff && shouldContentEncodingSniff)
     114#endif
     115
     116    if (shouldContentSniff
     117#if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
     118        && shouldContentEncodingSniff
     119#endif
     120        )
    118121        return request;
    119122
    120123    auto mutableRequest = adoptNS([request mutableCopy]);
    121124
    122 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101302
     125#if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
    123126    if (!shouldContentEncodingSniff)
    124127        [mutableRequest _setProperty:@(YES) forKey:(__bridge NSString *)kCFURLRequestContentDecoderSkipURLCheck];
  • trunk/Source/WebKit/ChangeLog

    r238682 r238685  
     12018-11-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
     4        https://bugs.webkit.org/show_bug.cgi?id=192041
     5
     6        Reviewed by Tim Horton.
     7
     8        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
     9        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
     10
    1112018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
    212
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm

    r238630 r238685  
    8282void NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded(__strong NSURLRequest *& nsRequest, bool shouldContentSniff, bool shouldContentEncodingSniff)
    8383{
    84 #if !PLATFORM(MAC)
     84#if !USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
    8585    UNUSED_PARAM(shouldContentEncodingSniff);
    86 #elif __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
    87     shouldContentEncodingSniff = true;
    88 #endif
     86#endif
     87
    8988    auto& cocoaSession = static_cast<NetworkSessionCocoa&>(m_session.get());
    9089    if (shouldContentSniff
     90#if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
    9191        && shouldContentEncodingSniff
     92#endif
    9293        && cocoaSession.m_boundInterfaceIdentifier.isNull()
    9394        && !cocoaSession.m_proxyConfiguration)
     
    9697    auto mutableRequest = adoptNS([nsRequest mutableCopy]);
    9798
    98 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     99#if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
    99100    if (!shouldContentEncodingSniff)
    100101        [mutableRequest _setProperty:@(YES) forKey:(NSString *)kCFURLRequestContentDecoderSkipURLCheck];
Note: See TracChangeset for help on using the changeset viewer.