Changeset 71273 in webkit


Ignore:
Timestamp:
Nov 3, 2010 2:54:17 PM (14 years ago)
Author:
andersca@apple.com
Message:

Implement NP_SetProperty
https://bugs.webkit.org/show_bug.cgi?id=48956

Reviewed by Adam Roben.

WebKit2:

  • Shared/Plugins/NPObjectMessageReceiver.cpp:

(WebKit::NPObjectMessageReceiver::setProperty):
Call the NPClass setProperty function.

  • Shared/Plugins/NPObjectMessageReceiver.messages.in:

Add SetProperty message.

  • Shared/Plugins/NPObjectProxy.cpp:

(WebKit::NPObjectProxy::setProperty):
Send a SetProperty message.

(WebKit::NPObjectProxy::NP_SetProperty):
Call NPObjectProxy::setProperty.

LayoutTests:

Remove now passing test.

  • platform/mac-wk2/Skipped:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r71268 r71273  
     12010-11-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Implement NP_SetProperty
     6        https://bugs.webkit.org/show_bug.cgi?id=48956
     7
     8        Remove now passing test.
     9
     10        * platform/mac-wk2/Skipped:
     11
    1122010-11-03  Matthew Delaney  <mdelaney@apple.com>
    213
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r71183 r71273  
    17471747plugins/npruntime/plugin-scriptable-object-invoke-default.html
    17481748plugins/npruntime/round-trip-npobject.html
    1749 plugins/npruntime/set-property.html
    17501749 
    17511750########################################
  • trunk/WebKit2/ChangeLog

    r71270 r71273  
     12010-11-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Implement NP_SetProperty
     6        https://bugs.webkit.org/show_bug.cgi?id=48956
     7
     8        * Shared/Plugins/NPObjectMessageReceiver.cpp:
     9        (WebKit::NPObjectMessageReceiver::setProperty):
     10        Call the NPClass setProperty function.
     11
     12        * Shared/Plugins/NPObjectMessageReceiver.messages.in:
     13        Add SetProperty message.
     14
     15        * Shared/Plugins/NPObjectProxy.cpp:
     16        (WebKit::NPObjectProxy::setProperty):
     17        Send a SetProperty message.
     18
     19        (WebKit::NPObjectProxy::NP_SetProperty):
     20        Call NPObjectProxy::setProperty.
     21
    1222010-11-03  Anders Carlsson  <andersca@apple.com>
    223
  • trunk/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp

    r71183 r71273  
    127127}
    128128
     129void NPObjectMessageReceiver::setProperty(const NPIdentifierData& propertyNameData, const NPVariantData& propertyValueData, bool& returnValue)
     130{
     131    if (!m_npObject->_class->setProperty) {
     132        returnValue = false;
     133        return;
     134    }
     135
     136    NPVariant propertyValue = m_npRemoteObjectMap->npVariantDataToNPVariant(propertyValueData);
     137
     138    // Set the property.
     139    returnValue = m_npObject->_class->setProperty(m_npObject, propertyNameData.createNPIdentifier(), &propertyValue);
     140
     141    // And release the value.
     142    releaseNPVariantValue(&propertyValue);
     143}
     144
    129145} // namespace WebKit
    130146
  • trunk/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h

    r71183 r71273  
    5858    void hasProperty(const NPIdentifierData&, bool& returnValue);
    5959    void getProperty(const NPIdentifierData&, bool& returnValue, NPVariantData& resultData);
     60    void setProperty(const NPIdentifierData&, const NPVariantData& propertyValueData, bool& returnValue);
    6061
    6162    NPRemoteObjectMap* m_npRemoteObjectMap;
  • trunk/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in

    r71183 r71273  
    2929    HasProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
    3030    GetProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue, WebKit::NPVariantData resultData)
     31    SetProperty(WebKit::NPIdentifierData propertyName, WebKit::NPVariantData propertyValueData) -> (bool returnValue)
    3132}
    3233
  • trunk/WebKit2/Shared/Plugins/NPObjectProxy.cpp

    r71183 r71273  
    159159}
    160160
     161bool NPObjectProxy::setProperty(NPIdentifier propertyName, const NPVariant* value)
     162{
     163    if (!m_npRemoteObjectMap)
     164        return false;
     165   
     166    NPIdentifierData propertyNameData = NPIdentifierData::fromNPIdentifier(propertyName);
     167    NPVariantData propertyValueData = m_npRemoteObjectMap->npVariantToNPVariantData(*value);
     168
     169    bool returnValue = false;
     170
     171    if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::SetProperty(propertyNameData, propertyValueData), Messages::NPObjectMessageReceiver::SetProperty::Reply(returnValue), m_npObjectID))
     172        return false;
     173
     174    return returnValue;
     175}
     176
    161177NPClass* NPObjectProxy::npClass()
    162178{
     
    219235}
    220236
    221 bool NPObjectProxy::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value)
    222 {
    223     notImplemented();
    224     return false;
     237bool NPObjectProxy::NP_SetProperty(NPObject* npObject, NPIdentifier propertyName, const NPVariant* value)
     238{
     239    return toNPObjectProxy(npObject)->setProperty(propertyName, value);
    225240}
    226241
  • trunk/WebKit2/Shared/Plugins/NPObjectProxy.h

    r71183 r71273  
    6262    bool hasProperty(NPIdentifier propertyName);
    6363    bool getProperty(NPIdentifier propertyName, NPVariant* result);
     64    bool setProperty(NPIdentifier propertyName, const NPVariant* value);
    6465
    6566    static NPClass* npClass();
Note: See TracChangeset for help on using the changeset viewer.