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

[WebAuthn] Clean up observers in CcidService #14274

Conversation

pascoej
Copy link
Member

@pascoej pascoej commented May 23, 2023

52e6f05

[WebAuthn] Clean up observers in CcidService
https://bugs.webkit.org/show_bug.cgi?id=257240
rdar://109060751

Reviewed by Brent Fulgham.

This change ensures removeObserver:forKeyPath: is called for each observer we
add via addObserver in CcidService.

* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidService.h:
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidService.mm:
(WebKit::CcidService::~CcidService):
(WebKit::CcidService::removeObservers):
(WebKit::CcidService::platformStartDiscovery):
(WebKit::CcidService::updateSlots):
(-[_WKSmartCardSlotStateObserver observeValueForKeyPath:ofObject:change:context:]):
(-[_WKSmartCardSlotStateObserver removeObserver]):

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

6896738

Misc iOS, tvOS & watchOS macOS Linux Windows
❌ πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt ❌ πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@pascoej pascoej requested a review from cdumez as a code owner May 23, 2023 23:46
@pascoej pascoej self-assigned this May 23, 2023
@pascoej pascoej added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label May 23, 2023
@pascoej pascoej requested a review from brentfulgham May 23, 2023 23:47
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 23, 2023
@pascoej pascoej removed the merging-blocked Applied to prevent a change from being merged label May 24, 2023
@pascoej pascoej force-pushed the eng/WebAuthn-Clean-up-observers-in-CcidService branch from 246d7a2 to 6896738 Compare May 24, 2023 00:14
@pascoej
Copy link
Member Author

pascoej commented May 24, 2023

I think the style checker error here is erroneous as it's treating the forward declaration as an identifier.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 24, 2023
Copy link
Contributor

@brentfulgham brentfulgham left a comment

Choose a reason for hiding this comment

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

Looks reasonable. Is there a way you could test this behavior works properly?

@pascoej
Copy link
Member Author

pascoej commented May 24, 2023

I tested manually with local logging to verify observers are added and removed as expected.

@pascoej pascoej added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels May 24, 2023
https://bugs.webkit.org/show_bug.cgi?id=257240
rdar://109060751

Reviewed by Brent Fulgham.

This change ensures removeObserver:forKeyPath: is called for each observer we
add via addObserver in CcidService.

* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidService.h:
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidService.mm:
(WebKit::CcidService::~CcidService):
(WebKit::CcidService::removeObservers):
(WebKit::CcidService::platformStartDiscovery):
(WebKit::CcidService::updateSlots):
(-[_WKSmartCardSlotStateObserver observeValueForKeyPath:ofObject:change:context:]):
(-[_WKSmartCardSlotStateObserver removeObserver]):

Canonical link: https://commits.webkit.org/264485@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WebAuthn-Clean-up-observers-in-CcidService branch from 6896738 to 52e6f05 Compare May 24, 2023 21:33
@webkit-commit-queue
Copy link
Collaborator

Committed 264485@main (52e6f05): https://commits.webkit.org/264485@main

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

@webkit-commit-queue webkit-commit-queue merged commit 52e6f05 into WebKit:main May 24, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
5 participants