⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181864 in webkit


Ignore:
Timestamp:
Mar 23, 2015, 1:34:52 PM (11 years ago)
Author:
andersca@apple.com
Message:

Source/WebKit2:
Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
https://bugs.webkit.org/show_bug.cgi?id=133692
rdar://problem/17255947

Reviewed by Alexey Proskuryakov.

Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
where we need the plug-in to stay around after the call.

  • Shared/Plugins/NPObjectMessageReceiver.cpp:

(WebKit::NPObjectMessageReceiver::invoke):
(WebKit::NPObjectMessageReceiver::invokeDefault):
(WebKit::NPObjectMessageReceiver::getProperty):
(WebKit::NPObjectMessageReceiver::setProperty):
(WebKit::NPObjectMessageReceiver::construct):

LayoutTests:
Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again
https://bugs.webkit.org/show_bug.cgi?id=133692
rdar://problem/17255947

Reviewed by Alexey Proskuryakov.

  • platform/mac-wk2/TestExpectations:

Unskip test.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r181861 r181864  
     12015-03-23  Anders Carlsson  <andersca@apple.com>
     2
     3        Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again
     4        https://bugs.webkit.org/show_bug.cgi?id=133692
     5        rdar://problem/17255947
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        * platform/mac-wk2/TestExpectations:
     10        Unskip test.
     11
    1122015-03-23  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r181760 r181864  
    241241webkit.org/b/93980 http/tests/appcache/load-from-appcache-defer-resume-crash.html [ Skip ]
    242242
    243 webkit.org/b/133692 platform/mac-wk2/plugins/destroy-during-async-npp-new.html [ Skip ]
    244 
    245243webkit.org/b/136554 platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-nested-frame-scrollability.html [ Pass Failure ]
    246244webkit.org/b/139901 platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html [ Pass Failure ]
  • trunk/Source/WebKit2/ChangeLog

    r181859 r181864  
     12015-03-23  Anders Carlsson  <andersca@apple.com>
     2
     3        Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
     4        https://bugs.webkit.org/show_bug.cgi?id=133692
     5        rdar://problem/17255947
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
     10        where we need the plug-in to stay around after the call.
     11
     12        * Shared/Plugins/NPObjectMessageReceiver.cpp:
     13        (WebKit::NPObjectMessageReceiver::invoke):
     14        (WebKit::NPObjectMessageReceiver::invokeDefault):
     15        (WebKit::NPObjectMessageReceiver::getProperty):
     16        (WebKit::NPObjectMessageReceiver::setProperty):
     17        (WebKit::NPObjectMessageReceiver::construct):
     18
    1192015-03-23  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp

    r156688 r181864  
    3333#include "NPRuntimeUtilities.h"
    3434#include "NPVariantData.h"
     35#include "Plugin.h"
     36#include "PluginController.h"
    3537
    3638namespace WebKit {
     
    8183    VOID_TO_NPVARIANT(result);
    8284
     85    PluginController::PluginDestructionProtector protector(m_plugin->controller());
     86
    8387    returnValue = m_npObject->_class->invoke(m_npObject, methodNameData.createNPIdentifier(), arguments.data(), arguments.size(), &result);
    8488    if (returnValue) {
     
    109113    VOID_TO_NPVARIANT(result);
    110114
     115    PluginController::PluginDestructionProtector protector(m_plugin->controller());
     116
    111117    returnValue = m_npObject->_class->invokeDefault(m_npObject, arguments.data(), arguments.size(), &result);
    112118    if (returnValue) {
     
    143149    VOID_TO_NPVARIANT(result);
    144150
     151    PluginController::PluginDestructionProtector protector(m_plugin->controller());
     152
    145153    returnValue = m_npObject->_class->getProperty(m_npObject, propertyNameData.createNPIdentifier(), &result);
    146154    if (!returnValue)
    147155        return;
    148156
    149     // Convert the NPVariant to an NPVariantData.
     157
    150158    resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin);
    151159
    152     // And release the result.
    153160    releaseNPVariantValue(&result);
    154161}
     
    163170    NPVariant propertyValue = m_npRemoteObjectMap->npVariantDataToNPVariant(propertyValueData, m_plugin);
    164171
    165     // Set the property.
     172    PluginController::PluginDestructionProtector protector(m_plugin->controller());
     173
    166174    returnValue = m_npObject->_class->setProperty(m_npObject, propertyNameData.createNPIdentifier(), &propertyValue);
    167175
    168     // And release the value.
    169176    releaseNPVariantValue(&propertyValue);
    170177}
     
    214221    VOID_TO_NPVARIANT(result);
    215222
     223    PluginController::PluginDestructionProtector protector(m_plugin->controller());
     224
    216225    returnValue = m_npObject->_class->construct(m_npObject, arguments.data(), arguments.size(), &result);
    217     if (returnValue) {
    218         // Convert the NPVariant to an NPVariantData.
     226    if (returnValue)
    219227        resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin);
    220     }
    221 
    222     // Release all arguments.
     228
    223229    for (size_t i = 0; i < argumentsData.size(); ++i)
    224230        releaseNPVariantValue(&arguments[i]);
    225231   
    226     // And release the result.
    227232    releaseNPVariantValue(&result);
    228233}
Note: See TracChangeset for help on using the changeset viewer.