We don't support enum values yet in GObject DOM bindings, but they are internally strings anyway, so we can keep the old implementations using strings as custom functions until we properly support enums.
Created attachment 230257 [details] Patch
Comment on attachment 230257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=230257&action=review Looks good with a few minor suggestions. > Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:74 > + gchar* result = convertToUTF8String(item->kind()); > + return result; Can you just return convertToUTF8String(item->kind()); ? > Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:103 > + WebCore::TextTrack* item = WebKit::core(self); > + WTF::String convertedValue = WTF::String::fromUTF8(value); > + item->setMode(convertedValue); Can't this just be WebKit::core(self)->setMode(WTF::String::fromUTF8(value)); ?
(In reply to comment #2) > (From update of attachment 230257 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=230257&action=review > > Looks good with a few minor suggestions. Thanks > > Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:74 > > + gchar* result = convertToUTF8String(item->kind()); > > + return result; > > Can you just return convertToUTF8String(item->kind()); ? Sure, this is actually generated code, but added manually. I think this happens in the generated code because if the method raises exceptions there's code to deal with them, between the two lines. > > Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:103 > > + WebCore::TextTrack* item = WebKit::core(self); > > + WTF::String convertedValue = WTF::String::fromUTF8(value); > > + item->setMode(convertedValue); > > Can't this just be WebKit::core(self)->setMode(WTF::String::fromUTF8(value)); ? Ditto.
Committed r167876: <http://trac.webkit.org/changeset/167876>