[Webkit-unassigned] [Bug 45145] [Qt] V8 port for QT platform: v8 binding changes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 3 16:11:14 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45145





--- Comment #6 from Nate Chapin <japhet at chromium.org>  2010-09-03 16:11:14 PST ---
(From update of attachment 66438)

> +#if PLATFORM(QT)
> +    if (widget->isPluginView()) {
> +        PluginView* pluginView = static_cast<PluginView*>(widget);
> +        // Create script inscance (v8 object)
> +        PassScriptInstance instance = pluginView->bindingInstance();
> +        if (!instance)
> +            return 0;
> +        // Get npobject
> +        NPObject* npObject = static_cast<NPObject*>(instance->instance()->GetPointerFromInternalField(v8DOMWrapperObjectIndex));

I'm confused by this. It looks like you're accessing an NPObject that is stored on a PassScriptInstance and creating a new PassScriptInstance for it? Why wouldn't we just want the original PassScriptInstance?

I think I'm probably missing some subtlety :)

> +        // Track the plugin object. We've been given a reference to the object.
> +        m_pluginObjects.set(widget, npObject);
> +        return instance;
> +    }
>  
> +    QWidget* platformWidget = widget->platformWidget();
> +    if (!platformWidget)
> +        return 0;
> +
> +    Frame* activeFrame = V8Proxy::retrieveFrameForEnteredContext();
> +    if (!activeFrame)
> +        return 0;
> +
> +    V8Proxy* activeProxy = activeFrame->script()->proxy();
> +    v8::HandleScope handleScope;
> +    v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(activeFrame);
> +    if (v8Context.IsEmpty())
> +        return 0;
> +
> +    v8::Context::Scope scope(v8Context);
> +    v8::Handle<v8::Object> result = 
> +        V8::Bindings::QtInstance::getQtInstance(platformWidget, v8Context, "", QScriptEngine::QtOwnership)->getV8Object();
> +    return V8ScriptInstance::create(result);
> +

Would it be possible to put the QT-specific code in a WebCore/platform/qt/PlatformBridge.h and make use of the PlatformBridge::pluginScriptableObject() call that Android and Chromium use?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list