EVALUATION
The new Java Plug-in for Firefox is mostly an NPAPI plugin, meaning
that it runs not only in the Firefox browser but in any browser
supporting the standard NPAPI plugin interfaces. However, until now
the plugin has relied on Firefox-specific XPCOM functionality in order
to get access to the browser's cookie, proxy and authentication
information.
Mozilla has just added entry points to the NPAPI, which will ship for
the first time in Firefox 3.1, to access this functionality in a
browser-independent fashion. This webrev updates the native code for
the Java Plug-In to take advantage of these entry points when they are
available. The previous XPCOM code remains as a fallback for
compatibility with Firefox 3.0.x.
In order to take advantage of these entry points, the
plugin2_mozilla_headers needed to be updated. Mozilla has
significantly cleaned up these headers since our initial snapshot was
taken and the new snapshot is much smaller and requires almost no
modifications to work in our build system. Unfortunately, due to
certain data type differences and cleanups that occurred on the
Mozilla side, the new headers are not compatible with the previous
Java Plug-In's code. This means that starting with 6u14 build 02, the
new Java Plug-In requires an upgrade of the plugin2_mozilla_headers
which will not compile with the source code for 6u10 through 6u14
build 01. ALT_MOZILLA_HEADERS_PATH can be set to a directory
containing a snapshot of /java/devtools/share/plugin/ (subdirectories
needed are plugin2_mozilla_headers and either mozilla_headers_18 or
mozilla_headers_18.win32) in a build script to work around this issue.
The new headers are currently located in
/java/devtools/share/plugin/plugin2_mozilla_headers.tar.gz . They have
not yet been unpacked to that directory, but will be upon integration
of 6u14 build 02.
A certain amount of code refactoring was needed in order to move the
associated methods on to the Plugin instance from the various Service
classes, in order to have access to the browser's plugin instance
pointer (NPP) to make the native method calls. Cookie and browser
authenticator lookups were refactored cleanly, but the code associated
with proxy lookups is very complicated so a partial solution was taken
involving continuing to use a Mozilla-specific browser service and
thread-local storage to obtain the current plugin instance.
These changes have been tested on the following platforms. Manual
verification has been performed to ensure that the new code paths are
being taken in Firefox 3.1 and that they are working correctly.
Windows: IE 7, Firefox 3.0, Firefox 3.1
Solaris/x86: Firefox 3.0
Linux/x86: Firefox 3.0, Firefox 3.1
|