[Webkit-unassigned] [Bug 13064] New: NPRuntime: allow enumeration of object members

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 13 20:29:10 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=13064

           Summary: NPRuntime: allow enumeration of object members
           Product: WebKit
           Version: 522+ (nightly)
          Platform: All
               URL: http://bugzilla.mozilla.org/show_bug.cgi?id=296159
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Enhancement
          Priority: P3
         Component: Plug-ins
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dmeketa at adobe.com


Mozilla has added a new ability in NPRuntime: enumerate the members of an
object's class.  This can be seen at the Mozilla bug in the URL field.  This
functionality will generally improve NPRuntime communication in both directions
(browser to client and client to browser).

There are two interfaces: NPN_Enumerate and NPClass::enumerate.  Under the
covers, there are two aspects to implement: (1) expose to NPRuntime clients
(using either interface) the ability to enumerate WebKit JS objects, and (2)
expose to WebKit JS scripts the ability to enumerate NPRuntime objects (e.g.
using for-in loops) for which clients have provided an NPClass::enumerate.

See bug 13029, in which we are attempting to add support for HTTP response
headers through the NPAPI.  If that patch is landed, then WebKit will be
returning 18 for minor version via NPN_GetVersion, but will be missing
NPN_Enumerate and NPClass::enumerate, which were added in minor version 17. 
The proposed patch for bug 13029 is working around this by providing a NULL
pointer in NPNetscapeFuncs::enumerate, and declaring version 1 in
NPClass::structVersion.  This is not a great situation, but we want to solve
bug 13029 without having to wait for an enumeration implementation, and the
NPAPI has a lousy flat versioning scheme.  If and when enumeration support is
added, assuming the bug 13029 patch has landed, remember to do the following:

- Fill in non-NULL pointers for NPNetscapeFuncs::enumerate in
WebNetscapePluginPackage -load (two places, CFM and Mach).

- In npapi.h, remove the "not implemented" comment at
NPVERS_HAS_NPRUNTIME_ENUMERATION.

- In npruntime.h, redefine NP_CLASS_STRUCT_VERSION as 2 and add the enumerate
member of NPClass at the end.

- Anywhere NPClass structs are used, remove hard-coded versions of 1 and
replace with NP_CLASS_STRUCT_VERSION, and fill in the enumerate member.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list