Changeset 71178 in webkit


Ignore:
Timestamp:
Nov 2, 2010 3:28:05 PM (13 years ago)
Author:
andersca@apple.com
Message:

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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r71177 r71178  
     12010-11-02  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Implement NP_HasProperty for NPObjectProxy
     6        https://bugs.webkit.org/show_bug.cgi?id=48876
     7
     8        Remove now passing test.
     9
     10        * platform/mac-wk2/Skipped:
     11
    1122010-11-02  David Hyatt  <hyatt@apple.com>
    213
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r71126 r71178  
    17381738plugins/update-widgets-crash.html
    17391739plugins/window-open.html
    1740 plugins/npruntime/embed-property.html
    17411740plugins/npruntime/enumerate.html
    17421741plugins/npruntime/evaluate.html
  • trunk/WebKit2/ChangeLog

    r71175 r71178  
     12010-11-02  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Implement NP_HasProperty for NPObjectProxy
     6        https://bugs.webkit.org/show_bug.cgi?id=48876
     7
     8        * Shared/Plugins/NPObjectMessageReceiver.cpp:
     9        (WebKit::NPObjectMessageReceiver::hasProperty):
     10        Call The hasProperty callback function.
     11
     12        * Shared/Plugins/NPObjectMessageReceiver.messages.in:
     13        Add HasProperty message.
     14
     15        * Shared/Plugins/NPObjectProxy.cpp:
     16        (WebKit::NPObjectProxy::hasProperty):
     17        Send the HasProperty message.
     18
     19        (WebKit::NPObjectProxy::NP_HasProperty):
     20        Call hasProperty.
     21
     22
    1232010-11-02  Sam Weinig  <sam@webkit.org>
    224
  • trunk/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp

    r71140 r71178  
    6161}
    6262
     63void NPObjectMessageReceiver::hasProperty(const NPIdentifierData& propertyNameData, bool& returnValue)
     64{
     65    if (!m_npObject->_class->hasProperty) {
     66        returnValue = false;
     67        return;
     68    }
     69
     70    returnValue = m_npObject->_class->hasProperty(m_npObject, propertyNameData.createNPIdentifier());
     71}
     72
    6373void NPObjectMessageReceiver::getProperty(const NPIdentifierData& propertyNameData, bool& returnValue, NPVariantData& resultData)
    6474{
  • trunk/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h

    r71127 r71178  
    5454    // Message handlers.
    5555    void deallocate();
     56    void hasProperty(const NPIdentifierData&, bool& returnValue);
    5657    void getProperty(const NPIdentifierData&, bool& returnValue, NPVariantData& resultData);
    5758
  • trunk/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in

    r71127 r71178  
    2424
    2525messages -> NPObjectMessageReceiver {
    26     # Deallocate the NPObject.
    2726    Deallocate() -> ()
    28 
    29     # Get the given property.
     27    HasProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
    3028    GetProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue, WebKit::NPVariantData resultData)
    3129}
  • trunk/WebKit2/Shared/Plugins/NPObjectProxy.cpp

    r71140 r71178  
    8585}
    8686
     87bool NPObjectProxy::hasProperty(NPIdentifier propertyName)
     88{
     89    if (!m_npRemoteObjectMap)
     90        return false;
     91   
     92    NPIdentifierData propertyNameData = NPIdentifierData::fromNPIdentifier(propertyName);
     93
     94    bool returnValue = false;
     95   
     96    if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::HasProperty(propertyNameData), Messages::NPObjectMessageReceiver::HasProperty::Reply(returnValue), m_npObjectID))
     97        return false;
     98
     99    return returnValue;
     100}
     101
    87102bool NPObjectProxy::getProperty(NPIdentifier propertyName, NPVariant* result)
    88103{
     
    157172}
    158173
    159 bool NPObjectProxy::NP_HasProperty(NPObject*, NPIdentifier propertyName)
    160 {
    161     notImplemented();
    162     return false;
     174bool NPObjectProxy::NP_HasProperty(NPObject* npObject, NPIdentifier propertyName)
     175{
     176    return toNPObjectProxy(npObject)->hasProperty(propertyName);
    163177}
    164178
  • trunk/WebKit2/Shared/Plugins/NPObjectProxy.h

    r71140 r71178  
    5858    void initialize(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID);
    5959
     60    bool hasProperty(NPIdentifier propertyName);
    6061    bool getProperty(NPIdentifier propertyName, NPVariant* result);
    6162
Note: See TracChangeset for help on using the changeset viewer.