| Summary: | Factor out some Notifications-specific messages from WebPageProxy messages | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||||||||||
| Component: | WebKit Misc. | Assignee: | Brady Eidson <beidson> | ||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||
| Severity: | Normal | CC: | achristensen, annulen, darin, ews-watchlist, gyuyoung.kim, ryuan.choi, sergio, webkit-bug-importer | ||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Brady Eidson
2021-10-20 10:35:44 PDT
Created attachment 441895 [details]
Patch v1
Comment on attachment 441895 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=441895&action=review > Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:36 > +public: > + WebNotificationManagerMessageHandler(WebPageProxy&); You might consider making the constructor private and befriending WebPageProxy so that only WebPageProxy can construct it. We usually try to avoid friend, but I think in this case it would be a reasonable choice. > Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:39 > + void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID) final; nit: lang should be a full word. > Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:40 > + void cancelNotification(uint64_t notificationID) final; nit: this should be an ObjectIdentifier of some type. (In reply to Alex Christensen from comment #2) > Comment on attachment 441895 [details] > Patch v1 > > View in context: > https://bugs.webkit.org/attachment.cgi?id=441895&action=review > > > Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:36 > > +public: > > + WebNotificationManagerMessageHandler(WebPageProxy&); > > You might consider making the constructor private and befriending > WebPageProxy so that only WebPageProxy can construct it. We usually try to > avoid friend, but I think in this case it would be a reasonable choice. > Agreed. > > Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:39 > > + void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID) final; > > nit: lang should be a full word. Lots of places to change this one... oooooff > > > Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:40 > > + void cancelNotification(uint64_t notificationID) final; > > nit: this should be an ObjectIdentifier of some type. https://bugs.webkit.org/show_bug.cgi?id=232023 Created attachment 441905 [details]
PFL v1
Comment on attachment 441895 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=441895&action=review >>> Source/WebKit/UIProcess/Notifications/WebNotificationManagerMessageHandler.h:36 >>> + WebNotificationManagerMessageHandler(WebPageProxy&); >> >> You might consider making the constructor private and befriending WebPageProxy so that only WebPageProxy can construct it. We usually try to avoid friend, but I think in this case it would be a reasonable choice. > > Agreed. Also a nice touch to use explicit for a constructor like this that happens to have exactly one argument but is not intended for type conversion. Created attachment 441908 [details]
PFL v2 (now with more explicit content)
Created attachment 441911 [details]
PFL v3 - Now with more CMakeLists
Created attachment 441913 [details]
PFL v4 - Now with fewer tabs
Committed r284564 (243306@main): <https://commits.webkit.org/243306@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 441913 [details]. |