Flashplayer

koos vriezen koos.vriezen at gmail.com
Sat Oct 20 11:40:05 BST 2007


2007/10/20, Maksim Orlovich <mo85 at cornell.edu>:

> > I never had a crash of npplayer, other than obvious temporary typos
>
> I wonder if I screwed up then. The code is pretty complex (see the
> attached diff).

If I'm not mistaken, you only implemented js->plugin. The stubObject
you return has a class that only has a version. Afaics, everything
should be done in the class functions, there you should handle the
calls, using the NpObject as instance.

I have for this subclassed NpObject as
typedef struct _JsObject {
    NPObject npobject;
    struct _JsObject * parent;
    char * name;
} JsObject;
which allows me to build a path like window.location.href. Other
objects are assigned to a js variable on the 'this' object of the DOM
object ('name' would then be something like 'this.refobject.someid'

and setup a class as
    js_class.structVersion = NP_CLASS_STRUCT_VERSION;
    js_class.allocate = windowClassAllocate;
    js_class.deallocate = windowClassDeallocate;
    js_class.invalidate = windowClassInvalidate;
    js_class.hasMethod = windowClassHasMethod;
    ..
so that when eg windowClassHasMethod is called, I know the NpObject
arg can be casted to JsObject.
Anyhow, setting all class members to zero, looks like a crashing cause.

The otherway around would indeed need a lists of js referenced object.
I can't oversee all your patch, but looks okay ..

Br.
Koos




More information about the kfm-devel mailing list