[webkit-changes] [WebKit/WebKit] 18cc91: Refine the construction of WKWebExtension in Swift.

Timothy Hatcher noreply at github.com
Fri Feb 21 18:05:16 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 18cc91853d356a9f1af0de8568930cb806c6e05e
      https://github.com/WebKit/WebKit/commit/18cc91853d356a9f1af0de8568930cb806c6e05e
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2025-02-21 (Fri, 21 Feb 2025)

  Changed paths:
    M Source/WebKit/Configurations/Base.xcconfig
    M Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionPrivate.h
    M Source/WebKit/UIProcess/API/Cocoa/WebKitSwiftOverlay.swift

  Log Message:
  -----------
  Refine the construction of WKWebExtension in Swift.
https://webkit.org/b/288129
rdar://problem/145235810

Reviewed by Brian Weinstein and Richard Robinson.

Introduce a Swift overlay for WKWebExtension to define two async init() methods
that are more idiomatic in Swift.

Swift really does not like _init methods, so unprefix the existing private init
methods to keep the compiler happy when building the overlay. Retain prefixed
versions for ObjC compatability with existing clients.

* Source/WebKit/Configurations/Base.xcconfig: Define ENABLE_WEB_EXTENSION_API.
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.mm:
(-[WKWebExtension _initWithAppExtensionBundle:error:]):
(-[WKWebExtension _initWithResourceBaseURL:error:]):
(-[WKWebExtension _initWithAppExtensionBundle:resourceBaseURL:error:]):
(-[WKWebExtension _initWithManifestDictionary:]):
(-[WKWebExtension _initWithManifestDictionary:resources:]):
(-[WKWebExtension _initWithResources:]):
(-[WKWebExtension initWithAppExtensionBundle:error:]):
(-[WKWebExtension initWithResourceBaseURL:error:]):
(-[WKWebExtension initWithAppExtensionBundle:resourceBaseURL:error:]):
(-[WKWebExtension initWithManifestDictionary:]):
(-[WKWebExtension initWithManifestDictionary:resources:]):
(-[WKWebExtension initWithResources:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionPrivate.h:
* Source/WebKit/UIProcess/API/Cocoa/WebKitSwiftOverlay.swift:

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



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


More information about the webkit-changes mailing list