[webkit-changes] [WebKit/WebKit] 35745d: Remove unnecessary copy when checking if a page is...

bnham noreply at github.com
Thu Feb 29 22:16:52 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 35745daf8d3505bc1f273e3fa5a3e4229dffa70d
      https://github.com/WebKit/WebKit/commit/35745daf8d3505bc1f273e3fa5a3e4229dffa70d
  Author: Ben Nham <nham at apple.com>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Source/WebKit/UIProcess/Cocoa/NavigationState.mm

  Log Message:
  -----------
  Remove unnecessary copy when checking if a page is running an extension
https://bugs.webkit.org/show_bug.cgi?id=270321
rdar://problem/123858678

Reviewed by Timothy Hatcher.

For every navigation decision, we check whether the associated page is running a web extension by
calling `page.cocoaView().get().configuration._requiredWebExtensionBaseURL`. Since configuration is
marked as a `copy` property, this causes an allocation and copy every time it's called. We should
avoid the copy since it's not useful.

I have another use case for `_requiredWebExtensionBaseURL` outside of WebKit, so I put it in
WKWebViewPrivate.h rather than WKWebViewInternal.h.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requiredWebExtensionBaseURL]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/Cocoa/NavigationState.mm:
(WebKit::isUnsupportedWebExtensionNavigation):

Canonical link: https://commits.webkit.org/275538@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