-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION (275244@main): Crash in MediaCapability::MediaCapability w…
…hen 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
- Loading branch information
Showing
5 changed files
with
19 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters