[Webkit-unassigned] [Bug 57859] Add implementations of JavaInstance, JavaClass, JavaField and JavaMethod that simply proxy calls to a listener.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 7 09:28:26 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=57859





--- Comment #10 from Alexey Proskuryakov <ap at webkit.org>  2011-04-07 09:28:26 PST ---
I think that implementation of remote Java objects should either be common with other remote objects, or it should at least be similar to how out of process NPAPI plug-ins are implemented.

The former can be challenging, especially since some of out of process NPAPI plug-in code is not in open source. But the latter is something that should be considered if we don't want our heads explode.

I can see several differences with NPAPI here:

1) WebKit IPC is implemented in WebKit, not in WebCore, so NPAPI remote objects also live in WebKit. With WebKit2, that is now cross-platform of course (for all platforms that adopt WebKit2). This distinction may seem minor, but I don't see what other platforms would do with proxy Java classes that are being added to WebCore here. And if it's only for Android, it should live in Android WebKit.

2) NPAPI objects don't have a common class for local and remote objects. I don't see any reason for Java to have a common class other than code sharing - but inheritance is an anti-pattern for code sharing. Since these objects behave so differently, I think that JavaInstance and ProxyJavaInstance should be separate JSC::Bindings::Instance subclasses. This objection is more about bug 55383, in fact.

3) If I'm reading this patch correctly, it uses yet another level of inheritance to actually implement IPC (e.g. invokeMethod is pure virtual). This use of inheritance to supply an implementation is against common WebKit practices - we would have a separate class to provide implementation. See e.g. the relationship between ProxyInstance and NetscapePluginInstanceProxy in WebKit/mac.

I'm not saying that out of process NPAPI implementation in WebKit/mac is necessarily the ideal, but it's the most modern code we have for Instance subclasses. If you prefer to do something differently, we should at least agree that the same would be better for NPAPI in the future.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list