Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 450581e0a014d01461fd13fbfbe6463eaaf7cb79
      
https://github.com/WebKit/WebKit/commit/450581e0a014d01461fd13fbfbe6463eaaf7cb79
  Author: Claudio Saavedra <[email protected]>
  Date:   2026-09-18 (Fri, 18 Sep 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp

  Log Message:
  -----------
  [GStreamer] Do not rebuild the allowed protocol set on every 
isProtocolAllowed() call
https://bugs.webkit.org/show_bug.cgi?id=324541

Reviewed by Philippe Normand.

isProtocolAllowed() runs on every media load and built its allow-list from
scratch each time: a HashSet of seven Strings, a copy of the URL scheme,
and its lowercase conversion. Keep the built-in set in a NeverDestroyed and
look the scheme up as a StringView through StringViewHashTranslator, so the
common case allocates nothing.

The scheme no longer goes through convertToLowercaseWithoutLocale(). URLParser
lowercases it with toASCIILower() as it parses, restricts it to ASCII scheme
characters, and URL::protocol() returns an empty view for an invalid URL, so the
view is already in canonical form. The WEBKIT_GST_ALLOWED_URI_PROTOCOLS entries
still get the same trim and lowercase treatment, but are compared against the
scheme directly instead of being copied into the set; the variable is re-read
on every call, as before, which the API tests rely on.

* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::isProtocolAllowedByEnvironment):
(WebCore::isProtocolAllowed):

Canonical link: https://commits.webkit.org/321382@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to