Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnifiedPDF] PDFPluginBase should notify the web page of selection changes #23755

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

aprotyas
Copy link
Member

@aprotyas aprotyas commented Feb 2, 2024

749aa44

[UnifiedPDF] PDFPluginBase should notify the web page of selection changes
https://bugs.webkit.org/show_bug.cgi?id=268618
rdar://122179410

Reviewed by Simon Fraser.

In anticipation of selection tracking support in UnifiedPDFPlugin, this
patch factors out PDFPlugin::notifySelectionChanged into a common space.

We also take the liberty to drop the PDFSelection argument to
notifySelectionChanged, given that it was not being read or passed to the
web page by the PDF plugin.

Lastly, we add a WebFrame::protectedCoreLocalFrame getter to better
abide by our smart pointer rules, where we protect both the objects on
which we call non-trivial member functions, and parameters we pass to
such functions.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate pdfLayerController:didChangeSelection:]):
(WebKit::PDFPlugin::notifySelectionChanged): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::notifySelectionChanged):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::protectedCoreLocalFrame const):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:

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

d46739f

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl 🧪 ios-wk2 🧪 api-mac ✅ 🧪 api-wpe
🧪 ios-wk2-wpt ✅ 🛠 gtk
🧪 api-ios 🧪 mac-wk2 🧪 gtk-wk2
✅ 🛠 tv 🧪 mac-AS-debug-wk2 🧪 api-gtk
🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
🛠 watch-sim

@aprotyas aprotyas requested a review from cdumez as a code owner February 2, 2024 18:19
@aprotyas aprotyas self-assigned this Feb 2, 2024
@aprotyas aprotyas added the PDF For bugs in WebKit's built-in PDF support. label Feb 2, 2024
Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I'll let a proper PDFPlugin engineer do the formal review.

@aprotyas aprotyas added the merge-queue Applied to send a pull request to merge-queue label Feb 2, 2024
…anges

https://bugs.webkit.org/show_bug.cgi?id=268618
rdar://122179410

Reviewed by Simon Fraser.

In anticipation of selection tracking support in UnifiedPDFPlugin, this
patch factors out PDFPlugin::notifySelectionChanged into a common space.

We also take the liberty to drop the PDFSelection argument to
notifySelectionChanged, given that it was not being read or passed to the
web page by the PDF plugin.

Lastly, we add a WebFrame::protectedCoreLocalFrame getter to better
abide by our smart pointer rules, where we protect both the objects on
which we call non-trivial member functions, and parameters we pass to
such functions.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate pdfLayerController:didChangeSelection:]):
(WebKit::PDFPlugin::notifySelectionChanged): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::notifySelectionChanged):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::protectedCoreLocalFrame const):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:

Canonical link: https://commits.webkit.org/274005@main
@webkit-commit-queue
Copy link
Collaborator

Committed 274005@main (749aa44): https://commits.webkit.org/274005@main

Reviewed commits have been landed. Closing PR #23755 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 2, 2024
@aprotyas aprotyas deleted the eng/268618 branch February 2, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDF For bugs in WebKit's built-in PDF support.
Projects
None yet
5 participants