[webkit-changes] [WebKit/WebKit] b2e851: Fill in sidebarAction / sidePanel WebProcess <=> U...
Ariel Young
noreply at github.com
Thu Aug 8 18:15:39 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b2e851ada7eee7b13ffde9f5d2d6189461732869
https://github.com/WebKit/WebKit/commit/b2e851ada7eee7b13ffde9f5d2d6189461732869
Author: Ari Young <ari_young at apple.com>
Date: 2024-08-08 (Thu, 08 Aug 2024)
Changed paths:
M Source/WebKit/Shared/Extensions/WebExtensionSidebarParameters.h
M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPISidebarCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm
M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
M Source/WebKit/UIProcess/Extensions/WebExtensionController.h
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPISidePanelCocoa.mm
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPISidebarActionCocoa.mm
M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPISidebarAction.h
Log Message:
-----------
Fill in sidebarAction / sidePanel WebProcess <=> UIProcess messaging stubs.
https://webkit.org/b/277688
rdar://133073249
Reviewed by Timothy Hatcher.
This PR fills in most of the message senders and receivers which pertain
to sidePanel / sidebarAction. Additionally, it adds several helper
utilities to aid in parameter parsing for sidePanel / sidebarAction.
* Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPISidebarCocoa.mm:
(WebKit::toExpected): Utility function to convert an optional<T>
to an Expected<T, WebExtensionError>
(WebKit::getSidebarWithIdentifiers): Utility function to validate window
/ tab identifiers then return the sidebar object associated with said
identifiers
(WebKit::getOrCreateSidebarWithIdentifiers): Utility function to
validate window / tab identifiers and create a sidebar object
associated with said identifiers if necessary
(WebKit::WebExtensionContext::openSidebarForTab): Utility function to
open a sidebar object
(WebKit::WebExtensionContext::closeSidebarForTab): Utility function to
close a sidebar object
(WebKit::WebExtensionContext::sidebarOpen): Fill in message receiver for
sidebarOpen
(WebKit::WebExtensionContext::sidebarClose): Fill in message receiver for
sidebarClose
(WebKit::WebExtensionContext::sidebarIsOpen): Fill in message receiver for
sidebarIsOpen
(WebKit::WebExtensionContext::sidebarToggle): Fill in message receiver for
sidebarToggle
(WebKit::WebExtensionContext::sidebarSetIcon): Update stub with FIXME
(WebKit::WebExtensionContext::sidebarGetTitle): Fill in message receiver for
sidebarGetTitle
(WebKit::WebExtensionContext::sidebarSetTitle): Fill in message receiver for
sidebarSetTitle
(WebKit::WebExtensionContext::sidebarGetOptions): Fill in message receiver for
sidebarGetOptions
(WebKit::WebExtensionContext::sidebarSetOptions): Fill in message receiver for
sidebarSetOptions
(WebKit::WebExtensionContext::isSidebarMessageAllowed): Gate sidebar
messages behind sidebar feature flag
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPISidePanelCocoa.mm:
(WebKit::parseTabIdentifier): Utility function to parse and validate the
tab identifier received through a sidePanel details object
(WebKit::parseWindowIdentifier): Utility function to parse and validate
the window identifier received through a sidePanel details object
(WebKit::serializeSidebarParameters): Utility function to serialize a
WebExtensionSidebarParameters struct to an NSDictionary
(WebKit::deserializeSidebarParameters): Utility function to deserialize
a WebExtensionSidebarParameters struct from an NSDictionary
(WebKit::WebExtensionAPISidePanel::getOptions): Fill in message sender
for getOptions
(WebKit::WebExtensionAPISidePanel::setOptions): Fill in message sender
for setOptions
(WebKit::WebExtensionAPISidePanel::getPanelBehavior): Update stub with
FIXME
(WebKit::WebExtensionAPISidePanel::setPanelBehavior): Update stub with
FIXME
(WebKit::WebExtensionAPISidePanel::open): Fill in message sender for
open
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPISidebarActionCocoa.mm:
(WebKit::parseSidebarActionDetails): Utility function to parse the
`details` object passed to many sidebarAction method calls
(WebKit::parseDetailsStringFromKey): Utility function to validate the
string value of some key in a dictionary, optionally allowing it to be
NSNull
(WebKit::getIdentifiers): Utility function to retrieve whatever window
or tab identifiers are set in a variant, returning them as
std::optionals
(WebKit::WebExtensionAPISidebarAction::open): Fill in message sender for
open
(WebKit::WebExtensionAPISidebarAction::close): Fill in message sender
for close
(WebKit::WebExtensionAPISidebarAction::toggle): Fill in message sender
for toggle
(WebKit::WebExtensionAPISidebarAction::isOpen): Fill in message sender
for isOpen
(WebKit::WebExtensionAPISidebarAction::getPanel): Fill in message sender
for getPanel
(WebKit::WebExtensionAPISidebarAction::setPanel): Fill in message sender
for setPanel
(WebKit::WebExtensionAPISidebarAction::getTitle): Fill in message sender
for getTitle
(WebKit::WebExtensionAPISidebarAction::setTitle): Fill in message sender
for setTitle
(WebKit::WebExtensionAPISidebarAction::setIcon): Fill in message sender
for setIcon
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPISidebarAction.h:
(WebKit::toOptional): Utility function to attempt to access
one particular field from a variant and return it in an std::optional,
returning std::nullopt if the variant does not contain the requested
field
(WebKit::indicatesError): Utility function to determine whether a
variant indicates that an error occurred, and return the error if it
does
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm:
(WebKit::WebExtensionController::isFeatureEnabled const): Helper
function to check if a particular feature is enabled using its name.
Canonical link: https://commits.webkit.org/282026@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