[webkit-changes] [WebKit/WebKit] abc0f7: Crash in WebKit::WebExtensionContextProxy::toDOMWr...

Timothy Hatcher noreply at github.com
Fri Mar 15 12:56:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: abc0f7739674fadcfb67ca264c4a9e6b31e18f01
      https://github.com/WebKit/WebKit/commit/abc0f7739674fadcfb67ca264c4a9e6b31e18f01
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-03-15 (Fri, 15 Mar 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIStorageCocoa.mm
    M Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionContextProxyCocoa.mm
    M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h

  Log Message:
  -----------
  Crash in WebKit::WebExtensionContextProxy::toDOMWrapperWorld.
https://webkit.org/b/271064
rdar://124319215

Reviewed by Brian Weinstein.

Add a hasDOMWrapperWorld() helper method and use it to return early when the
contentScriptWorld() has not been created yet. This can happen if the page does
not have injected content, or the injected content hasn't executed yet.

Also adds const to inline methods that should be const in WebExtensionContextProxy.h.

* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm:
(WebKit::WebExtensionContextProxy::internalDispatchRuntimeMessageEvent): Check hasDOMWrapperWorld()
and early return while calling the completionHandler.
(WebKit::WebExtensionContextProxy::internalDispatchRuntimeConnectEvent): Ditto.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIStorageCocoa.mm:
(WebKit::WebExtensionContextProxy::dispatchStorageChangedEvent): Check hasDOMWrapperWorld().
* Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionContextProxyCocoa.mm:
(WebKit::WebExtensionContextProxy::toDOMWrapperWorld const): Made const.
* Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h:

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