[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 15:35:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 07b531680e1d8694731b6c3161c94b70a8400d56
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 8 20:32:54 2010 +0000
NPClass::construct and NPClass::invokeDefault never called with out-of-process plug-ins in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=49198
Reviewed by Adam Roben.
WebKit2:
* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::invokeDefault):
Call NPClass::invokeDefault.
(WebKit::NPObjectMessageReceiver::construct):
Call NPClass::construct
* Shared/Plugins/NPObjectMessageReceiver.messages.in:
Add InvokeDefault and Construct messages.
* Shared/Plugins/NPObjectProxy.cpp:
(WebKit::NPObjectProxy::invokeDefault):
Send the InvokeDefault message.
(WebKit::NPObjectProxy::construct):
Send the Construct message.
(WebKit::NPObjectProxy::NP_InvokeDefault):
Call NPObjectProxy::invokeDefault.
(WebKit::NPObjectProxy::NP_Construct):
Call NPObjectProxy::construct.
LayoutTests:
Remove now passing tests.
* platform/mac-snowleopard/Skipped:
* platform/mac-wk2/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 29332dd..9f1c516 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-08 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Adam Roben.
+
+ NPClass::construct and NPClass::invokeDefault never called with out-of-process plug-ins in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=49198
+
+ Remove now passing tests.
+
+ * platform/mac-snowleopard/Skipped:
+ * platform/mac-wk2/Skipped:
+
2010-11-08 Tony Chang <tony at chromium.org>
Unreviewed, updating plugin expectations.
diff --git a/LayoutTests/platform/mac-snowleopard/Skipped b/LayoutTests/platform/mac-snowleopard/Skipped
index fbb498d..2581fc5 100644
--- a/LayoutTests/platform/mac-snowleopard/Skipped
+++ b/LayoutTests/platform/mac-snowleopard/Skipped
@@ -19,7 +19,6 @@ plugins/destroy-plugin-from-callback.html
# https://bugs.webkit.org/show_bug.cgi?id=36462
plugins/keyboard-events.html
plugins/mouse-events-fixedpos.html
-plugins/npruntime/construct.html
# https://bugs.webkit.org/show_bug.cgi?id=30528 - test started failing
# immediately on Snow Leopard due to the expected exception not being
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 67e32f2..b5847f0 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1726,7 +1726,6 @@ plugins/set-status.html
plugins/update-widgets-crash.html
plugins/window-open.html
plugins/npruntime/identifier-conversion.html
-plugins/npruntime/invoke-default.html
plugins/npruntime/plugin-scriptable-object-invoke-default.html
########################################
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 0c2fa36..c4859a7 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,35 @@
2010-11-08 Anders Carlsson <andersca at apple.com>
+ Reviewed by Adam Roben.
+
+ NPClass::construct and NPClass::invokeDefault never called with out-of-process plug-ins in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=49198
+
+ * Shared/Plugins/NPObjectMessageReceiver.cpp:
+ (WebKit::NPObjectMessageReceiver::invokeDefault):
+ Call NPClass::invokeDefault.
+
+ (WebKit::NPObjectMessageReceiver::construct):
+ Call NPClass::construct
+
+ * Shared/Plugins/NPObjectMessageReceiver.messages.in:
+ Add InvokeDefault and Construct messages.
+
+ * Shared/Plugins/NPObjectProxy.cpp:
+ (WebKit::NPObjectProxy::invokeDefault):
+ Send the InvokeDefault message.
+
+ (WebKit::NPObjectProxy::construct):
+ Send the Construct message.
+
+ (WebKit::NPObjectProxy::NP_InvokeDefault):
+ Call NPObjectProxy::invokeDefault.
+
+ (WebKit::NPObjectProxy::NP_Construct):
+ Call NPObjectProxy::construct.
+
+2010-11-08 Anders Carlsson <andersca at apple.com>
+
Reviewed by Dan Bernstein.
Plug-in views should not assume that plugins are RenderEmbeddedObjects
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
index c71d409..f0efb5d 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
@@ -31,7 +31,6 @@
#include "NPRemoteObjectMap.h"
#include "NPRuntimeUtilities.h"
#include "NPVariantData.h"
-#include "NotImplemented.h"
namespace WebKit {
@@ -82,12 +81,41 @@ void NPObjectMessageReceiver::invoke(const NPIdentifierData& methodNameData, con
arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i]));
NPVariant result;
+ VOID_TO_NPVARIANT(result);
+
returnValue = m_npObject->_class->invoke(m_npObject, methodNameData.createNPIdentifier(), arguments.data(), arguments.size(), &result);
- if (!returnValue)
- return;
+ if (returnValue) {
+ // Convert the NPVariant to an NPVariantData.
+ resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result);
+ }
+
+ // Release all arguments.
+ for (size_t i = 0; i < argumentsData.size(); ++i)
+ releaseNPVariantValue(&arguments[i]);
- // Convert the NPVariant to an NPVariantData.
- resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result);
+ // And release the result.
+ releaseNPVariantValue(&result);
+}
+
+void NPObjectMessageReceiver::invokeDefault(const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData)
+{
+ if (!m_npObject->_class->invokeDefault) {
+ returnValue = false;
+ return;
+ }
+
+ Vector<NPVariant> arguments;
+ for (size_t i = 0; i < argumentsData.size(); ++i)
+ arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i]));
+
+ NPVariant result;
+ VOID_TO_NPVARIANT(result);
+
+ returnValue = m_npObject->_class->invokeDefault(m_npObject, arguments.data(), arguments.size(), &result);
+ if (returnValue) {
+ // Convert the NPVariant to an NPVariantData.
+ resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result);
+ }
// Release all arguments.
for (size_t i = 0; i < argumentsData.size(); ++i)
@@ -172,6 +200,34 @@ void NPObjectMessageReceiver::enumerate(bool& returnValue, Vector<NPIdentifierDa
npnMemFree(identifiers);
}
+void NPObjectMessageReceiver::construct(const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData)
+{
+ if (!NP_CLASS_STRUCT_VERSION_HAS_CTOR(m_npObject->_class) || !m_npObject->_class->construct) {
+ returnValue = false;
+ return;
+ }
+
+ Vector<NPVariant> arguments;
+ for (size_t i = 0; i < argumentsData.size(); ++i)
+ arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i]));
+
+ NPVariant result;
+ VOID_TO_NPVARIANT(result);
+
+ returnValue = m_npObject->_class->construct(m_npObject, arguments.data(), arguments.size(), &result);
+ if (returnValue) {
+ // Convert the NPVariant to an NPVariantData.
+ resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result);
+ }
+
+ // Release all arguments.
+ for (size_t i = 0; i < argumentsData.size(); ++i)
+ releaseNPVariantValue(&arguments[i]);
+
+ // And release the result.
+ releaseNPVariantValue(&result);
+}
+
} // namespace WebKit
#endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
index cbfa020..d3363f9 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
@@ -57,11 +57,13 @@ private:
void deallocate();
void hasMethod(const NPIdentifierData&, bool& returnValue);
void invoke(const NPIdentifierData&, const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData);
+ void invokeDefault(const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData);
void hasProperty(const NPIdentifierData&, bool& returnValue);
void getProperty(const NPIdentifierData&, bool& returnValue, NPVariantData& resultData);
void setProperty(const NPIdentifierData&, const NPVariantData& propertyValueData, bool& returnValue);
void removeProperty(const NPIdentifierData&, bool& returnValue);
void enumerate(bool& returnValue, Vector<NPIdentifierData>& identifiersData);
+ void construct(const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData);
NPRemoteObjectMap* m_npRemoteObjectMap;
uint64_t m_npObjectID;
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
index 7b51b1d..d81ffc4 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
@@ -26,11 +26,13 @@ messages -> NPObjectMessageReceiver {
Deallocate() -> ()
HasMethod(WebKit::NPIdentifierData methodName) -> (bool returnValue)
Invoke(WebKit::NPIdentifierData methodName, Vector<WebKit::NPVariantData> argumentsData) -> (bool returnValue, WebKit::NPVariantData resultData)
+ InvokeDefault(Vector<WebKit::NPVariantData> argumentsData) -> (bool returnValue, WebKit::NPVariantData resultData)
HasProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
GetProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue, WebKit::NPVariantData resultData)
SetProperty(WebKit::NPIdentifierData propertyName, WebKit::NPVariantData propertyValueData) -> (bool returnValue)
RemoveProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
Enumerate() -> (bool returnValue, Vector<WebKit::NPIdentifierData> identifiersData)
+ Construct(Vector<WebKit::NPVariantData> argumentsData) -> (bool returnValue, WebKit::NPVariantData resultData)
}
#endif
diff --git a/WebKit2/Shared/Plugins/NPObjectProxy.cpp b/WebKit2/Shared/Plugins/NPObjectProxy.cpp
index 36ca01a..e7fc47f 100644
--- a/WebKit2/Shared/Plugins/NPObjectProxy.cpp
+++ b/WebKit2/Shared/Plugins/NPObjectProxy.cpp
@@ -34,7 +34,6 @@
#include "NPRemoteObjectMap.h"
#include "NPRuntimeUtilities.h"
#include "NPVariantData.h"
-#include "NotImplemented.h"
namespace WebKit {
@@ -123,6 +122,28 @@ bool NPObjectProxy::invoke(NPIdentifier methodName, const NPVariant* arguments,
return true;
}
+bool NPObjectProxy::invokeDefault(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+{
+ if (!m_npRemoteObjectMap)
+ return false;
+
+ Vector<NPVariantData> argumentsData;
+ for (uint32_t i = 0; i < argumentCount; ++i)
+ argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i]));
+
+ bool returnValue = false;
+ NPVariantData resultData;
+
+ if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::InvokeDefault(argumentsData), Messages::NPObjectMessageReceiver::InvokeDefault::Reply(returnValue, resultData), m_npObjectID))
+ return false;
+
+ if (!returnValue)
+ return false;
+
+ *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData);
+ return true;
+}
+
bool NPObjectProxy::hasProperty(NPIdentifier propertyName)
{
if (!m_npRemoteObjectMap)
@@ -213,6 +234,28 @@ bool NPObjectProxy::enumerate(NPIdentifier** identifiers, uint32_t* identifierCo
return true;
}
+bool NPObjectProxy::construct(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+{
+ if (!m_npRemoteObjectMap)
+ return false;
+
+ Vector<NPVariantData> argumentsData;
+ for (uint32_t i = 0; i < argumentCount; ++i)
+ argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i]));
+
+ bool returnValue = false;
+ NPVariantData resultData;
+
+ if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::Construct(argumentsData), Messages::NPObjectMessageReceiver::Construct::Reply(returnValue, resultData), m_npObjectID))
+ return false;
+
+ if (!returnValue)
+ return false;
+
+ *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData);
+ return true;
+}
+
NPClass* NPObjectProxy::npClass()
{
static NPClass npClass = {
@@ -257,10 +300,9 @@ bool NPObjectProxy::NP_Invoke(NPObject* npObject, NPIdentifier methodName, const
return toNPObjectProxy(npObject)->invoke(methodName, arguments, argumentCount, result);
}
-bool NPObjectProxy::NP_InvokeDefault(NPObject*, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+bool NPObjectProxy::NP_InvokeDefault(NPObject* npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
{
- notImplemented();
- return false;
+ return toNPObjectProxy(npObject)->invokeDefault(arguments, argumentCount, result);
}
bool NPObjectProxy::NP_HasProperty(NPObject* npObject, NPIdentifier propertyName)
@@ -288,10 +330,9 @@ bool NPObjectProxy::NP_Enumerate(NPObject* npObject, NPIdentifier** identifiers,
return toNPObjectProxy(npObject)->enumerate(identifiers, identifierCount);
}
-bool NPObjectProxy::NP_Construct(NPObject*, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+bool NPObjectProxy::NP_Construct(NPObject* npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
{
- notImplemented();
- return false;
+ return toNPObjectProxy(npObject)->construct(arguments, argumentCount, result);
}
} // namespace WebKit
diff --git a/WebKit2/Shared/Plugins/NPObjectProxy.h b/WebKit2/Shared/Plugins/NPObjectProxy.h
index 4fc02cf..e4c00c5 100644
--- a/WebKit2/Shared/Plugins/NPObjectProxy.h
+++ b/WebKit2/Shared/Plugins/NPObjectProxy.h
@@ -61,11 +61,13 @@ private:
bool hasMethod(NPIdentifier methodName);
bool invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
+ bool invokeDefault(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
bool hasProperty(NPIdentifier propertyName);
bool getProperty(NPIdentifier propertyName, NPVariant* result);
bool setProperty(NPIdentifier propertyName, const NPVariant* value);
bool removeProperty(NPIdentifier propertyName);
bool enumerate(NPIdentifier** identifiers, uint32_t* identifierCount);
+ bool construct(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
static NPClass* npClass();
static NPObject* NP_Allocate(NPP, NPClass*);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list