summaryrefslogtreecommitdiff
path: root/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit2/PluginProcess/PluginControllerProxy.cpp')
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.cpp93
1 files changed, 11 insertions, 82 deletions
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 1fd1b1124..81b290a1f 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -69,7 +69,6 @@ PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, c
, m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
, m_pluginDestructionProtectCount(0)
, m_pluginDestroyTimer(RunLoop::main(), this, &PluginControllerProxy::destroy)
- , m_pluginCreationParameters(0)
, m_waitingForDidUpdate(false)
, m_pluginCanceledManualStreamLoad(false)
#if PLATFORM(MAC)
@@ -106,9 +105,7 @@ bool PluginControllerProxy::initialize(const PluginCreationParameters& creationP
m_windowNPObject = m_connection->npRemoteObjectMap()->createNPObjectProxy(creationParameters.windowNPObjectID, m_plugin.get());
ASSERT(m_windowNPObject);
- m_pluginCreationParameters = &creationParameters;
bool returnValue = m_plugin->initialize(this, creationParameters.parameters);
- m_pluginCreationParameters = 0;
if (!returnValue) {
// Get the plug-in so we can pass it to removePluginControllerProxy. The pointer is only
@@ -122,7 +119,7 @@ bool PluginControllerProxy::initialize(const PluginCreationParameters& creationP
return false;
}
- platformInitialize();
+ platformInitialize(creationParameters);
return true;
}
@@ -269,9 +266,6 @@ NPObject* PluginControllerProxy::pluginElementNPObject()
bool PluginControllerProxy::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result, bool allowPopups)
{
- if (tryToShortCircuitEvaluate(npObject, scriptString, result))
- return true;
-
PluginDestructionProtector protector(this);
NPVariant npObjectAsNPVariant;
@@ -293,58 +287,6 @@ bool PluginControllerProxy::evaluate(NPObject* npObject, const String& scriptStr
return true;
}
-bool PluginControllerProxy::tryToShortCircuitInvoke(NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, bool& returnValue, NPVariant& result)
-{
- // Only try to short circuit evaluate for plug-ins that have the quirk specified.
-#if PLUGIN_ARCHITECTURE(MAC)
- if (!PluginProcess::shared().netscapePluginModule()->pluginQuirks().contains(PluginQuirks::CanShortCircuitSomeNPRuntimeCallsDuringInitialization))
- return false;
-#else
- return false;
-#endif
-
- // And only when we're in initialize.
- if (!inInitialize())
- return false;
-
- // And only when the NPObject is the window NPObject.
- if (npObject != m_windowNPObject)
- return false;
-
- // And only when we don't have any arguments.
- if (argumentCount)
- return false;
-
- IdentifierRep* methodNameRep = static_cast<IdentifierRep*>(methodName);
- if (!methodNameRep->isString())
- return false;
-
- if (!strcmp(methodNameRep->string(), "__flash_getWindowLocation")) {
- result.type = NPVariantType_String;
- result.value.stringValue = createNPString(m_pluginCreationParameters->parameters.documentURL.utf8());
- returnValue = true;
- return true;
- }
-
- if (!strcmp(methodNameRep->string(), "__flash_getTopLocation")) {
- if (m_pluginCreationParameters->parameters.toplevelDocumentURL.isNull()) {
- // If the toplevel document is URL it means that the frame that the plug-in is in doesn't have access to the toplevel document.
- // In this case, just pass the string "[object]" to Flash.
- result.type = NPVariantType_String;
- result.value.stringValue = createNPString("[object]");
- returnValue = true;
- return true;
- }
-
- result.type = NPVariantType_String;
- result.value.stringValue = createNPString(m_pluginCreationParameters->parameters.toplevelDocumentURL.utf8());
- returnValue = true;
- return true;
- }
-
- return false;
-}
-
void PluginControllerProxy::setStatusbarText(const String& statusbarText)
{
m_connection->connection()->send(Messages::PluginProxy::SetStatusbarText(statusbarText), m_pluginInstanceID);
@@ -598,32 +540,19 @@ void PluginControllerProxy::getFormValue(bool& returnValue, String& formValue)
returnValue = m_plugin->getFormValue(formValue);
}
-bool PluginControllerProxy::tryToShortCircuitEvaluate(NPObject* npObject, const String& scriptString, NPVariant* result)
+#if PLUGIN_ARCHITECTURE(X11)
+uint64_t PluginControllerProxy::createPluginContainer()
{
- // Only try to short circuit evaluate for plug-ins that have the quirk specified.
-#if PLUGIN_ARCHITECTURE(MAC)
- if (!PluginProcess::shared().netscapePluginModule()->pluginQuirks().contains(PluginQuirks::CanShortCircuitSomeNPRuntimeCallsDuringInitialization))
- return false;
-#else
- return false;
-#endif
-
- // And only when we're in initialize.
- if (!inInitialize())
- return false;
-
- // And only when the NPObject is the window NPObject.
- if (npObject != m_windowNPObject)
- return false;
-
- // Now, check for the right strings.
- if (scriptString != "function __flash_getWindowLocation() { return window.location; }"
- && scriptString != "function __flash_getTopLocation() { return top.location; }")
- return false;
+ uint64_t windowID = 0;
+ m_connection->connection()->sendSync(Messages::PluginProxy::CreatePluginContainer(), Messages::PluginProxy::CreatePluginContainer::Reply(windowID), m_pluginInstanceID);
+ return windowID;
+}
- VOID_TO_NPVARIANT(*result);
- return true;
+void PluginControllerProxy::windowedPluginGeometryDidChange(const IntRect& frameRect, const IntRect& clipRect, uint64_t windowID)
+{
+ m_connection->connection()->send(Messages::PluginProxy::WindowedPluginGeometryDidChange(frameRect, clipRect, windowID), m_pluginInstanceID);
}
+#endif
} // namespace WebKit