Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 8c332e12731bb524cc6691613c29f703b65182ca https://github.com/WebKit/WebKit/commit/8c332e12731bb524cc6691613c29f703b65182ca Author: Timothy Hatcher <timo...@apple.com> Date: 2024-07-18 (Thu, 18 Jul 2024)
Changed paths: M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionTab.h M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionTabCocoa.mm M Source/WebKit/UIProcess/Extensions/WebExtensionTab.h M Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm Log Message: ----------- Add indexInWindowForWebExtensionContext: to _WKWebExtensionTab. https://webkit.org/b/276793 rdar://problem/132029062 Reviewed by Brady Eidson. Getting the tabs and converting them all to `WebExtensionTab` can be expensive when the user has hundreds of tabs open in a window. Often the browser can quickly answer what the index in the window is more efficiently. This adds a new optional protocol method to `_WKWebExtensionTab` for getting the index in the window. If it is not implement, fallback to asking the window for all tabs and finding the index from that tabs Vector like before. * Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionTab.h: * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionTabCocoa.mm: (WebKit::WebExtensionTab::WebExtensionTab): Cache responds to selector for new method. (WebKit::WebExtensionTab::index const): Use new index method, fallback to tabs. * Source/WebKit/UIProcess/Extensions/WebExtensionTab.h: * Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm: (-[TestWebExtensionTab indexInWindowForWebExtensionContext:]): Added. Canonical link: https://commits.webkit.org/281115@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