Changeset 24118 in webkit


Ignore:
Timestamp:
Jul 9, 2007 11:28:49 AM (17 years ago)
Author:
andersca
Message:

LayoutTests:

Reviewed by Oliver.

<rdar://problem/4954319>
Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at
com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0


Add tests.


  • plugins/return-error-from-new-stream-callback-in-full-frame-plugin-expected.txt: Added.
  • plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html: Added.

WebCore:

Reviewed by Oliver.

Add DocumentLoader::isLoadingMainResource.

  • WebCore.exp:

WebKit:

Reviewed by Oliver.

<rdar://problem/4954319>
Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at
com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0

Add a new initWithFrameLoader: method to WebNetscapePluginStream which is to be used when
the stream is a "fake" stream for full frame plug-ins.


  • Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
  • Plugins/WebNetscapePluginStream.h:
  • Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream initWithFrameLoader:]): (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream cancelLoadWithError:]): (-[WebNetscapePluginStream stop]):
  • WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createFrame):

WebKitTools:

Reviewed by Oliver.

<rdar://problem/4954319>
Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at
com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0


If the src url is "data:application/x-webkit-test-netscape,returnerrorfromnewstream",
return an error from NPP_NewStream.


  • DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: (pluginAllocate):
  • DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
  • DumpRenderTree/TestNetscapePlugIn.subproj/main.c: (NPP_New): (NPP_NewStream):
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r24099 r24118  
     12007-07-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        <rdar://problem/4954319>
     6        Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at
     7        com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0
     8       
     9        Add tests.
     10       
     11        * plugins/return-error-from-new-stream-callback-in-full-frame-plugin-expected.txt: Added.
     12        * plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html: Added.
     13
    1142007-07-08  Mitz Pettel  <mitz@webkit.org>
    215
  • trunk/WebCore/ChangeLog

    r24116 r24118  
     12007-07-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        Add DocumentLoader::isLoadingMainResource.
     6
     7        * WebCore.exp:
     8
    192007-07-09  John Sullivan  <sullivan@apple.com>
    210
  • trunk/WebCore/WebCore.exp

    r24115 r24118  
    568568__ZNK7WebCore14DocumentLoader19isLoadingInAPISenseEv
    569569__ZNK7WebCore14DocumentLoader19originalRequestCopyEv
     570__ZNK7WebCore14DocumentLoader21isLoadingMainResourceEv
    570571__ZNK7WebCore14DocumentLoader3URLEv
    571572__ZNK7WebCore14DocumentLoader5titleEv
  • trunk/WebKit/ChangeLog

    r24117 r24118  
     12007-07-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        <rdar://problem/4954319>
     6        Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at
     7        com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0
     8
     9        Add a new initWithFrameLoader: method to WebNetscapePluginStream which is to be used when
     10        the stream is a "fake" stream for full frame plug-ins.
     11       
     12        * Plugins/WebBaseNetscapePluginView.mm:
     13        (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
     14        * Plugins/WebNetscapePluginStream.h:
     15        * Plugins/WebNetscapePluginStream.mm:
     16        (-[WebNetscapePluginStream initWithFrameLoader:]):
     17        (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]):
     18        (-[WebNetscapePluginStream start]):
     19        (-[WebNetscapePluginStream cancelLoadWithError:]):
     20        (-[WebNetscapePluginStream stop]):
     21        * WebCoreSupport/WebFrameLoaderClient.mm:
     22        (WebFrameLoaderClient::createFrame):
     23
    1242007-07-09  John Sullivan  <sullivan@apple.com>
    225
  • trunk/WebKit/Plugins/WebBaseNetscapePluginView.mm

    r23977 r24118  
    19491949    ASSERT(!_manualStream);
    19501950   
    1951     _manualStream = [[WebNetscapePluginStream alloc] init];
     1951    _manualStream = [[WebNetscapePluginStream alloc] initWithFrameLoader:core([self webFrame])->loader()];
    19521952}
    19531953
  • trunk/WebKit/Plugins/WebNetscapePluginStream.h

    r19449 r24118  
    3131
    3232namespace WebCore {
     33    class FrameLoader;
    3334    class NetscapePlugInStreamLoader;
    3435}
     
    3738@interface WebNetscapePluginStream : WebBaseNetscapePluginStream
    3839{   
     40    WebCore::FrameLoader* _frameLoader;
    3941    WebCore::NetscapePlugInStreamLoader* _loader;
    4042    NSURLRequest *request;
    4143}
    4244
     45- (id)initWithFrameLoader:(WebCore::FrameLoader *)frameLoader;
    4346- (id)initWithRequest:(NSURLRequest *)theRequest
    4447               plugin:(NPP)thePlugin
  • trunk/WebKit/Plugins/WebNetscapePluginStream.mm

    r20694 r24118  
    5858#endif
    5959
    60 - initWithRequest:(NSURLRequest *)theRequest
     60- (id)initWithFrameLoader:(FrameLoader *)frameLoader
     61{
     62    _frameLoader = frameLoader;
     63   
     64    return self;
     65}
     66
     67- (id)initWithRequest:(NSURLRequest *)theRequest
    6168           plugin:(NPP)thePlugin
    6269       notifyData:(void *)theNotifyData
     
    108115{
    109116    ASSERT(request);
    110 
     117    ASSERT(!_frameLoader);
     118   
    111119    _loader->documentLoader()->addPlugInStreamLoader(_loader);
    112120    _loader->load(request);
     
    115123- (void)cancelLoadWithError:(NSError *)error
    116124{
     125    if (_frameLoader) {
     126        ASSERT(!_loader);
     127   
     128        DocumentLoader* documentLoader = _frameLoader->activeDocumentLoader();
     129        ASSERT(documentLoader);
     130       
     131        if (documentLoader->isLoadingMainResource())
     132            documentLoader->cancelMainResourceLoad(error);
     133        return;
     134    }
     135   
    117136    if (!_loader->isDone())
    118137        _loader->cancel(error);
     
    121140- (void)stop
    122141{
     142    ASSERT(!_frameLoader);
     143   
    123144    if (!_loader->isDone())
    124145        [self cancelLoadAndDestroyStreamWithError:_loader->cancelledError()];
  • trunk/WebKitTools/ChangeLog

    r24102 r24118  
     12007-07-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        <rdar://problem/4954319>
     6        Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at
     7        com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0
     8       
     9        If the src url is "data:application/x-webkit-test-netscape,returnerrorfromnewstream",
     10        return an error from NPP_NewStream.
     11       
     12        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c:
     13        (pluginAllocate):
     14        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
     15        * DumpRenderTree/TestNetscapePlugIn.subproj/main.c:
     16        (NPP_New):
     17        (NPP_NewStream):
     18
    1192007-07-08  Mark Rowe  <mrowe@apple.com>
    220
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c

    r20879 r24118  
    335335    newInstance->eventLogging = FALSE;
    336336    newInstance->logDestroy = FALSE;
     337    newInstance->returnErrorFromNewStream = FALSE;
    337338    newInstance->stream = 0;
    338339   
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h

    r20867 r24118  
    4141    NPBool eventLogging;
    4242    NPBool logDestroy;
     43    NPBool returnErrorFromNewStream;
    4344    NPObject* testObject;
    4445    NPStream* stream;
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.c

    r20867 r24118  
    8181            if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
    8282                obj->onStreamLoad = strdup(argv[i]);
     83            else if (strcasecmp(argn[i], "src") == 0 &&
     84                     strcasecmp(argv[i], "data:application/x-webkit-test-netscape,returnerrorfromnewstream") == 0)
     85                obj->returnErrorFromNewStream = TRUE;
    8386        }
    8487       
     
    115118    *stype = NP_ASFILEONLY;
    116119
    117     if (obj && (browser->version >= NPVERS_HAS_RESPONSE_HEADERS))
     120    if (obj->returnErrorFromNewStream)
     121        return NPERR_GENERIC_ERROR;
     122   
     123    if (browser->version >= NPVERS_HAS_RESPONSE_HEADERS)
    118124        notifyStream(obj, stream->url, stream->headers);
    119125
Note: See TracChangeset for help on using the changeset viewer.