Changeset 267088 in webkit


Ignore:
Timestamp:
Sep 15, 2020 9:28:33 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Move WebSocket TLS bypass SPI from WebProcessPool to WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=216509

Patch by Alex Christensen <achristensen@webkit.org> on 2020-09-15
Reviewed by Youenn Fablet.

Source/WebKit:

After https://bugs.webkit.org/show_bug.cgi?id=216041 we will be unable to determine which WebsiteDataStore's
NetworkProcess to add the TLS bypass to, so we need to move the SPI to the WebsiteDataStore object. This breaks
off a piece of that large change into a small, easy-to-review change.

  • UIProcess/API/C/WKContext.cpp:

(WKContextSetAllowsAnySSLCertificateForWebSocketTesting): Deleted.

  • UIProcess/API/C/WKContextPrivate.h:
  • UIProcess/API/C/WKWebsiteDataStoreRef.cpp:

(WKWebsiteDataStoreSetAllowsAnySSLCertificateForWebSocketTesting):

  • UIProcess/API/C/WKWebsiteDataStoreRef.h:
  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _allowAnyTLSCertificateForWebSocketTesting]): Deleted.

  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket): Deleted.

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::setAllowsAnySSLCertificateForWebSocket):

  • UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::setAllowsAnySSLCertificate):

  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::setAllowsAnySSLCertificate):

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r267085 r267088  
     12020-09-15  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move WebSocket TLS bypass SPI from WebProcessPool to WebsiteDataStore
     4        https://bugs.webkit.org/show_bug.cgi?id=216509
     5
     6        Reviewed by Youenn Fablet.
     7
     8        After https://bugs.webkit.org/show_bug.cgi?id=216041 we will be unable to determine which WebsiteDataStore's
     9        NetworkProcess to add the TLS bypass to, so we need to move the SPI to the WebsiteDataStore object.  This breaks
     10        off a piece of that large change into a small, easy-to-review change.
     11
     12        * UIProcess/API/C/WKContext.cpp:
     13        (WKContextSetAllowsAnySSLCertificateForWebSocketTesting): Deleted.
     14        * UIProcess/API/C/WKContextPrivate.h:
     15        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
     16        (WKWebsiteDataStoreSetAllowsAnySSLCertificateForWebSocketTesting):
     17        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
     18        * UIProcess/API/Cocoa/WKProcessPool.mm:
     19        (-[WKProcessPool _allowAnyTLSCertificateForWebSocketTesting]): Deleted.
     20        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
     21        * UIProcess/WebProcessPool.cpp:
     22        (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket): Deleted.
     23        * UIProcess/WebProcessPool.h:
     24        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     25        (WebKit::WebsiteDataStore::setAllowsAnySSLCertificateForWebSocket):
     26        * UIProcess/WebsiteData/WebsiteDataStore.h:
     27
    1282020-09-15  Aditya Keerthi  <akeerthi@apple.com>
    229
  • trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp

    r266951 r267088  
    544544}
    545545
    546 void WKContextSetAllowsAnySSLCertificateForWebSocketTesting(WKContextRef context, bool allows)
    547 {
    548     WebKit::toImpl(context)->setAllowsAnySSLCertificateForWebSocket(allows);
    549 }
    550 
    551546void WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting(WKContextRef context, bool allows)
    552547{
  • trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h

    r266951 r267088  
    8787WK_EXPORT void WKContextTerminateServiceWorkers(WKContextRef);
    8888
    89 WK_EXPORT void WKContextSetAllowsAnySSLCertificateForWebSocketTesting(WKContextRef, bool);
    9089WK_EXPORT void WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting(WKContextRef, bool);
    9190
  • trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp

    r266829 r267088  
    133133}
    134134
     135void WKWebsiteDataStoreSetAllowsAnySSLCertificateForWebSocketTesting(WKWebsiteDataStoreRef dataStore, bool allows)
     136{
     137    WebKit::toImpl(dataStore)->setAllowsAnySSLCertificateForWebSocket(allows);
     138}
     139
    135140void WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler(WKWebsiteDataStoreRef dataStoreRef, bool enable, void* context, WKWebsiteDataStoreStatisticsDebugModeFunction completionHandler)
    136141{
  • trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h

    r265389 r267088  
    4343
    4444WK_EXPORT WKHTTPCookieStoreRef WKWebsiteDataStoreGetHTTPCookieStore(WKWebsiteDataStoreRef dataStoreRef);
     45
     46WK_EXPORT void WKWebsiteDataStoreSetAllowsAnySSLCertificateForWebSocketTesting(WKWebsiteDataStoreRef dataStore, bool allows);
    4547
    4648WK_EXPORT bool WKWebsiteDataStoreGetResourceLoadStatisticsEnabled(WKWebsiteDataStoreRef dataStoreRef);
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm

    r267042 r267088  
    626626}
    627627
    628 - (void)_allowAnyTLSCertificateForWebSocketTesting
    629 {
    630     _processPool->setAllowsAnySSLCertificateForWebSocket(true);
    631 }
    632 
    633628- (void)_seedResourceLoadStatisticsForTestingWithFirstParty:(NSURL *)firstPartyURL thirdParty:(NSURL *)thirdPartyURL shouldScheduleNotification:(BOOL)shouldScheduleNotification completionHandler:(void(^)(void))completionHandler
    634629{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h

    r267042 r267088  
    127127- (BOOL)_networkProcessHasEntitlementForTesting:(NSString *)entitlement WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
    128128- (void)_clearPermanentCredentialsForProtectionSpace:(NSURLProtectionSpace *)protectionSpace WK_API_AVAILABLE(macos(10.15), ios(13.0));
    129 - (void)_allowAnyTLSCertificateForWebSocketTesting WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    130129
    131130@property (nonatomic, getter=_isCookieStoragePartitioningEnabled, setter=_setCookieStoragePartitioningEnabled:) BOOL _cookieStoragePartitioningEnabled WK_API_DEPRECATED("Partitioned cookies are no longer supported", macos(10.12.3, 10.14.4), ios(10.3, 12.2));
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r267042 r267088  
    17761776}
    17771777
    1778 void WebProcessPool::setAllowsAnySSLCertificateForWebSocket(bool allows)
    1779 {
    1780     sendSyncToNetworkingProcess(Messages::NetworkProcess::SetAllowsAnySSLCertificateForWebSocket(allows), Messages::NetworkProcess::SetAllowsAnySSLCertificateForWebSocket::Reply());
    1781 }
    1782 
    17831778void WebProcessPool::clearCachedCredentials()
    17841779{
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r267042 r267088  
    319319    static Statistics& statistics();   
    320320
    321     void setAllowsAnySSLCertificateForWebSocket(bool);
    322 
    323321    void clearCachedCredentials();
    324322    void terminateNetworkProcess();
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r267042 r267088  
    22622262}
    22632263
     2264void WebsiteDataStore::setAllowsAnySSLCertificateForWebSocket(bool allows)
     2265{
     2266    for (auto processPool : WebProcessPool::allProcessPools()) {
     2267        if (auto* networkProcess = processPool->networkProcess())
     2268            networkProcess->sendSync(Messages::NetworkProcess::SetAllowsAnySSLCertificateForWebSocket(allows), Messages::NetworkProcess::SetAllowsAnySSLCertificateForWebSocket::Reply(), 0);
     2269    }
     2270}
     2271
    22642272void WebsiteDataStore::dispatchOnQueue(Function<void()>&& function)
    22652273{
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h

    r267042 r267088  
    241241    void flushCookies(CompletionHandler<void()>&&);
    242242
     243    void setAllowsAnySSLCertificateForWebSocket(bool);
     244
    243245    void dispatchOnQueue(Function<void()>&&);
    244246
  • trunk/Tools/ChangeLog

    r267083 r267088  
     12020-09-15  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move WebSocket TLS bypass SPI from WebProcessPool to WebsiteDataStore
     4        https://bugs.webkit.org/show_bug.cgi?id=216509
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * WebKitTestRunner/TestController.cpp:
     9        (WTR::TestController::setAllowsAnySSLCertificate):
     10        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
     11        (WTR::TestController::setAllowsAnySSLCertificate):
     12
    1132020-09-15  Rob Buis  <rbuis@igalia.com>
    214
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r267083 r267088  
    13291329{
    13301330    m_allowsAnySSLCertificate = allows;
    1331     WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows);
     1331    WKWebsiteDataStoreSetAllowsAnySSLCertificateForWebSocketTesting(websiteDataStore(), allows);
    13321332}
    13331333#endif
  • trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

    r266342 r267088  
    452452{
    453453    m_allowsAnySSLCertificate = allows;
    454     WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows);
     454    WKWebsiteDataStoreSetAllowsAnySSLCertificateForWebSocketTesting(websiteDataStore(), allows);
    455455    [globalWebsiteDataStoreDelegateClient setAllowAnySSLCertificate: allows];
    456456}
Note: See TracChangeset for help on using the changeset viewer.