JDK-7145764 : Refactor NPAPI plugin implementation
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-02-15
  • Updated: 2013-06-20
  • Resolved: 2012-02-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u4Fixed 8 b27Fixed
Related Reports
Relates :  
Description
Our NPAPI plugin source is hard to maintai/extend because:
  a) too much code is under #ifdef PLATFORM
  b) we use #include to add platform specific extensions to the class
  c) some JNI symbols are only defined for some platforms
  d) we do not use C++
  e) no reasonable platform abstraction => hard to support shared crossplatform code

Comments
EVALUATION Things done: - Split MozPluginInstance into BasePlugin and JavaPlugin. The idea is that base plugin can be eventually instantiated too and it will not know how to spawn JVM. We will use it to provide DT like functionality from same NPAPI plugin - Eliminated #ifdef PLATFORM by moving code to platform specific extensions. Use C++ way and extend base JavaPlugin class with platform specific extensions. Plugin instance is instantiated using JavaPlugin::Create (static method) whose implementation is in the platfrom specific code. Some other functions (e.g. NP_Initialize) are also moved to platform specific files. On other hand NP_GetValue and few others are made shared. They are not used on all platforms but there is not harm to provide them. - Eliminated stdafx.h We have too many of them and our build is fragile. Slight changes in the include directory order lead to broken build ... NPAPI specific code is moved to NPAPIPlatform.h. Common platfomr abstractions for string APIs are moved to DeployPlatform.h in the common folder - Fixed number of compiler warnings.
17-02-2012