[webkit-changes] [WebKit/WebKit] 1c8031: Combine the WebExtension constructors to reduce du...
Timothy Hatcher
noreply at github.com
Fri Oct 4 17:09:04 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1c8031fb856c3700466ff6a5543e201831f62e80
https://github.com/WebKit/WebKit/commit/1c8031fb856c3700466ff6a5543e201831f62e80
Author: Timothy Hatcher <timothy at apple.com>
Date: 2024-10-04 (Fri, 04 Oct 2024)
Changed paths:
M Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionPrivate.h
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm
M Source/WebKit/UIProcess/Extensions/WebExtension.h
Log Message:
-----------
Combine the WebExtension constructors to reduce duplication.
https://webkit.org/b/280909
rdar://137293002
Reviewed by Brian Weinstein.
Combine the bundle and resource URL WebExtension constructors, since there is a lot of overlap and clients
might need to provide different values. Also decouple resource validation from having a bundle set, we can
only do validation if the bundle and resource URL are equal.
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.mm:
(+[WKWebExtension extensionWithAppExtensionBundle:completionHandler:]): Use the combined constructor.
(+[WKWebExtension extensionWithResourceBaseURL:completionHandler:]): Ditto.
(-[WKWebExtension _initWithAppExtensionBundle:error:]): Ditto.
(-[WKWebExtension _initWithResourceBaseURL:error:]): Ditto.
(-[WKWebExtension _initWithAppExtensionBundle:resourceBaseURL:error:]): Added.
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionPrivate.h:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::WebExtension): Combined the bundle and resource URL WebExtension constructors.
(WebKit::WebExtension::validateResourceData): Return early if m_shouldValidateResourceData is false.
* Source/WebKit/UIProcess/Extensions/WebExtension.h:
Canonical link: https://commits.webkit.org/284716@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