Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9f9a948893606ded87b9b9d978045f72edfdb335
      
https://github.com/WebKit/WebKit/commit/9f9a948893606ded87b9b9d978045f72edfdb335
  Author: Richard Robinson <[email protected]>
  Date:   2026-02-23 (Mon, 23 Feb 2026)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPreferences.h
    M Source/WebKit/UIProcess/mac/WKTextSelectionController.swift

  Log Message:
  -----------
  [Swift in WebKit] Apply SWIFT_RETURNED_AS_UNRETAINED_BY_DEFAULT to address 
owner inference of FRT  warning
https://bugs.webkit.org/show_bug.cgi?id=308456
rdar://170962301

Reviewed by Aditya Keerthi.

Currently, Swift clients of some C++ foreign reference types that are shared 
references result in
a warning being emitted:

```
Cannot infer ownership of foreign reference value returned by 'get()'
```

This is because Swift is not able to detect itself if the value returned by a 
function is retained
or unretained. Swift-Cxx interop addresses this by providing the 
`SWIFT_RETURNED_AS_UNRETAINED_BY_DEFAULT`
annotation, which is applied to the relevant `SWIFT_SHARED_REFERENCE` types to 
indicate that any
functions that return this type are unretained.

Fix by applying this annotation where needed.

* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPreferences.h:
* Source/WebKit/UIProcess/mac/WKTextSelectionController.swift:
(WKTextSelectionController.isTextSelected(at:)):

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



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

Reply via email to