Commit 48eb3672 authored by andersca@apple.com's avatar andersca@apple.com
Browse files

NPN_Evaluate doesn't work with out-of-process plugins in WebKit2

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

Reviewed by Adam Roben.

WebKit2:

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::evaluate):
Send an Evaluate message.

* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::evaluate):
Call Evaluate on the plug-in proxy.

* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginProxy.messages.in:
Add Evaluate message.

LayoutTests:

Remove now passing tests.

* platform/mac-wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90a69ff0
2010-11-08 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
NPN_Evaluate doesn't work with out-of-process plugins in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=49193
Remove now passing tests.
* platform/mac-wk2/Skipped:
2010-11-08 Anders Carlsson <andersca@apple.com>
 
Reviewed by John Sullivan.
......@@ -1714,32 +1714,19 @@ http/tests/plugins/geturlnotify-from-npp-destroystream.html
http/tests/plugins/interrupted-get-url.html
http/tests/plugins/local-geturl-from-remote.html
http/tests/plugins/npapi-response-headers.html
plugins/destroy-during-npp-new.html
plugins/destroy-stream-twice.html
plugins/embed-inside-object.html
plugins/get-javascript-url.html
plugins/get-url-with-iframe-target.html
plugins/geturl-replace-query.html
plugins/inner-html-display-none.html
plugins/instance-available-before-stylesheets-loaded-object.html
plugins/instance-available-before-stylesheets-loaded.html
plugins/netscape-plugin-map-data-to-src.html
plugins/netscape-plugin-setwindow-size.html
plugins/override-node-method.html
plugins/nested-plugin-objects.html
plugins/pass-different-npp-struct.html
plugins/plugin-remove-subframe.html
plugins/reentrant-update-widget-positions.html
plugins/reloadplugins-no-pages.html
plugins/return-error-from-new-stream-doesnt-invoke-destroy-stream.html
plugins/return-negative-one-from-write.html
plugins/set-status.html
plugins/update-widgets-crash.html
plugins/window-open.html
plugins/npruntime/evaluate.html
plugins/npruntime/identifier-conversion.html
plugins/npruntime/invoke-browserfuncs.html
plugins/npruntime/invoke-default.html
plugins/npruntime/npruntime.html
plugins/npruntime/plugin-scriptable-object-invoke-default.html
########################################
......
2010-11-08 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
NPN_Evaluate doesn't work with out-of-process plugins in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=49193
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::evaluate):
Send an Evaluate message.
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::evaluate):
Call Evaluate on the plug-in proxy.
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginProxy.messages.in:
Add Evaluate message.
2010-11-08 Anders Carlsson <andersca@apple.com>
 
Reviewed by John Sullivan.
......
......@@ -29,8 +29,10 @@
#include "BackingStore.h"
#include "DataReference.h"
#include "NPObjectProxy.h"
#include "NPRemoteObjectMap.h"
#include "NPRuntimeUtilities.h"
#include "NPVariantData.h"
#include "NetscapePlugin.h"
#include "NotImplemented.h"
#include "PluginProcess.h"
......@@ -191,10 +193,25 @@ NPObject* PluginControllerProxy::pluginElementNPObject()
return m_connection->npRemoteObjectMap()->createNPObjectProxy(pluginElementNPObjectID);
}
bool PluginControllerProxy::evaluate(NPObject*, const String& scriptString, NPVariant* result, bool allowPopups)
bool PluginControllerProxy::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result, bool allowPopups)
{
notImplemented();
return false;
NPVariant npObjectAsNPVariant;
OBJECT_TO_NPVARIANT(npObject, npObjectAsNPVariant);
// Send the NPObject over as an NPVariantData.
NPVariantData npObjectAsNPVariantData = m_connection->npRemoteObjectMap()->npVariantToNPVariantData(npObjectAsNPVariant);
bool returnValue = false;
NPVariantData resultData;
if (!m_connection->connection()->sendSync(Messages::PluginProxy::Evaluate(npObjectAsNPVariantData, scriptString, allowPopups), Messages::PluginProxy::Evaluate::Reply(returnValue, resultData), m_pluginInstanceID))
return false;
if (!returnValue)
return false;
*result = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(resultData);
return true;
}
void PluginControllerProxy::setStatusbarText(const WTF::String&)
......
......@@ -31,6 +31,7 @@
#include "DataReference.h"
#include "NPRemoteObjectMap.h"
#include "NPRuntimeUtilities.h"
#include "NPVariantData.h"
#include "NotImplemented.h"
#include "PluginController.h"
#include "PluginControllerProxyMessages.h"
......@@ -379,6 +380,25 @@ void PluginProxy::getPluginElementNPObject(uint64_t& pluginElementNPObjectID)
releaseNPObject(pluginElementNPObject);
}
void PluginProxy::evaluate(const NPVariantData& npObjectAsVariantData, const String& scriptString, bool allowPopups, bool& returnValue, NPVariantData& resultData)
{
NPVariant npObjectAsVariant = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(npObjectAsVariantData);
ASSERT(NPVARIANT_IS_OBJECT(npObjectAsVariant));
NPVariant result;
returnValue = m_pluginController->evaluate(NPVARIANT_TO_OBJECT(npObjectAsVariant), scriptString, &result, allowPopups);
if (!returnValue)
return;
// Convert the NPVariant to an NPVariantData.
resultData = m_connection->npRemoteObjectMap()->npVariantToNPVariantData(result);
// And release the result.
releaseNPVariantValue(&result);
releaseNPVariantValue(&npObjectAsVariant);
}
void PluginProxy::update(const IntRect& paintedRect)
{
if (paintedRect == m_frameRect)
......
......@@ -47,6 +47,7 @@ namespace WebCore {
namespace WebKit {
class BackingStore;
class NPVariantData;
class PluginProcessConnection;
class PluginProxy : public Plugin {
......@@ -110,6 +111,7 @@ private:
void setCookiesForURL(const String& urlString, const String& cookieString);
void getWindowScriptNPObject(uint64_t& windowScriptNPObjectID);
void getPluginElementNPObject(uint64_t& pluginElementNPObjectID);
void evaluate(const NPVariantData& npObjectAsVariantData, const String& scriptString, bool allowPopups, bool& returnValue, NPVariantData& resultData);
RefPtr<PluginProcessConnection> m_connection;
uint64_t m_pluginInstanceID;
......
......@@ -44,6 +44,8 @@ messages -> PluginProxy {
# Gets a reference to the plug-in element NPObject.
GetPluginElementNPObject() -> (uint64_t pluginElementNPObjectID)
# Evaluates the given JavaScript string.
Evaluate(WebKit::NPVariantData npObjectAsVariantData, WTF::String scriptString, bool allowPopups) -> (bool returnValue, WebKit::NPVariantData resultData)
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment