[webkit-changes] [WebKit/WebKit] bf47c3: (Unified)PDFPlugin: "Open" and "Save" write useles...

Tim Horton noreply at github.com
Fri Mar 22 22:30:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bf47c375c189dccc7b88509bbb997e6e0363c18c
      https://github.com/WebKit/WebKit/commit/bf47c375c189dccc7b88509bbb997e6e0363c18c
  Author: Tim Horton <timothy_horton at apple.com>
  Date:   2024-03-22 (Fri, 22 Mar 2024)

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

  Log Message:
  -----------
  (Unified)PDFPlugin: "Open" and "Save" write useless incomplete files when the document is not completely loaded
https://bugs.webkit.org/show_bug.cgi?id=271497
<rdar://problem/117451408>

Reviewed by Abrar Rahman Protyasha and Simon Fraser.

If Open or Save are clicked before the document is loaded, defer the action
until it is.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::teardown):
Call save/open with invalid data when tearing down the plugin.

(WebKit::PDFPluginBase::streamDidFinishLoading):
Call save/open once we're actually ready.

(WebKit::PDFPluginBase::save):
(WebKit::PDFPluginBase::openWithPreview):
If called multiple times, let go of the old completion handler by calling it
back with invalid data; only store the most recent one.

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