Changeset 70190 in webkit


Ignore:
Timestamp:
Oct 20, 2010 4:39:37 PM (14 years ago)
Author:
Adam Roben
Message:

Don't require the plugin to always use the same NPP struct we gave it in NPP_New

Neither WebCore, nor WebKit/mac, nor Firefox requires this, and
Shockwave (at least) seems to use a different NPP struct that contains
the same ndata member. So we shouldn't enforce it, either.

Fixes <http://webkit.org/b/47690> <rdar://problem/8553020> Assertion
failure in NetscapePlugin::fromNPP when using Shockwave in WebKit2

Reviewed by John Sullivan.

WebKit2:

  • WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

(WebKit::NetscapePlugin::fromNPP): Removed the bogus assertion.

WebKitTools:

Test that passing a different NPP struct back to the browser doesn't
cause an assertion failure

  • DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp: Copied from WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp.

(PassDifferentNPPStruct::PassDifferentNPPStruct): Initialize our
members.
(PassDifferentNPPStruct::NPP_SetWindow): Pass a different NPP to the
browser than the one it gave us in NPP_New and see if it works.

  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
  • DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:

Added PassDifferentNPPStruct.

LayoutTests:

Test that passing a different NPP struct back to the browser doesn't
cause an assertion failure

  • plugins/pass-different-npp-struct-expected.txt: Added.
  • plugins/pass-different-npp-struct.html: Added.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70189 r70190  
     12010-10-14  Adam Roben  <aroben@apple.com>
     2
     3        Test that passing a different NPP struct back to the browser doesn't
     4        cause an assertion failure
     5
     6        Test for <http://webkit.org/b/47690> <rdar://problem/8553020>
     7        Assertion failure in NetscapePlugin::fromNPP when using Shockwave in
     8        WebKit2
     9
     10        Reviewed by John Sullivan.
     11
     12        * plugins/pass-different-npp-struct-expected.txt: Added.
     13        * plugins/pass-different-npp-struct.html: Added.
     14
    1152010-10-20  Kenneth Russell  <kbr@google.com>
    216
  • trunk/WebKit2/ChangeLog

    r70180 r70190  
     12010-10-14  Adam Roben  <aroben@apple.com>
     2
     3        Don't require the plugin to always use the same NPP struct we gave it
     4        in NPP_New
     5
     6        Neither WebCore, nor WebKit/mac, nor Firefox requires this, and
     7        Shockwave (at least) seems to use a different NPP struct that contains
     8        the same ndata member. So we shouldn't enforce it, either.
     9
     10        Fixes <http://webkit.org/b/47690> <rdar://problem/8553020> Assertion
     11        failure in NetscapePlugin::fromNPP when using Shockwave in WebKit2
     12
     13        Reviewed by John Sullivan.
     14
     15        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     16        (WebKit::NetscapePlugin::fromNPP): Removed the bogus assertion.
     17
    1182010-10-20  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r69155 r70190  
    7878PassRefPtr<NetscapePlugin> NetscapePlugin::fromNPP(NPP npp)
    7979{
    80     if (npp) {
    81         NetscapePlugin* plugin = static_cast<NetscapePlugin*>(npp->ndata);
    82         ASSERT(npp == &plugin->m_npp);
    83        
    84         return plugin;
    85     }
     80    if (npp)
     81        return static_cast<NetscapePlugin*>(npp->ndata);
    8682
    8783    // FIXME: Return the current NetscapePlugin here.
  • trunk/WebKitTools/ChangeLog

    r70188 r70190  
     12010-10-14  Adam Roben  <aroben@apple.com>
     2
     3        Test that passing a different NPP struct back to the browser doesn't
     4        cause an assertion failure
     5
     6        Test for <http://webkit.org/b/47690> <rdar://problem/8553020>
     7        Assertion failure in NetscapePlugin::fromNPP when using Shockwave in
     8        WebKit2
     9
     10        Reviewed by John Sullivan.
     11
     12        * DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp: Copied from WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp.
     13        (PassDifferentNPPStruct::PassDifferentNPPStruct): Initialize our
     14        members.
     15        (PassDifferentNPPStruct::NPP_SetWindow): Pass a different NPP to the
     16        browser than the one it gave us in NPP_New and see if it works.
     17
     18        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
     19        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
     20        Added PassDifferentNPPStruct.
     21
    1222010-10-19  Adam Roben  <aroben@apple.com>
    223
  • trunk/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj

    r69199 r70190  
    131131                BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */; };
    132132                BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF6C64F0C98E9C000AC063E /* GCController.cpp */; };
     133                C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */; };
    133134                E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */; };
    134135                E1B7816711AF31C3007E1BC2 /* MockGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */; };
     
    303304                BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerMac.mm; path = mac/AccessibilityControllerMac.mm; sourceTree = "<group>"; };
    304305                BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = GCController.cpp; sourceTree = "<group>"; };
     306                C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PassDifferentNPPStruct.cpp; sourceTree = "<group>"; };
    305307                E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockGeolocationProvider.h; path = mac/MockGeolocationProvider.h; sourceTree = "<group>"; };
    306308                E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockGeolocationProvider.mm; path = mac/MockGeolocationProvider.mm; sourceTree = "<group>"; };
     
    458460                                1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */,
    459461                                1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */,
     462                                C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */,
    460463                                1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */,
    461464                        );
     
    734737                                1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */,
    735738                                1A24BAA9120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp in Sources */,
     739                                C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */,
    736740                        );
    737741                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj

    r68891 r70190  
    384384                        </File>
    385385                        <File
     386                                RelativePath="..\Tests\PassDifferentNPPStruct.cpp"
     387                                >
     388                        </File>
     389                        <File
    386390                                RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
    387391                                >
Note: See TracChangeset for help on using the changeset viewer.