Changeset 86476 in webkit


Ignore:
Timestamp:
May 13, 2011 6:05:13 PM (13 years ago)
Author:
andersca@apple.com
Message:

2011-05-13 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load
https://bugs.webkit.org/show_bug.cgi?id=60823
<rdar://problem/9430386>

Add test that calls NPN_GetURLNotify on a URL that can't be loaded, and checks if NPP_URLNotify is called.

  • DumpRenderTree/DumpRenderTree.gypi:
  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
  • DumpRenderTree/TestNetscapePlugIn/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp: Added. (GetURLNotifyWithURLThatFailsToLoad::GetURLNotifyWithURLThatFailsToLoad): (GetURLNotifyWithURLThatFailsToLoad::NPP_New): (GetURLNotifyWithURLThatFailsToLoad::NPP_URLNotify):
  • DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
  • DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
  • GNUmakefile.am:

2011-05-13 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load
https://bugs.webkit.org/show_bug.cgi?id=60823
<rdar://problem/9430386>

Add test.

  • plugins/get-url-notify-with-url-that-fails-to-load-expected.txt: Added.
  • plugins/get-url-notify-with-url-that-fails-to-load.html: Added.

2011-05-13 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load
https://bugs.webkit.org/show_bug.cgi?id=60823
<rdar://problem/9430386>

If a plug-in stream fails to load before it's been started, we won't destroy the stream.

  • WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): Call notifyAndDestroyStream which will call NPP_URLNotify if necessary, and also destroy the stream.

(WebKit::NetscapePluginStream::notifyAndDestroyStream):
Pass the request URL to NPP_URLNotify, matching other browsers.

Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86474 r86476  
     12011-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load
     6        https://bugs.webkit.org/show_bug.cgi?id=60823
     7        <rdar://problem/9430386>
     8
     9        Add test.
     10
     11        * plugins/get-url-notify-with-url-that-fails-to-load-expected.txt: Added.
     12        * plugins/get-url-notify-with-url-that-fails-to-load.html: Added.
     13
    1142011-05-13  Andrew Wilson  <atwilson@chromium.org>
    215
  • trunk/Source/WebKit2/ChangeLog

    r86473 r86476  
     12011-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load
     6        https://bugs.webkit.org/show_bug.cgi?id=60823
     7        <rdar://problem/9430386>
     8
     9        If a plug-in stream fails to load before it's been started, we won't destroy the stream.
     10
     11        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
     12        (WebKit::NetscapePluginStream::stop):
     13        Call notifyAndDestroyStream which will call NPP_URLNotify if necessary, and also destroy the stream.
     14
     15        (WebKit::NetscapePluginStream::notifyAndDestroyStream):
     16        Pass the request URL to NPP_URLNotify, matching other browsers.
     17
    1182011-05-13  Michael Saboff  <msaboff@apple.com>
    219
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp

    r86467 r86476  
    281281    // The stream was stopped before it got a chance to start. This can happen if a stream is cancelled by
    282282    // WebKit before it received a response.
    283     if (!m_isStarted)
    284         return;
     283    if (!m_isStarted) {
     284        ASSERT(reason != NPRES_DONE);
     285        notifyAndDestroyStream(reason);
     286        return;
     287    }
    285288
    286289    if (reason == NPRES_DONE && m_deliveryData && !m_deliveryData->isEmpty()) {
     
    346349   
    347350    if (m_sendNotification) {
    348         m_plugin->NPP_URLNotify(m_responseURL.data(), reason, m_notificationData);
     351        m_plugin->NPP_URLNotify(m_requestURLString.utf8().data(), reason, m_notificationData);
    349352   
    350353#if !ASSERT_DISABLED
  • trunk/Tools/ChangeLog

    r86468 r86476  
     12011-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load
     6        https://bugs.webkit.org/show_bug.cgi?id=60823
     7        <rdar://problem/9430386>
     8
     9        Add test that calls NPN_GetURLNotify on a URL that can't be loaded, and checks if NPP_URLNotify is called.
     10
     11        * DumpRenderTree/DumpRenderTree.gypi:
     12        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
     13        * DumpRenderTree/TestNetscapePlugIn/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp: Added.
     14        (GetURLNotifyWithURLThatFailsToLoad::GetURLNotifyWithURLThatFailsToLoad):
     15        (GetURLNotifyWithURLThatFailsToLoad::NPP_New):
     16        (GetURLNotifyWithURLThatFailsToLoad::NPP_URLNotify):
     17        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
     18        * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
     19        * GNUmakefile.am:
     20
    1212011-05-13  Anders Carlsson  <andersca@apple.com>
    222
  • trunk/Tools/DumpRenderTree/DumpRenderTree.gypi

    r86467 r86476  
    5353            'TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp',
    5454            'TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp',
     55            'TestNetscapePlugIn/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp',
    5556            'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURL.cpp',
    5657            'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp',
  • trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj

    r86467 r86476  
    4848                1AD4CB2212A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */; };
    4949                1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */; };
     50                1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */; };
    5051                23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23BCB88F0EA57623003C6289 /* OpenGL.framework */; };
    5152                29CFBA10122736E600BC30C0 /* AccessibilityTextMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */; };
     
    226227                1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetUserAgentWithNullNPPFromNPPNew.cpp; sourceTree = "<group>"; };
    227228                1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableNPObjectInvokeDefault.cpp; sourceTree = "<group>"; };
     229                1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLNotifyWithURLThatFailsToLoad.cpp; sourceTree = "<group>"; };
    228230                23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
    229231                29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarker.h; sourceTree = "<group>"; };
     
    490492                                1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
    491493                                C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */,
     494                                1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */,
    492495                                1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */,
    493496                                1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */,
     
    804807                                C031182B134E4A2B00919757 /* NPPSetWindowCalledDuringDestruction.cpp in Sources */,
    805808                                1A5CC1F5137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp in Sources */,
     809                                1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */,
    806810                        );
    807811                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj

    r86467 r86476  
    399399                        </File>
    400400                        <File
     401                                RelativePath="..\Tests\GetURLNotifyWithURLThatFailsToLoad.cpp"
     402                                >
     403                        </File>
     404                        <File
    401405                                RelativePath="..\Tests\GetURLWithJavaScriptURL.cpp"
    402406                                >
  • trunk/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro

    r86467 r86476  
    3131          Tests/DocumentOpenInDestroyStream.cpp \
    3232          Tests/EvaluateJSAfterRemovingPluginElement.cpp \
     33          Tests/GetURLNotifyWithURLThatFailsToLoad.cpp \
    3334          Tests/GetURLWithJavaScriptURL.cpp \
    3435          Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp \
  • trunk/Tools/GNUmakefile.am

    r86467 r86476  
    186186        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
    187187        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp \
     188        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp \
    188189        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLWithJavaScriptURL.cpp \
    189190        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp \
Note: See TracChangeset for help on using the changeset viewer.