Skip to content
  • ggaren's avatar
    JavaScriptCore: · 6f017c14
    ggaren authored
            Reviewed by Darin Adler.
    
            http://bugs.webkit.org/show_bug.cgi?id=13029
            rdar://problem/4994849
            Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
            This doesn't actually change JavaScriptCore, but that's where npapi.h is.
    
            * bindings/npapi.h:
            Add headers member to NPStream struct.  Also increase NP_VERSION_MINOR to 18.
            Increasing to >= 17 allows plug-ins to safely detect whether to look for
            NPStream::headers.  Increasing from 17 to 18 reflects presence of NPObject
            enumeration, which was added in a prior patch, and which has been agreed to
            constitute version 18 by the plugin-futures list.  Also add other missing
            bits of npapi.h to catch up from 14 to 18.  This includes features that are
            not implemented in WebKit, but those are safely stubbed.
    
    LayoutTests:
    
            Reviewed by Darin Adler.
    
            http://bugs.webkit.org/show_bug.cgi?id=13029
            rdar://problem/4994849
            Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
    
            * http/tests/plugins/npapi-response-headers-expected.txt: Added.
            * http/tests/plugins/npapi-response-headers.html: Added.
            * http/tests/plugins/resources/load-me-1.txt: Added.
            * http/tests/plugins/resources/load-me-2.txt: Added.
    
    WebKit:
    
            Reviewed by Darin Adler.
    
            http://bugs.webkit.org/show_bug.cgi?id=13029
            rdar://problem/4994849
            Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
    
            * Plugins/WebBaseNetscapePluginStream.h: declarations.
            * Plugins/WebBaseNetscapePluginStream.mm: main implementation.
            (-[WebBaseNetscapePluginStream dealloc]): cleanup.
            (-[WebBaseNetscapePluginStream finalize]): cleanup.
            (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]):
            Pass headers along.
            (-[WebBaseNetscapePluginStream startStreamWithResponse:]):
            Main work is here.  Extract headers from NSHTTPURLResponse object into a byte sequence.
            See comments here about how it would be nice to have low-level access to the HTTP response.
            (-[WebBaseNetscapePluginStream _destroyStream]): cleanup.
            * Plugins/WebBaseNetscapePluginView.mm:
            (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
            Conform to new startStream params.  Not applicable here, pass nil.
    
    WebKitTools:
    
            Reviewed by Darin Adler.
    
            http://bugs.webkit.org/show_bug.cgi?id=13029
            rdar://problem/4994849
            Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
            Changes in WebKitTools are only for the NPAPI test plugin.
    
            * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: main test logic.
            (pluginInvoke): support null window argument for NPStream creation.
            (pluginAllocate): initialization.
            (pluginDeallocate): cleanup.
            (handleCallback): add second JS callback arg: header dump.
            (notifyStream): added; hook from NPP_NewStream to record headers.
            * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: declarations.
            * DumpRenderTree/TestNetscapePlugIn.subproj/main.c: call new header hook.
            (NPP_NewStream): call new header hook.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    6f017c14