Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 00c991b3e660e26f50328266eb11bfb095f2461f
      
https://github.com/WebKit/WebKit/commit/00c991b3e660e26f50328266eb11bfb095f2461f
  Author: Richard Robinson <[email protected]>
  Date:   2026-08-28 (Fri, 28 Aug 2026)

  Changed paths:
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/Shared/WTFCompletionHandler+Extras.swift
    A Source/WebKit/Shared/WTFExpected+Extras.swift
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Helpers/WTFCompletionHandler+Extras.swift
    A Tools/TestWebKitAPI/Helpers/WTFExpected+Extras.swift
    M Tools/TestWebKitAPI/TestWTFLibrary/SwiftCxxInteropTestbed.cpp
    M Tools/TestWebKitAPI/TestWTFLibrary/SwiftCxxInteropTestbed.h
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WTF/cocoa/SwiftCxxInteropTests.swift

  Log Message:
  -----------
  [Swift in WebKit] Introduce a bridging mechanism to create `std::expected`s 
in Swift
https://bugs.webkit.org/show_bug.cgi?id=322806
rdar://186056463

Reviewed by Adrian Taylor.

Add new CxxExpected and CxxConsumingExpected Swift protocols to be able to 
easily interoperate
with `std::expected` types.

Test: Tools/TestWebKitAPI/Tests/WTF/cocoa/SwiftCxxInteropTests.swift

* Source/WebKit/Shared/WTFExpected+Extras.swift: Added.
(CxxExpectedBase.has_value):
(CxxExpectedBase.__valueUnsafe):
(CxxExpectedBase.__errorUnsafe):
(CxxExpected.value):
(CxxConsumingExpected.__take(_:)):
(CxxConsumingExpected.consume() throws(CxxUnexpected<Failure>:)):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Helpers/WTFExpected+Extras.swift: Added.
(CxxExpectedBase.has_value):
(CxxExpectedBase.__valueUnsafe):
(CxxExpectedBase.__errorUnsafe):
(CxxExpected.value):
(CxxConsumingExpected.__take(_:)):
(CxxConsumingExpected.consume() throws(CxxUnexpected<Failure>:)):
* Tools/TestWebKitAPI/TestWTFLibrary/SwiftCxxInteropTestbed.cpp:
(SwiftCxxInteropTestbed::sharedProbeRefCount):
(SwiftCxxInteropTestbed::makeIntExpected):
(SwiftCxxInteropTestbed::makeIntUnexpected):
(SwiftCxxInteropTestbed::makeCopyCountingProbeExpected):
(SwiftCxxInteropTestbed::makeCopyCountingProbeUnexpected):
(SwiftCxxInteropTestbed::makeSharedProbeHolderExpected):
(SwiftCxxInteropTestbed::makeMoveOnlyProbeExpected):
(SwiftCxxInteropTestbed::makeMoveOnlyProbeUnexpected):
(SwiftCxxInteropTestbed::makeSelfReferentialProbeExpected):
* Tools/TestWebKitAPI/TestWTFLibrary/SwiftCxxInteropTestbed.h:
(SwiftCxxInteropTestbed::takeMoveOnlyProbeValue):
(SwiftCxxInteropTestbed::takeSelfReferentialProbeValue):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/cocoa/SwiftCxxInteropTests.swift:
(Cxx.__take(_:)):
(SwiftCxxInteropTests.expectedExposesItsValue):
(SwiftCxxInteropTests.unexpectedThrowsItsError):
(SwiftCxxInteropTests.readingTheValueLeavesTheExpectedAlone):
(SwiftCxxInteropTests.readingAnUnexpectedLeavesTheErrorInPlace):
(SwiftCxxInteropTests.readingACopyableValueCopiesItExactlyOnce):
(SwiftCxxInteropTests.theValueOutlivesTheExpectedItWasReadFrom):
(SwiftCxxInteropTests.readingAnUnexpectedNeverTouchesTheValue):
(SwiftCxxInteropTests.valueHoldingAManagedReferenceLeavesTheCallersCountAlone):
(SwiftCxxInteropTests.noncopyableValueCanBeConsumed):
(SwiftCxxInteropTests.consumingAnUnexpectedThrowsItsError):
(SwiftCxxInteropTests.consumedNoncopyableValueIsRelocatedWithItsMoveConstructor):

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



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

Reply via email to