Changeset 135751 in webkit


Ignore:
Timestamp:
Nov 26, 2012, 12:02:10 PM (13 years ago)
Author:
Lucas Forschler
Message:

Merged r132713. <rdar://problem/12589195>

Location:
branches/safari-536.28-branch
Files:
12 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/safari-536.28-branch/LayoutTests/ChangeLog

    r135072 r135751  
     12012-11-26  Lucas Forschler  <lforschler@apple.com>
     2
     3        Merge r132713
     4
     5    2012-10-26  Anders Carlsson  <andersca@apple.com>
     6
     7            Crash when making NPRuntime calls with a null NPP pointer
     8            https://bugs.webkit.org/show_bug.cgi?id=100569
     9
     10            Reviewed by Darin Adler.
     11
     12            Add new tests.
     13
     14            * plugins/npruntime/npruntime-calls-with-null-npp-expected.txt: Added.
     15            * plugins/npruntime/npruntime-calls-with-null-npp.html: Added.
     16
    1172012-11-18  Simon Fraser  <simon.fraser@apple.com>
    218
  • branches/safari-536.28-branch/Source/WebKit2/ChangeLog

    r135007 r135751  
     12012-11-26  Lucas Forschler  <lforschler@apple.com>
     2
     3        Merge r132713
     4
     5    2012-10-26  Anders Carlsson  <andersca@apple.com>
     6
     7            Crash when making NPRuntime calls with a null NPP pointer
     8            https://bugs.webkit.org/show_bug.cgi?id=100569
     9            <rdar://problem/11726426>
     10            <rdar://problem/12352836>
     11
     12            Reviewed by Darin Adler.
     13
     14            Finally bite the bullet and remove the assertion from NetscapePlugin::fromNPP. The WebKit1 equivalent of this
     15            function used to return the plug-in currently being initialized in NPP_New, but we've never done that in WebKit2
     16            and it has never been necessary. The crashes fixed here are not from calls underneath NPP_New so fixing it wouldn't
     17            do us any good anyway.
     18
     19            Also, make the PluginDestructionProtector handle a null plug-in gracefully.
     20
     21            * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
     22            (WebKit::PluginDestructionProtector::PluginDestructionProtector):
     23            (PluginDestructionProtector):
     24            * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     25            (WebKit::NetscapePlugin::fromNPP):
     26
    1272012-11-16  Lucas Forschler  <lforschler@apple.com>
    228
  • branches/safari-536.28-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp

    r112950 r135751  
    5050public:
    5151    explicit PluginDestructionProtector(NetscapePlugin* plugin)
    52         : m_protector(static_cast<Plugin*>(plugin)->controller())
    5352    {
     53        if (plugin)
     54            m_protector = adoptPtr(new PluginController::PluginDestructionProtector(static_cast<Plugin*>(plugin)->controller()));
    5455    }
    5556   
    5657private:
    57     PluginController::PluginDestructionProtector m_protector;
     58    OwnPtr<PluginController::PluginDestructionProtector> m_protector;
    5859};
    5960
  • branches/safari-536.28-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r127522 r135751  
    112112PassRefPtr<NetscapePlugin> NetscapePlugin::fromNPP(NPP npp)
    113113{
    114     if (npp)
    115         return static_cast<NetscapePlugin*>(npp->ndata);
    116 
    117     // FIXME: Return the current NetscapePlugin here.
    118     ASSERT_NOT_REACHED();
    119     return 0;
     114    if (!npp)
     115        return 0;
     116
     117    return static_cast<NetscapePlugin*>(npp->ndata);
    120118}
    121119
  • branches/safari-536.28-branch/Tools/ChangeLog

    r135007 r135751  
     12012-11-26  Lucas Forschler  <lforschler@apple.com>
     2
     3        Merge r132713
     4
     5    2012-10-26  Anders Carlsson  <andersca@apple.com>
     6
     7            Crash when making NPRuntime calls with a null NPP pointer
     8            https://bugs.webkit.org/show_bug.cgi?id=100569
     9
     10            Reviewed by Darin Adler.
     11
     12            Add new NPRuntimeCallsWithNullNPP plug-in test.
     13
     14            * DumpRenderTree/DumpRenderTree.gypi:
     15            * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
     16            * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
     17            (PluginTest::NPN_ReleaseVariantValue):
     18            (PluginTest::netscapeFuncs):
     19            * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
     20            (PluginTest):
     21            * DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp: Added.
     22            (NPRuntimeCallsWithNullNPP):
     23            (NPRuntimeCallsWithNullNPP::NPRuntimeCallsWithNullNPP):
     24            (NPRuntimeCallsWithNullNPP::NPP_New):
     25            * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
     26            * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
     27            * GNUmakefile.am:
     28
    1292012-11-16  Lucas Forschler  <lforschler@apple.com>
    230
  • branches/safari-536.28-branch/Tools/DumpRenderTree/DumpRenderTree.gypi

    r134834 r135751  
    6868            'TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp',
    6969            'TestNetscapePlugIn/Tests/NPPNewFails.cpp',
     70            'TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp',
    7071            'TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp',
    7172            'TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp',
  • branches/safari-536.28-branch/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj

    r134834 r135751  
    5151                1ACF898D132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACF898B132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp */; };
    5252                1AD4CB2212A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */; };
     53                1AD8683F163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */; };
    5354                1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */; };
    5455                1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */; };
     
    250251                1ACF898B132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPDeallocateCalledBeforeNPShutdown.cpp; sourceTree = "<group>"; };
    251252                1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetUserAgentWithNullNPPFromNPPNew.cpp; sourceTree = "<group>"; };
     253                1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeCallsWithNullNPP.cpp; sourceTree = "<group>"; };
    252254                1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableNPObjectInvokeDefault.cpp; sourceTree = "<group>"; };
    253255                1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLNotifyWithURLThatFailsToLoad.cpp; sourceTree = "<group>"; };
     
    488490                                BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */,
    489491                                BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */,
     492                                BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */,
    490493                                BCA18B360C9B021900114369 /* AppleScriptController.h */,
    491494                                BCA18B370C9B021900114369 /* AppleScriptController.m */,
     
    548551                                5113DE6615F6CBE5005EC8B3 /* NPPNewFails.cpp */,
    549552                                C031182A134E4A2B00919757 /* NPPSetWindowCalledDuringDestruction.cpp */,
     553                                1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */,
    550554                                1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */,
    551555                                1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */,
     
    908912                                5113DE6715F6CBE5005EC8B3 /* NPPNewFails.cpp in Sources */,
    909913                                1C5C9B2E15F103AA0035558E /* LogNPPSetWindow.cpp in Sources */,
     914                                1AD8683F163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp in Sources */,
    910915                        );
    911916                        runOnlyForDeploymentPostprocessing = 0;
  • branches/safari-536.28-branch/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp

    r125127 r135751  
    219219}
    220220
     221void PluginTest::NPN_ReleaseVariantValue(NPVariant* variant)
     222{
     223    browser->releasevariantvalue(variant);
     224}
     225
    221226#ifdef XP_MACOSX
    222227bool PluginTest::NPN_ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace)
     
    253258}
    254259
     260NPNetscapeFuncs* PluginTest::netscapeFuncs()
     261{
     262    return browser;
     263}
     264
    255265void PluginTest::waitUntilDone()
    256266{
  • branches/safari-536.28-branch/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h

    r125127 r135751  
    9090    void NPN_ReleaseObject(NPObject*);
    9191    bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName);
     92    void NPN_ReleaseVariantValue(NPVariant*);
    9293
    9394#ifdef XP_MACOSX
     
    124125
    125126    const std::string& identifier() const { return m_identifier; }
     127
     128    static NPNetscapeFuncs* netscapeFuncs();
    126129
    127130    void waitUntilDone();
  • branches/safari-536.28-branch/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj

    r134834 r135751  
    435435                        </File>
    436436                        <File
     437                                RelativePath="..\Tests\NPRuntimeCallsWithNullNPP.cpp"
     438                                >
     439                        </File>           
     440                        <File
    437441                                RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
    438442                                >
  • branches/safari-536.28-branch/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro

    r134834 r135751  
    2525    Tests/NPPNewFails.cpp \
    2626    Tests/NPPSetWindowCalledDuringDestruction.cpp \
     27    Tests/NPRuntimeCallsWithNullNPP.cpp \
    2728    Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
    2829    Tests/NPRuntimeRemoveProperty.cpp \
  • branches/safari-536.28-branch/Tools/GNUmakefile.am

    r116205 r135751  
    216216        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPDeallocateCalledBeforeNPShutdown.cpp \
    217217        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPSetWindowCalledDuringDestruction.cpp \
     218    Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp \
    218219        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
    219220        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp \
Note: See TracChangeset for help on using the changeset viewer.