[webkit-changes] [WebKit/WebKit] c2ec9c: Network connection integrity policies are missing ...

Wenson Hsieh noreply at github.com
Mon May 22 15:16:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c2ec9c11767361af98d651ab55ba2028b3d1ff4b
      https://github.com/WebKit/WebKit/commit/c2ec9c11767361af98d651ab55ba2028b3d1ff4b
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
    M Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
    M Tools/TestWebKitAPI/cocoa/HTTPServer.h
    M Tools/TestWebKitAPI/cocoa/HTTPServer.mm

  Log Message:
  -----------
  Network connection integrity policies are missing when connecting via <link rel=preconnect>
https://bugs.webkit.org/show_bug.cgi?id=257096
rdar://107356544

Reviewed by Tim Horton.

Add logic to set network connection integrity policy flags when sending a network request triggered
by a link element with `rel=preconnect`. See below for more details.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _networkProcessIdentifier]):

Add a testing hook that returns the network process PID, for use in a new (internal) API test.

* Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::policySourceDocumentLoaderForFrame):

Pull existing logic for grabbing a suitable `DocumentLoader` for a given frame out of
`addParametersShared` and into a separate helper function, so that we can use it in multiple places.

(WebKit::addParametersShared):
(WebKit::WebLoaderStrategy::preconnectTo):

Use the new helper function above to populate network connection integrity flags on the outbound
resource load when handling preconnect.

* Tools/TestWebKitAPI/cocoa/HTTPServer.h:
* Tools/TestWebKitAPI/cocoa/HTTPServer.mm:
(TestWebKitAPI::HTTPServer::totalConnections const):

Add a helper method on the mock HTTP server to return the total connection count.

Canonical link: https://commits.webkit.org/264382@main




More information about the webkit-changes mailing list