[webkit-changes] [WebKit/WebKit] 19072c: Crash in WebKit::WebExtensionContext::permissionSt...
Timothy Hatcher
noreply at github.com
Fri May 31 14:03:45 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 19072c54e8faeac1d154463c5e9b10e7aa5749d1
https://github.com/WebKit/WebKit/commit/19072c54e8faeac1d154463c5e9b10e7aa5749d1
Author: Timothy Hatcher <timothy at apple.com>
Date: 2024-05-31 (Fri, 31 May 2024)
Changed paths:
M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIScriptingCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITabsCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionDynamicScriptsCocoa.mm
M Source/WebKit/UIProcess/Extensions/WebExtensionDynamicScripts.h
Log Message:
-----------
Crash in WebKit::WebExtensionContext::permissionState.
https://webkit.org/b/274975
rdar://128446076
Reviewed by Brian Weinstein.
This crash could happen if the tab was dealloced while a script was being injected into it.
We were not retaining the tab while waiting for the frames for the web view.
* Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIScriptingCocoa.mm:
(WebKit::WebExtensionContext::scriptingExecuteScript): Pass a reference to tab.
* Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITabsCocoa.mm:
(WebKit::WebExtensionContext::tabsExecuteScript): Pass a reference to tab.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionDynamicScriptsCocoa.mm:
(WebKit::WebExtensionDynamicScripts::executeScript): Make tab a reference since it is required
and use a Ref for the lambda capture.
* Source/WebKit/UIProcess/Extensions/WebExtensionDynamicScripts.h:
Canonical link: https://commits.webkit.org/279594@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