Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 546057ba7bf7ffdbdec0a0221fff754b1fd31915
      
https://github.com/WebKit/WebKit/commit/546057ba7bf7ffdbdec0a0221fff754b1fd31915
  Author: David Kilzer <[email protected]>
  Date:   2026-07-27 (Mon, 27 Jul 2026)

  Changed paths:
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Shared/API/APIArray.h
    M Source/WebKit/Shared/API/APIObject.h
    M Source/WebKit/Shared/SessionState.h
    M Source/WebKit/Shared/WebBackForwardListFrameItem.h
    M Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
    M Source/WebKit/UIProcess/BrowsingContextGroup.h
    M Source/WebKit/UIProcess/SuspendedPageProxy.h
    M Source/WebKit/UIProcess/WebBackForwardCacheEntry.h
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.h

  Log Message:
  -----------
  [WebKit] Swift build fails with "cannot infer ownership of foreign reference 
value" errors
<https://bugs.webkit.org/show_bug.cgi?id=320315>
<rdar://183251187>

Unreviewed build fix.

Several WebKit implementation types are foreign reference types
(`SWIFT_SHARED_REFERENCE`), but do not declare how Swift should treat
the ownership of a returned value.  A stricter Swift toolchain rejects
this: any function returning one of these types -- such as
`WTF::Ref<T>::ptr()`, `WebPageProxy::legacyMainFrameProcess()`, or
`WKWebView._impl()` -- fails to import because the compiler cannot infer
whether the result is passed retained (+1) or unretained (+0).

Mark each affected WebKit foreign reference type
`SWIFT_RETURNED_AS_UNRETAINED_BY_DEFAULT`.  Like all normal WebKit
ref-counted types, they are returned +0, so a caller does not take
ownership of the returned reference.  This mirrors the annotation
applied to the WebGPU types in bug 320306 (317935@main) and continues
the work in bug 308456 (309469@main) and bug 310101, which these WebKit
types were missing.

No new tests since this change is not directly testable.

* Source/WebKit/Platform/IPC/Connection.h:
(IPC::Connection):
* Source/WebKit/Shared/API/APIArray.h:
(API::Array):
* Source/WebKit/Shared/API/APIObject.h:
(API::Object):
* Source/WebKit/Shared/SessionState.h:
(WebKit::FrameState):
* Source/WebKit/Shared/WebBackForwardListFrameItem.h:
(WebKit::WebBackForwardListFrameItem):
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy):
* Source/WebKit/UIProcess/BrowsingContextGroup.h:
(WebKit::BrowsingContextGroup):
* Source/WebKit/UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy):
* Source/WebKit/UIProcess/WebBackForwardCacheEntry.h:
(WebKit::WebBackForwardCacheEntry):
* Source/WebKit/UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
(WebKit::WebViewImpl):

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



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

Reply via email to