RESOLVED FIXED Bug 99705
[GTK] Use custom private macros to define GObjects
https://bugs.webkit.org/show_bug.cgi?id=99705
Summary [GTK] Use custom private macros to define GObjects
Carlos Garcia Campos
Reported 2012-10-18 03:51:42 PDT
We can reduce the GObject boilerplate and hide the placement new syntax that causes some confusion.
Attachments
Patch (74.91 KB, patch)
2012-10-18 04:00 PDT, Carlos Garcia Campos
no flags
Updated patch (75.02 KB, patch)
2012-10-18 08:41 PDT, Carlos Garcia Campos
no flags
Updated patch (75.04 KB, patch)
2012-11-22 05:20 PST, Carlos Garcia Campos
mrobinson: review+
Carlos Garcia Campos
Comment 1 2012-10-18 04:00:11 PDT
Created attachment 169389 [details] Patch This patch should be applied on top of the C API migration ones. It removes ~350 lines of GObject boilerplate.
Carlos Garcia Campos
Comment 2 2012-10-18 08:41:13 PDT
Created attachment 169422 [details] Updated patch Patch updated just to apply on top of patch attached to bug #99724
WebKit Review Bot
Comment 3 2012-10-18 08:46:03 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
WebKit Review Bot
Comment 4 2012-10-18 08:46:27 PDT
Attachment 169422 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:46: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:47: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:69: Missing space inside { }. [whitespace/braces] [5] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:70: Missing space inside { }. [whitespace/braces] [5] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:106: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:107: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:108: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:109: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:110: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:111: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:112: This { should be at the end of the previous line [whitespace/braces] [4] Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:128: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 12 in 31 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 5 2012-10-18 12:31:58 PDT
Comment on attachment 169422 [details] Updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=169422&action=review Nice work, but until we establish an exception for GTK code for code indenting, I think we should just follow the style rules. >> Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:47 >> +WEBKIT_DEFINE_TYPE_WITH_CODE(WebKitGeolocationPermissionRequest, webkit_geolocation_permission_request, G_TYPE_OBJECT, > > Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Please follow the style rule here. >> Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:69 >> +#define WEBKIT_DEFINE_TYPE(TN, t_n, T_P) _WEBKIT_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, 0, {}) > > Missing space inside { }. [whitespace/braces] [5] Instead of using variable names like TN, t_n and T_P they should be real words, I think. > Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:74 > +#define _WEBKIT_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \ Instead of using TypeName, type_name, TYPE_PARENT, how about typeName, underscoredTypeName, parentType, flags? >> Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h:106 >> + g_intern_static_string(#TypeName), \ > > Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Please follow the style rule here as well.
Carlos Garcia Campos
Comment 6 2012-10-18 23:11:57 PDT
WebKitPrivate.h should probably just be ignored by the style checker, I can include that in the patch.
Carlos Garcia Campos
Comment 7 2012-11-22 05:20:04 PST
Created attachment 175652 [details] Updated patch Managed to work around all the style "issues"
Carlos Garcia Campos
Comment 8 2012-11-23 00:31:45 PST
Note You need to log in before you can comment on or make changes to this bug.