Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: b69952d3e355d35df99864dc9b7dbd33dd323f60 https://github.com/WebKit/WebKit/commit/b69952d3e355d35df99864dc9b7dbd33dd323f60 Author: Kiara Rose <kiara_r...@apple.com> Date: 2024-02-16 (Fri, 16 Feb 2024)
Changed paths: M Source/WebKit/DerivedSources-input.xcfilelist M Source/WebKit/DerivedSources-output.xcfilelist M Source/WebKit/DerivedSources.make M Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h M Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.serialization.in M Source/WebKit/Shared/Extensions/WebExtensionControllerParameters.h M Source/WebKit/Shared/Extensions/WebExtensionControllerParameters.serialization.in M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionController.mm M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionControllerDelegatePrivate.h M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionControllerPrivate.h M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIPortCocoa.mm M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIRuntimeCocoa.mm R Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITestCocoa.mm A Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionControllerAPITestCocoa.mm M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionMatchPatternCocoa.mm M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h M Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in M Source/WebKit/UIProcess/Extensions/WebExtensionController.cpp M Source/WebKit/UIProcess/Extensions/WebExtensionController.h M Source/WebKit/UIProcess/Extensions/WebExtensionController.messages.in M Source/WebKit/UIProcess/Extensions/WebExtensionMatchPattern.h M Source/WebKit/WebKit.xcodeproj/project.pbxproj M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIActionCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIAlarmsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPICommandsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPICookiesCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIDevToolsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIDevToolsExtensionPanelCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIDevToolsNetworkCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIDevToolsPanelsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIMenusCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINamespaceCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINotificationsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPermissionsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPortCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIStorageAreaCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIStorageCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITabsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITestCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebNavigationCocoa.mm A Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebPageNamespaceCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebRequestCocoa.mm M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWindowsCocoa.mm M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIEvent.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINamespace.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIObject.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIPort.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIRuntime.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIStorageArea.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWebNavigationEvent.h A Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWebPageNamespace.h A Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWebPageRuntime.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWebRequestEvent.h M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWindowsEvent.h M Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionContextProxyCocoa.mm M Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionControllerProxyCocoa.mm M Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIRuntime.idl A Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIWebPageNamespace.idl A Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIWebPageRuntime.idl M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.cpp M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h M Source/WebKit/WebProcess/Extensions/WebExtensionControllerProxy.cpp M Source/WebKit/WebProcess/Extensions/WebExtensionControllerProxy.h M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIRuntime.mm M Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm Log Message: ----------- Add support for externally_connectable https://bugs.webkit.org/show_bug.cgi?id=268856 rdar://122422972 Authors: Kiara Rose, Timothy Hatcher Reviewed by Timothy Hatcher. This patch creates seperate runtime and namespace objects to use for web pages that wish to send and receive messages from extensions. Also change how WebExtensionAPIObject tracks the world, and simplify child object creation by passing the parent object. This touched all the API files, those changed files are elided. Also change WebExtensionController to have a concept of testMode, so WebPage APIs can use the browser.test API too, without an extensionContext. This required changing the UI process WebExtensionContextAPITestCocoa to be WebExtensionControllerAPITestCocoa and changing the delegates to no longer get a context. This wasn't used, so it is fine to remove. * Source/WebKit/DerivedSources-input.xcfilelist: * Source/WebKit/DerivedSources-output.xcfilelist: * Source/WebKit/DerivedSources.make: * Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h: (WebKit::toDebugString): * Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.serialization.in: Add a new WebExtensionContentWorldType::WebPage to distinguish messages being sent to and from web pages. * Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIPortCocoa.mm: (WebKit::WebExtensionContext::portPostMessage): (WebKit::WebExtensionContext::firePortDisconnectEventIfNeeded): Notify ports created from webPageRuntime.connect that the port was disconnected. * Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIRuntimeCocoa.mm: (WebKit::WebExtensionContext::runtimeWebPageSendMessage): (WebKit::WebExtensionContext::runtimeWebPageConnect): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm: (WebKit::WebExtensionController::extensionContext const): Mehtod to return extension context with a given unique identifier. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionMatchPatternCocoa.mm: (WebKit::WebExtensionMatchPattern::matchesPatternSetContainsMatchForURL): Return true if one of the match pattern in the MatchPatternSet matches the given URL. * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in: * Source/WebKit/UIProcess/Extensions/WebExtensionController.h: * Source/WebKit/UIProcess/Extensions/WebExtensionMatchPattern.h: * Source/WebKit/WebKit.xcodeproj/project.pbxproj: * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm: (WebKit::WebExtensionAPIWebPageRuntime::sendMessage): (WebKit::WebExtensionAPIWebPageRuntime::connect): (WebKit::WebExtensionContextProxy::internalDispatchRuntimeMessageEvent): Use the contentWorldType from the sendersParameters to determine which onConnect listeners we should call. (WebKit::WebExtensionContextProxy::dispatchRuntimeMessageEvent): Event listeners cannot be added for the webPageRuntime namespace object. (WebKit::WebExtensionContextProxy::internalDispatchRuntimeConnectEvent): Use the contentWorldType from the sendersParameters to determine which onConnect listeners we should call. (WebKit::WebExtensionContextProxy::dispatchRuntimeConnectEvent): Event listeners cannot be added for the webPageRuntime namespace object. * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebPageNamespaceCocoa.mm: Copied from Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h. (WebKit::WebExtensionAPIWebPageNamespace::runtime): * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebPageRuntimeCocoa.mm: Added. * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIObject.h: (WebKit::WebExtensionAPIObject::WebExtensionAPIObject): * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIRuntime.h: * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWebPageNamespace.h: Copied from Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h. * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWebPageRuntime.h: Copied from Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h. * Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionContextProxyCocoa.mm: (WebKit::WebExtensionContextProxy::toDOMWorld): * Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionControllerProxyCocoa.mm: (WebKit::WebExtensionControllerProxy::globalObjectIsAvailableForFrame): (WebKit::WebExtensionControllerProxy::serviceWorkerGlobalObjectIsAvailableForFrame): (WebKit::WebExtensionControllerProxy::addBindingsToWebPageFrameIfNecessary): Inject custom browser namespace object for web pages. * Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIWebPageNamespace.idl: Copied from Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h. * Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIWebPageRuntime.idl: Copied from Source/WebKit/Shared/Extensions/WebExtensionContentWorldType.h. * Source/WebKit/WebProcess/Extensions/WebExtensionControllerProxy.h: Canonical link: https://commits.webkit.org/274898@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes