-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||||||||||||||
/* | ||||||||||||||||
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. | ||||||||||||||||
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. | ||||||||||||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||||||||||||||||
* | ||||||||||||||||
* This code is free software; you can redistribute it and/or modify it | ||||||||||||||||
|
@@ -28,9 +28,6 @@ | |||||||||||||||
import java.lang.reflect.InvocationTargetException; | ||||||||||||||||
import java.lang.reflect.Method; | ||||||||||||||||
import java.security.AccessControlContext; | ||||||||||||||||
import java.security.AccessController; | ||||||||||||||||
import java.security.PrivilegedActionException; | ||||||||||||||||
import java.security.PrivilegedExceptionAction; | ||||||||||||||||
import java.util.List; | ||||||||||||||||
import java.util.Set; | ||||||||||||||||
|
||||||||||||||||
|
@@ -119,17 +116,6 @@ private static Object fwkInvokeWithContext(final Method method, | |||||||||||||||
}); | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
try { | ||||||||||||||||
return AccessController.doPrivileged((PrivilegedExceptionAction<Object>) | ||||||||||||||||
() -> MethodHelper.invoke(method, instance, args), acc); | ||||||||||||||||
} catch (PrivilegedActionException ex) { | ||||||||||||||||
Throwable cause = ex.getCause(); | ||||||||||||||||
if (cause == null) | ||||||||||||||||
cause = ex; | ||||||||||||||||
else if (cause instanceof InvocationTargetException | ||||||||||||||||
&& cause.getCause() != null) | ||||||||||||||||
cause = cause.getCause(); | ||||||||||||||||
throw cause; | ||||||||||||||||
} | ||||||||||||||||
return MethodHelper.invoke(method, instance, args); | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of the try/catch is causing a test failure in
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed as suggested. |
||||||||||||||||
} | ||||||||||||||||
} |
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.
https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp#L325-L330
All Java methods in
javafx.web
that are namedfwk*
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!