Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 144facca643556ff386784f2ff15735984bb049b
      
https://github.com/WebKit/WebKit/commit/144facca643556ff386784f2ff15735984bb049b
  Author: Andy Estes <[email protected]>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M Source/WebKit/Platform/cocoa/MediaCapability.h
    M Source/WebKit/Platform/cocoa/MediaCapability.mm
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  REGRESSION (275244@main): Crash in MediaCapability::MediaCapability when 
loading 'about:blank'
https://bugs.webkit.org/show_bug.cgi?id=270318
rdar://123856265

Reviewed by Jer Noble.

In 275244@main MediaCapability was changed to track a SecurityOrigin rather 
than a URL. Since
'about:blank' is considered an opaque origin, a nil NSURL is returned by 
SecurityOrigin::toURL()
(after implicit conversion). A crash occurs when MediaCapability attempts to 
instantiate a
BEMediaEnvironment with the nil URL since -initWithWebPageURL: requires a 
nonnull NSURL.

Fixed this by reverting MediaCapability to storing the webpage URL as a 
WebCore::URL, and instead
using URL::protocolHostAndPort() and protocolHostAndPortAreEqual() to ensure 
that the
MediaEnvironment is not reset during same-origin navigations.

* Source/WebKit/Platform/cocoa/MediaCapability.h:
* Source/WebKit/Platform/cocoa/MediaCapability.mm:
(WebKit::createMediaEnvironment):
(WebKit::MediaCapability::MediaCapability):
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setMediaCapability):
(WebKit::WebPageProxy::deactivateMediaCapability):
(WebKit::WebPageProxy::resetMediaCapability):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to