-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8342460: Remove calls to doPrivileged in javafx.web #1620
base: master
Are you sure you want to change the base?
8342460: Remove calls to doPrivileged in javafx.web #1620
Conversation
👋 Welcome back angorya! A progress list of the required criteria for merging this PR into |
@andy-goryachev-oracle This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
cause = cause.getCause(); | ||
throw cause; | ||
} | ||
return MethodHelper.invoke(method, instance, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the whole fwkInvokeWithContext
method and associated constants can be safely removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very unlikely, but I'll take a look when fixing JDK-8342993, since this method is on my list to be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this private method being called...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Java methods in javafx.web
that are named fwk*
are called by native WebKit code via JNI upcalls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch. it would be nice to have the method commented or annotated somehow...
thank you for clarification!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it would. Instead we just have to "know" the convention. Not very satisfying, is it!
@andy-goryachev-oracle |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for one problem that needs to be fixed. I also left a question inline about removed comment lines.
} catch (@SuppressWarnings("removal") AccessControlException ex) { | ||
errorCode = LoadListenerClient.PERMISSION_DENIED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent. This was on my list for JDK-8342998, so one less thing for me to do for that (actually, two less things, since you also took care of the one in URLLoader.java
).
cause = cause.getCause(); | ||
throw cause; | ||
} | ||
return MethodHelper.invoke(method, instance, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the try/catch is causing a test failure in JavaScriptBridgeTest
because InvocationTargetException
is now thrown rather than InvocationTargetException::getCause
.
return MethodHelper.invoke(method, instance, args); | |
try { | |
return MethodHelper.invoke(method, instance, args); | |
} catch (InvocationTargetException ex) { | |
Throwable cause = ex.getCause(); | |
throw cause != null ? cause : ex; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed as suggested.
is this test being run as part of GHA or the headful test suite?
@@ -830,9 +826,7 @@ private Button addButton(ToolBar toolbar, final String iconName, String tooltipT | |||
button.getStyleClass().add(styleClass); | |||
toolbar.getItems().add(button); | |||
|
|||
@SuppressWarnings("removal") | |||
Image icon = AccessController.doPrivileged((PrivilegedAction<Image>) () -> new Image(HTMLEditorSkin.class.getResource(iconName).toString())); | |||
// button.setGraphic(new ImageView(icon)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you removed this comment. Do you think there is no value in leaving it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted here and below.
((StyleableProperty)toggleButton.graphicProperty()).applyStyle(null, new ImageView(icon)); | ||
// toggleButton.setGraphic(new ImageView(icon)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above.
@arapte Can you be the second reviewer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with one minor comment. Please take a look.
messageCallback.call(message); | ||
return null; | ||
}, webEngine.page.getAccessControlContext()); | ||
messageCallback.call(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuppressWarnings("removal") can be removed from this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed, thanks!
Removes
doPrivileged
calls in the javafx.web module, excluding the code in{android,ios}
./reviewers 2
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1620/head:pull/1620
$ git checkout pull/1620
Update a local copy of the PR:
$ git checkout pull/1620
$ git pull https://git.openjdk.org/jfx.git pull/1620/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1620
View PR using the GUI difftool:
$ git pr show -t 1620
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1620.diff
Using Webrev
Link to Webrev Comment