Changeset 202279 in webkit


Ignore:
Timestamp:
Jun 21, 2016 10:20:08 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
https://bugs.webkit.org/show_bug.cgi?id=158967

Patch by Amir Alavi <aalavi@apple.com> on 2016-06-21
Reviewed by Brent Fulgham.

Source/WebCore:

  • platform/ios/WebCoreSystemInterfaceIOS.mm:
  • platform/mac/WebCoreSystemInterface.h:
  • platform/mac/WebCoreSystemInterface.mm:
  • platform/network/mac/CookieJarMac.mm:

(WebCore::httpCookiesForURL): Upstreamed from WebKitSystemInterface.
(WebCore::cookiesForURL): Changed to call httpCookiesForURL.
(WebCore::deleteCookie): Ditto.

  • platform/spi/cf/CFNetworkSPI.h:

Source/WebKit/mac:

  • WebCoreSupport/WebSystemInterface.mm:

(InitWebCoreSystemInterface): Deleted.

Source/WebKit2:

  • WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:

(InitWebCoreSystemInterface): Deleted.

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202278 r202279  
     12016-06-21  Amir Alavi  <aalavi@apple.com>
     2
     3        Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
     4        https://bugs.webkit.org/show_bug.cgi?id=158967
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * platform/ios/WebCoreSystemInterfaceIOS.mm:
     9        * platform/mac/WebCoreSystemInterface.h:
     10        * platform/mac/WebCoreSystemInterface.mm:
     11        * platform/network/mac/CookieJarMac.mm:
     12        (WebCore::httpCookiesForURL): Upstreamed from WebKitSystemInterface.
     13        (WebCore::cookiesForURL): Changed to call httpCookiesForURL.
     14        (WebCore::deleteCookie): Ditto.
     15        * platform/spi/cf/CFNetworkSPI.h:
     16
    1172016-06-21  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm

    r194378 r202279  
    4444WEBCORE_EXPORT unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
    4545WEBCORE_EXPORT NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
    46 WEBCORE_EXPORT NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
    4746WEBCORE_EXPORT void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
    4847WEBCORE_EXPORT void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
  • trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h

    r194378 r202279  
    223223extern unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
    224224extern NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
    225 extern NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
    226225extern void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
    227226extern void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
  • trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm

    r194378 r202279  
    100100unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
    101101NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
    102 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
    103102void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
    104103void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
  • trunk/Source/WebCore/platform/network/mac/CookieJarMac.mm

    r201038 r202279  
    4646namespace WebCore {
    4747
     48static NSArray *httpCookiesForURL(CFHTTPCookieStorageRef cookieStorage, NSURL *firstParty, NSURL *url)
     49{
     50    if (!cookieStorage) {
     51        // FIXME: The fallback to NSHTTPCookieStorage should not be present when USE(CFNETWORK) is defined.
     52        return [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:url];
     53    }
     54
     55    bool secure = ![[url scheme] caseInsensitiveCompare:@"https"];
     56   
     57    auto cookies = adoptCF(_CFHTTPCookieStorageCopyCookiesForURLWithMainDocumentURL(cookieStorage, static_cast<CFURLRef>(url), static_cast<CFURLRef>(firstParty), secure));
     58    NSArray *nsCookies = [NSHTTPCookie _cf2nsCookies:cookies.get()];
     59
     60    return nsCookies;
     61}
     62
     63   
    4864static RetainPtr<NSArray> filterCookies(NSArray *unfilteredCookies)
    4965{
     
    119135        return cookies;
    120136#endif
    121     return wkHTTPCookiesForURL(session.cookieStorage().get(), firstParty, url);
     137    return httpCookiesForURL(session.cookieStorage().get(), firstParty, url);
    122138}
    123139
     
    233249
    234250    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = session.cookieStorage();
    235     NSArray *cookies = wkHTTPCookiesForURL(cookieStorage.get(), 0, url);
     251    NSArray *cookies = httpCookiesForURL(cookieStorage.get(), nil, url);
    236252
    237253    NSString *cookieNameString = cookieName;
  • trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h

    r201492 r202279  
    179179EXTERN_C void CFURLResponseSetMIMEType(CFURLResponseRef, CFStringRef);
    180180EXTERN_C CFHTTPCookieStorageRef _CFURLStorageSessionCopyCookieStorage(CFAllocatorRef, CFURLStorageSessionRef);
     181EXTERN_C CFArrayRef _CFHTTPCookieStorageCopyCookiesForURLWithMainDocumentURL(CFHTTPCookieStorageRef inCookieStorage, CFURLRef inURL, CFURLRef inMainDocumentURL, Boolean sendSecureCookies);
    181182
    182183// FIXME: We should only forward declare this SPI when building for iOS without the Apple Internal SDK.
     
    217218#if defined(__OBJC__)
    218219
     220@interface NSHTTPCookie ()
    219221#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
    220 @interface NSHTTPCookie ()
    221222+ (NSArray *)_parsedCookiesWithResponseHeaderFields:(NSDictionary *)headerFields forURL:(NSURL *)aURL;
    222 @end
    223 #endif
     223#endif
     224+ (NSArray *)_cf2nsCookies:(CFArrayRef)cfCookies;
     225@end
    224226
    225227#if !USE(APPLE_INTERNAL_SDK)
  • trunk/Source/WebKit/mac/ChangeLog

    r202263 r202279  
     12016-06-21  Amir Alavi  <aalavi@apple.com>
     2
     3        Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
     4        https://bugs.webkit.org/show_bug.cgi?id=158967
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * WebCoreSupport/WebSystemInterface.mm:
     9        (InitWebCoreSystemInterface): Deleted.
     10
    1112016-06-20  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm

    r194378 r202279  
    114114    INIT(GetHTTPCookieAcceptPolicy);
    115115    INIT(HTTPCookies);
    116     INIT(HTTPCookiesForURL);
    117116    INIT(SetHTTPCookiesForURL);
    118117    INIT(DeleteAllHTTPCookies);
  • trunk/Source/WebKit2/ChangeLog

    r202274 r202279  
     12016-06-21  Amir Alavi  <aalavi@apple.com>
     2
     3        Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
     4        https://bugs.webkit.org/show_bug.cgi?id=158967
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
     9        (InitWebCoreSystemInterface): Deleted.
     10
    1112016-06-21  Dan Bernstein  <mitz@apple.com>
    212
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm

    r194378 r202279  
    8484        INIT(GetHTTPCookieAcceptPolicy);
    8585        INIT(HTTPCookies);
    86         INIT(HTTPCookiesForURL);
    8786        INIT(SetHTTPCookiesForURL);
    8887        INIT(DeleteAllHTTPCookies);
Note: See TracChangeset for help on using the changeset viewer.