Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 029c5391653db7b38b2246dd6eef5473ba42a49b
      
https://github.com/WebKit/WebKit/commit/029c5391653db7b38b2246dd6eef5473ba42a49b
  Author: David Kilzer <[email protected]>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
    M Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig
    M Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig
    R Source/WebKitLegacy/mac/TestingFunctions.h
    R Source/WebKitLegacy/mac/WebKit.Testing.exp
    M Source/WebKitLegacy/mac/WebView/WebPreferences.mm
    M Tools/TestWebKitAPI/Tests/WebKitLegacy/cocoa/WebPreferencesTest.mm

  Log Message:
  -----------
  [WebKitLegacy] Eliminate WK_BUILD_FOR_TESTING by refactoring to Objective-C 
class method SPI
<https://bugs.webkit.org/show_bug.cgi?id=313900>
<rdar://176091724>

Reviewed by Richard Robinson.

Objective-C methods are dispatched via `objc_msgSend` and do not need to
be exported to be callable from TestWebKitAPI.  Convert the static
`cacheModelForMainBundle()` function to
`+[WebPreferences _cacheModelForBundleIdentifier:]` in the
`(WebInternal)` category.  Both `+initialize` and the test call the
same method, eliminating the need for a test-only C function export.

Covered by existing tests in TestWebKitAPI.

* Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj:
- Remove TestingFunctions.h file references, headers build phase
  entry, WebKit.Testing.exp input, and WK_BUILD_FOR_TESTING
  conditional from "Generate Export Files" shell script.
* Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig:
- Remove `WK_BUILD_FOR_TESTING` setting.
* Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig:
- Remove `WK_CFLAGS_BUILD_FOR_TESTING_YES` definition and its
  use in `OTHER_CFLAGS` and `OTHER_TAPI_FLAGS`.  Remove
  `-extra-private-header TestingFunctions.h` from
  `OTHER_TAPI_FLAGS`.
* Source/WebKitLegacy/mac/TestingFunctions.h: Remove.
* Source/WebKitLegacy/mac/WebKit.Testing.exp: Remove.
* Source/WebKitLegacy/mac/WebView/WebPreferences.mm:
(cacheModelForBundleIdentifier): Remove.
(+[WebPreferences(WebInternal) _cacheModelForBundleIdentifier:]): Add.
- Convert from static C function to Objective-C class method in
  `(WebInternal)` category.
(+[WebPreferences initialize]):
- Call `+_cacheModelForBundleIdentifier:` instead of the former static C
  function.
* Tools/TestWebKitAPI/Tests/WebKitLegacy/cocoa/WebPreferencesTest.mm:
(TestWebKitAPI::TEST(WebKitLegacy, CacheModelForMainBundle)):
- Call `+[WebPreferences _cacheModelForBundleIdentifier:]` via a
  `(TestingInternal)` category declaration instead of the former
  exported C function.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to