On Jun 16, 2010, at 5:55 PM, Darin Adler wrote:

> Sounds reasonable to me. We already follow pointers and use virtual functions 
> for all these things, so I don’t see them adding a lot of overhead.
> 
> Would these Mechanism classes replace all the current Client classes?

Like Kenneth said, these are more like "global clients". I don't see the 
benefit of replacing our current Client classes.

> Would the mechanism objects be obtained once and cached globally? How is the 
> initial PlatformMechanism object created?

My current design is a bit different from the example I gave in my original 
mail. The getter functions are not virtual, but the functions to create the 
various mechanisms are. Something like:

class PlatformMechanism {
public:
        PluginMechanism* pluginMechanism()
        {
                if (!m_pluginMechanism)
                        m_pluginMechanism = createPluginMechanism();
                return m_pluginMechanism;
        }

private:
        virtual PluginMechanism* createPluginMechanism() = 0;

        PluginMechanism* m_pluginMechanism;
};

> How is the initial PlatformMechanism object created?

WebKit will create a class that derives from PlatformMechanism. In the WebKit 
initialization code we'll create an instance of this class and set it as the 
platform mechanism using a setPlatformMechanism call.

- Anders
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to