[webkit-changes] [WebKit/WebKit] 0cab9f: Use the main thread when accessing the document's ...

Commit Queue noreply at github.com
Wed Dec 6 11:31:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0cab9f4dd652f65700d05b6875ad129c290f6715
      https://github.com/WebKit/WebKit/commit/0cab9f4dd652f65700d05b6875ad129c290f6715
  Author: Dominic Mazzoni <dmazzoni at google.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

  Log Message:
  -----------
  Use the main thread when accessing the document's axObjectCache from WKPDFPluginAccessibilityObject

https://bugs.webkit.org/show_bug.cgi?id=265470
rdar://118894435

Reviewed by Andres Gonzalez.

WKPDFPluginAccessibilityObject.parent was accessing the pdf plugin's axObjectCache,
which required accessing a weak pointer that can't be safely used off the main
thread. Fix it by computing the parent on the main thread instead.

Because the function returns an ivar after the call to the main thread,
it's necessary to protect "self" through the scope of the whole function call,
not just in the lambda.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFPluginAccessibilityObject parent]):
(WebKit::PDFPlugin::axObjectCache const):

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




More information about the webkit-changes mailing list