diff options
author | Deepak Bhole <[email protected]> | 2011-03-28 13:41:16 -0400 |
---|---|---|
committer | Deepak Bhole <[email protected]> | 2011-03-28 13:41:16 -0400 |
commit | b0f9dfbe3ad0b2c0f49b3f6b633c01bd656177d7 (patch) | |
tree | 93f759e94244e0a88fcb28cd3267a0b2ba3d53a6 /netx/net/sourceforge/jnlp/PluginBridge.java | |
parent | 46f73ee707976028a9e9bfb4f96138d704b31185 (diff) |
Fixed classloader sharing rules for applets
Diffstat (limited to 'netx/net/sourceforge/jnlp/PluginBridge.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/PluginBridge.java | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java index db006af..cbb6be1 100644 --- a/netx/net/sourceforge/jnlp/PluginBridge.java +++ b/netx/net/sourceforge/jnlp/PluginBridge.java @@ -132,10 +132,33 @@ public class PluginBridge extends JNLPFile { else security = null; - // Plugin needs to share classloaders so that applet instances from - // same page can communicate (there are applets known to require - // such communication for proper functionality) - this.uniqueKey = documentBase.toString(); + /* According to http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/applet-compatibility.html, + * classloaders are shared iff these properties match: + * codebase, cache_archive, java_archive, archive + * + * To achieve this, we create the uniquekey based on those 4 values, + * always in the same order. The initial "<NAME>=" parts ensure a + * bad tag cannot trick the loader into getting shared with another. + */ + + // Firefox sometimes skips the codebase if it is default -- ".", + // so set it that way if absent + String codebaseAttr = atts.get("codebase") != null ? + atts.get("codebase") : "."; + + String cache_archiveAttr = atts.get("cache_archive") != null ? + atts.get("cache_archive") : ""; + + String java_archiveAttr = atts.get("java_archive") != null ? + atts.get("java_archive") : ""; + + String archiveAttr = atts.get("archive") != null ? + atts.get("archive") : ""; + + this.uniqueKey = "codebase=" + codebaseAttr + + "cache_archive=" + cache_archiveAttr + + "java_archive=" + java_archiveAttr + + "archive=" + archiveAttr; usePack = false; useVersion = false; |