[vlc-devel] Support of events in Mozilla plugin - Beta

jpd at videolan.org jpd at videolan.org
Tue Sep 22 10:55:59 CEST 2009


On Tue, Sep 08, 2009 at 10:15:56AM +0200, Yannick Br?hon wrote:
> Here is our updated version of our patch to the plugin for enabling
> javascript reception of VLC events.

Sadly I really don't have time to properly review it, and won't for
a week or two at least, but I do have a couple of comments.

First, I noticed you did use a bitmap, which is good, but I had
something slightly different in mind. I have that code around so I'll
drop that in soonish. Same with the list of events, or you could take
a look at the lookup function in core.

Second, I'd really rather you didn't traverse string arguments where you
could be parsing an array-of-strings passed from javascript instead.

Third, there's still a global that I'd rather see go. Give the map to
some object to care for, and since you need to compare against NPUTF8*
anyway you could be saving a couple string conversions here.


> The function returns True if all goes well, or a string with the error
> message otherwise. If any of the event in eventList does not exist, an
> error message is sent back to javascript, and the eventListener is not
> added.

I think this needs rethinking. It is perhaps more conventional to return
true or false and find some other way to return the string or perhaps
not return anything (`return void') but throw an exception with the
message on error.




More information about the vlc-devel mailing list