Ignore:
Timestamp:
Apr 12, 2007, 9:32:51 PM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/npapi.h

    r20613 r20867  
    105105
    106106#define NP_VERSION_MAJOR 0
    107 #define NP_VERSION_MINOR 17
     107#define NP_VERSION_MINOR 18
    108108
    109109
     
    188188    uint32       lastmodified;
    189189    void*        notifyData;
     190    const char*  headers;      /* Response headers from host.
     191                                * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
     192                                * Used for HTTP only; NULL for non-HTTP.
     193                                * Available from NPP_NewStream onwards.
     194                                * Plugin should copy this data before storing it.
     195                                * Includes HTTP status line and all headers,
     196                                * preferably verbatim as received from server,
     197                                * headers formatted as in HTTP ("Header: Value"),
     198                                * and newlines (\n, NOT \r\n) separating lines.
     199                                * Terminated by \n\0 (NOT \n\n\0). */
    190200} NPStream;
    191201
     
    315325
    316326    /* Get the NPObject for scripting the plugin. */
    317     NPPVpluginScriptableNPObject  = 15
     327    NPPVpluginScriptableNPObject  = 15,
     328
     329    /* Get the plugin value (as \0-terminated UTF-8 string data) for
     330     * form submission if the plugin is part of a form. Use
     331     * NPN_MemAlloc() to allocate memory for the string data.
     332     */
     333    NPPVformValue = 16    /* Not implemented in WebKit */
    318334} NPPVariable;
    319335
     
    588604#define NPVERS_68K_HAS_LIVECONNECT    11
    589605#define NPVERS_HAS_WINDOWLESS       11
     606#define NPVERS_HAS_XPCONNECT_SCRIPTING    13  /* Not implemented in WebKit */
     607#define NPVERS_HAS_NPRUNTIME_SCRIPTING    14
     608#define NPVERS_HAS_FORM_VALUES            15  /* Not implemented in WebKit; see bug 13061 */
     609#define NPVERS_HAS_POPUPS_ENABLED_STATE   16  /* Not implemented in WebKit */
     610#define NPVERS_HAS_RESPONSE_HEADERS       17
     611#define NPVERS_HAS_NPOBJECT_ENUM          18
    590612
    591613
Note: See TracChangeset for help on using the changeset viewer.