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
[GLib] Make most public types final #8972
[GLib] Make most public types final #8972
Conversation
EWS run on previous version of this PR (hash 534ae73) |
We need to bump the minimum glib requirements to 2.70 (only for the new api). |
Good point, I will update the PR. Also no idea what's going on with the timeout in the WPE EWS builder, I'll see if that happens locally or not. |
#define WEBKIT_DEFINE_FINAL_TYPE_IN_2022_API WEBKIT_DEFINE_TYPE | ||
#define WEBKIT_DEFINE_FINAL_TYPE_WITH_CODE_IN_2022_API WEBKIT_DEFINE_TYPE_WITH_CODE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but I'm not sure it's really much benefit? I would just provide two different definitions of WEBKIT_DEFINE_FINAL_TYPE
, where it uses G_TYPE_FLAG_FINAL
if it's the new API and just doesn't for the old API. That will avoid adding the _IN_2022_API
cruft to all the source files.
Would that conflict with what you've got planned next?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of that first, but then it seemed to me quite obscure that a WEBKIT_DEFINE_FINAL_TYPE
macro won't create a final type when ENABLE(2022_GLIB_API)
is offβit feels very wrong and will be confusing. So I did the extra indirection with the _IN_2022_API
suffix for clarity.
534ae73
to
0662c46
Compare
EWS run on previous version of this PR (hash 0662c46) |
0662c46
to
35ace71
Compare
The lockup was caused by marking |
EWS run on previous version of this PR (hash 35ace71) |
Would probably be nicer for WebKitWebHitTestResult to use composition rather than inheritance, but I certainly don't expect you to change that here.... |
Let's do it as a separate issue, I have filed #251075 for that. |
35ace71
to
275acb0
Compare
EWS run on current version of this PR (hash 275acb0) |
https://bugs.webkit.org/show_bug.cgi?id=251008 Reviewed by Carlos Garcia Campos. Add a new WEBKIT_DEFINE_TYPE_WITH_CODE macro, plus two helper macros with an _IN_2022_API suffix to be used all around the code. These two macros mark types as final only when ENABLE(2022_GLIB_API) is enabled, otherwise they behave as the existing ones (leaving the types as derivable). This will allow in the future to easily search for types which change between final/non-final, and remove the use of _IN_2022_API macros when the old API is no longer needed. Also, make sure to require GLib 2.70 for the new API. * Source/WTF/wtf/glib/WTFGType.h: Add new macros and switch between final/non-final depending on the value of ENABLE(2022_GLIB_API). * Source/WebKit/Shared/API/glib/WebKitContextMenu.cpp: * Source/WebKit/Shared/API/glib/WebKitContextMenuItem.cpp: * Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp: * Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp: * Source/WebKit/Shared/API/glib/WebKitUserMessage.cpp: * Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp: * Source/WebKit/UIProcess/API/glib/WebKitBackForwardList.cpp: * Source/WebKit/UIProcess/API/glib/WebKitBackForwardListItem.cpp: * Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp: * Source/WebKit/UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitDownload.cpp: * Source/WebKit/UIProcess/API/glib/WebKitEditorState.cpp: * Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp: * Source/WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitFindController.cpp: * Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp: * Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitMediaKeySystemPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: * Source/WebKit/UIProcess/API/glib/WebKitNotification.cpp: * Source/WebKit/UIProcess/API/glib/WebKitNotificationPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitOptionMenu.cpp: * Source/WebKit/UIProcess/API/glib/WebKitPointerLockPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: * Source/WebKit/UIProcess/API/glib/WebKitSecurityManager.cpp: * Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp: * Source/WebKit/UIProcess/API/glib/WebKitUserContentFilterStore.cpp: * Source/WebKit/UIProcess/API/glib/WebKitUserContentManager.cpp: * Source/WebKit/UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp: * Source/WebKit/UIProcess/API/glib/WebKitWebResource.cpp: * Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataAccessPermissionRequest.cpp: * Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManager.cpp: * Source/WebKit/UIProcess/API/glib/WebKitWindowProperties.cpp: * Source/WebKit/UIProcess/API/gtk/WebKitColorChooserRequest.cpp: * Source/WebKit/UIProcess/API/gtk/WebKitPrintOperation.cpp: * Source/WebKit/UIProcess/API/gtk/WebKitWebInspector.cpp: * Source/cmake/OptionsGTK.cmake: Require GLib 2.70.0 when ENABLE(2022_GLIB_API) is set. * Source/cmake/OptionsWPE.cmake: Ditto. Canonical link: https://commits.webkit.org/259270@main
275acb0
to
f1f3d52
Compare
Committed 259270@main (f1f3d52): https://commits.webkit.org/259270@main Reviewed commits have been landed. Closing PR #8972 and removing active labels. |
f1f3d52
275acb0
π π§ͺ winπ§ͺ ios-wk2π§ͺ gtk-wk2π π§ͺ jscπ§ͺ mac-AS-debug-wk2