Commit 9e026612 authored by andersca@apple.com's avatar andersca@apple.com
Browse files

Implement NP_HasProperty for NPObjectProxy

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

Reviewed by Sam Weinig.

WebKit2:

* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::hasProperty):
Call The hasProperty callback function.

* Shared/Plugins/NPObjectMessageReceiver.messages.in:
Add HasProperty message.

* Shared/Plugins/NPObjectProxy.cpp:
(WebKit::NPObjectProxy::hasProperty):
Send the HasProperty message.

(WebKit::NPObjectProxy::NP_HasProperty):
Call hasProperty.

LayoutTests:

Remove now passing test.

* platform/mac-wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a6bbf674
2010-11-02 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Implement NP_HasProperty for NPObjectProxy
https://bugs.webkit.org/show_bug.cgi?id=48876
Remove now passing test.
* platform/mac-wk2/Skipped:
2010-11-02 David Hyatt <hyatt@apple.com>
 
Reviewed by Dan Bernstein.
......@@ -1737,7 +1737,6 @@ plugins/return-negative-one-from-write.html
plugins/set-status.html
plugins/update-widgets-crash.html
plugins/window-open.html
plugins/npruntime/embed-property.html
plugins/npruntime/enumerate.html
plugins/npruntime/evaluate.html
plugins/npruntime/get-int-identifier-special-values.html
......
2010-11-02 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Implement NP_HasProperty for NPObjectProxy
https://bugs.webkit.org/show_bug.cgi?id=48876
* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::hasProperty):
Call The hasProperty callback function.
* Shared/Plugins/NPObjectMessageReceiver.messages.in:
Add HasProperty message.
* Shared/Plugins/NPObjectProxy.cpp:
(WebKit::NPObjectProxy::hasProperty):
Send the HasProperty message.
(WebKit::NPObjectProxy::NP_HasProperty):
Call hasProperty.
2010-11-02 Sam Weinig <sam@webkit.org>
 
Reviewed by Anders Carlsson.
......
......@@ -60,6 +60,16 @@ void NPObjectMessageReceiver::deallocate()
delete this;
}
void NPObjectMessageReceiver::hasProperty(const NPIdentifierData& propertyNameData, bool& returnValue)
{
if (!m_npObject->_class->hasProperty) {
returnValue = false;
return;
}
returnValue = m_npObject->_class->hasProperty(m_npObject, propertyNameData.createNPIdentifier());
}
void NPObjectMessageReceiver::getProperty(const NPIdentifierData& propertyNameData, bool& returnValue, NPVariantData& resultData)
{
if (!m_npObject->_class->getProperty) {
......
......@@ -53,6 +53,7 @@ private:
// Message handlers.
void deallocate();
void hasProperty(const NPIdentifierData&, bool& returnValue);
void getProperty(const NPIdentifierData&, bool& returnValue, NPVariantData& resultData);
NPRemoteObjectMap* m_npRemoteObjectMap;
......
......@@ -23,10 +23,8 @@
#if ENABLE(PLUGIN_PROCESS)
messages -> NPObjectMessageReceiver {
# Deallocate the NPObject.
Deallocate() -> ()
# Get the given property.
HasProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
GetProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue, WebKit::NPVariantData resultData)
}
......
......@@ -84,6 +84,21 @@ void NPObjectProxy::initialize(NPRemoteObjectMap* npRemoteObjectMap, uint64_t np
m_npObjectID = npObjectID;
}
bool NPObjectProxy::hasProperty(NPIdentifier propertyName)
{
if (!m_npRemoteObjectMap)
return false;
NPIdentifierData propertyNameData = NPIdentifierData::fromNPIdentifier(propertyName);
bool returnValue = false;
if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::HasProperty(propertyNameData), Messages::NPObjectMessageReceiver::HasProperty::Reply(returnValue), m_npObjectID))
return false;
return returnValue;
}
bool NPObjectProxy::getProperty(NPIdentifier propertyName, NPVariant* result)
{
if (!m_npRemoteObjectMap)
......@@ -156,10 +171,9 @@ bool NPObjectProxy::NP_InvokeDefault(NPObject*, const NPVariant* arguments, uint
return false;
}
bool NPObjectProxy::NP_HasProperty(NPObject*, NPIdentifier propertyName)
bool NPObjectProxy::NP_HasProperty(NPObject* npObject, NPIdentifier propertyName)
{
notImplemented();
return false;
return toNPObjectProxy(npObject)->hasProperty(propertyName);
}
bool NPObjectProxy::NP_GetProperty(NPObject* npObject, NPIdentifier propertyName, NPVariant* result)
......
......@@ -57,6 +57,7 @@ private:
void initialize(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID);
bool hasProperty(NPIdentifier propertyName);
bool getProperty(NPIdentifier propertyName, NPVariant* result);
static NPClass* npClass();
......
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