Bug 132228 - [GTK] TextTrack kind and mode attributes are enums since r166180
Summary: [GTK] TextTrack kind and mode attributes are enums since r166180
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 131672
  Show dependency treegraph
 
Reported: 2014-04-27 01:53 PDT by Carlos Garcia Campos
Modified: 2014-04-28 01:07 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.09 KB, patch)
2014-04-27 01:54 PDT, Carlos Garcia Campos
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2014-04-27 01:53:11 PDT
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.
Comment 1 Carlos Garcia Campos 2014-04-27 01:54:56 PDT
Created attachment 230257 [details]
Patch
Comment 2 Martin Robinson 2014-04-27 04:07:43 PDT
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)); ?
Comment 3 Carlos Garcia Campos 2014-04-28 00:11:27 PDT
(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.
Comment 4 Carlos Garcia Campos 2014-04-28 01:07:29 PDT
Committed r167876: <http://trac.webkit.org/changeset/167876>