JDK-8169204 : Need to document JSObject Call and setSlot APIs to use weak references
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8u102,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-11-03
  • Updated: 2017-01-30
  • Resolved: 2016-11-05
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 8 JDK 9
8u131Fixed 9Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
In order to fix JDK-8089681 we now use weak references in the WebKit JavaScript bridge code to hold onto Java objects that are bound to JavaScript objects using JSObject.setMember.

The above behaviour need to  updated for other JSObject APIs like "call" and "setSlot" also in order to address JDK-8168625

Applications that rely on the previous, buggy behavior might be surprised by the fact that objects that are not strongly held by the application are subject to garbage collection even though they are bound to a JavaScript object.

We should document this fact in the WebEngine documentation in the section on "Calling back to Java from JavaScript".

Comments
Changeset: de0071f81192 Author: mbilla Date: 2016-11-05 21:55 +0530 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/de0071f81192
05-11-2016

Looks good. +1
05-11-2016

Incorportated above comments.. webrev: http://cr.openjdk.java.net/~mbilla/8169204/webrev.01/
05-11-2016

I recommend to switch the order of call and setSlot, so that setmember and setSlot are together. Also, we generally use the Oxford comma in our documentation, so please put a comma before the "and" in the list of methods.
05-11-2016

webrev: http://cr.openjdk.java.net/~mbilla/8169204/webrev.00/
04-11-2016

Note that the documentation needs to go into the WebEngine class.
03-11-2016